Skip to content

Commit dfa5f14

Browse files
Aleksei Voitylovgnu-andrew
authored andcommitted
8288508: Enhance ECDSA usage
Reviewed-by: mbalao, andrew Backport-of: efd603063e60ca6861b41309445d7b8e20768d9b
1 parent c0d6804 commit dfa5f14

File tree

1 file changed

+7
-1
lines changed
  • jdk/src/share/native/sun/security/ec/impl

1 file changed

+7
-1
lines changed

jdk/src/share/native/sun/security/ec/impl/ec.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Use is subject to license terms.
44
*
55
* This library is free software; you can redistribute it and/or
@@ -924,6 +924,12 @@ ECDSA_VerifyDigest(ECPublicKey *key, const SECItem *signature,
924924
}
925925

926926
ecParams = &(key->ecParams);
927+
928+
if (EC_ValidatePublicKey(ecParams, &key->publicValue, kmflag) != SECSuccess) {
929+
PORT_SetError(SEC_ERROR_BAD_KEY);
930+
goto cleanup;
931+
}
932+
927933
flen = (ecParams->fieldID.size + 7) >> 3;
928934
olen = ecParams->order.len;
929935
if (signature->len == 0 || signature->len%2 != 0 ||

0 commit comments

Comments
 (0)