Skip to content

Commit

Permalink
Also allow pub key to be der format
Browse files Browse the repository at this point in the history
  • Loading branch information
embhorn committed Jun 5, 2024
1 parent 7cf5995 commit 0aa8ba8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/sign-verify/clu_dgst_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,13 @@ int wolfCLU_dgst_setup(int argc, char** argv)

/* get type of key and size of structure */
if (ret == WOLFCLU_SUCCESS && signing == 0) {
pkey = wolfSSL_PEM_read_bio_PUBKEY(pubKeyBio, NULL, NULL, NULL);
if (inForm == PEM_FORM) {
pkey = wolfSSL_PEM_read_bio_PUBKEY(pubKeyBio, NULL, NULL, NULL);
}
else {
pkey = wolfSSL_d2i_PUBKEY_bio(pubKeyBio, NULL);
}

if (pkey == NULL) {
wolfCLU_LogError("Unable to decode public key");
ret = WOLFCLU_FATAL_ERROR;
Expand All @@ -372,7 +378,7 @@ int wolfCLU_dgst_setup(int argc, char** argv)
pkey = wolfSSL_d2i_PrivateKey_bio(pubKeyBio, NULL);
}
if (pkey == NULL) {
wolfCLU_LogError("Unable to decode public key");
wolfCLU_LogError("Unable to decode private key");
ret = WOLFCLU_FATAL_ERROR;
}
}
Expand Down

0 comments on commit 0aa8ba8

Please sign in to comment.