Skip to content

Commit abec842

Browse files
committed
wolfcrypt/src/asn.c: in wc_Ed25519PublicKeyToDer(), when old FIPS, cast "key" arg to wc_ed25519_export_public().
1 parent 656fe3d commit abec842

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

wolfcrypt/src/asn.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13510,7 +13510,11 @@ int wc_Ed25519PublicKeyToDer(const ed25519_key* key, byte* output, word32 inLen,
1351013510
return BAD_FUNC_ARG;
1351113511
}
1351213512

13513+
#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(7,0,0)
13514+
ret = wc_ed25519_export_public((ed25519_key *)key, pubKey, &pubKeyLen);
13515+
#else
1351313516
ret = wc_ed25519_export_public(key, pubKey, &pubKeyLen);
13517+
#endif
1351413518
if (ret == 0) {
1351513519
ret = SetAsymKeyDerPublic(pubKey, pubKeyLen, output, inLen,
1351613520
ED25519k, withAlg);

0 commit comments

Comments
 (0)