Skip to content

Commit

Permalink
add more restrict to tags in piv import
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Dec 21, 2024
1 parent 69d7f0b commit 98b4f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int ck_parse_piv(ck_key_t *key, const uint8_t *buf, size_t buf_len) {
DBG_MSG("too short\n");
return KEY_ERR_LENGTH;
}
if (*p < 0x06 || *p > 0x08) {
if (*p != 0x06 && !(key->meta.type == ED25519 && *p == 0x07) && !(key->meta.type == X25519 && *p == 0x08)) {
DBG_MSG("invalid tag\n");
return KEY_ERR_DATA;
}
Expand Down

0 comments on commit 98b4f70

Please sign in to comment.