Skip to content

Commit

Permalink
Display error message when signing with X25519 key
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Jan 29, 2024
1 parent ac4d7e4 commit b9f0255
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tool/yubico-piv-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,11 +1153,15 @@ static bool selfsign_certificate(ykpiv_state *state, enum enum_key_format key_fo
if(algorithm == 0) {
goto selfsign_out;
}
if(algorithm == YKPIV_ALGO_X25519) {
fprintf(stderr, "Signing with X25519 keys is not supported.\n");
goto selfsign_out;
}

size_t oid_len = 0;
const unsigned char *oid = 0;
const EVP_MD *md = NULL;
if (!YKPIV_IS_25519(algorithm)) {
if (algorithm != YKPIV_ALGO_ED25519) {
md = get_hash(hash, &oid, &oid_len);
if (md == NULL) {
goto selfsign_out;
Expand Down

0 comments on commit b9f0255

Please sign in to comment.