diff --git a/src/key.c b/src/key.c index 539e857e..69ceb788 100644 --- a/src/key.c +++ b/src/key.c @@ -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; }