mirror of
https://github.com/jwtk/jjwt.git
synced 2025-03-09 06:46:50 +00:00
Merge pull request #105 from aarondav/patch-2
Avoid potentially critical vulnerability in ECDSA signature validation
This commit is contained in:
commit
e55ea34e95
@ -319,8 +319,8 @@ public class DefaultJwtParser implements JwtParser {
|
|||||||
|
|
||||||
if (!Objects.isEmpty(keyBytes)) {
|
if (!Objects.isEmpty(keyBytes)) {
|
||||||
|
|
||||||
Assert.isTrue(!algorithm.isRsa(),
|
Assert.isTrue(algorithm.isHmac(),
|
||||||
"Key bytes cannot be specified for RSA signatures. Please specify a PublicKey or PrivateKey instance.");
|
"Key bytes can only be specified for HMAC signatures. Please specify a PublicKey or PrivateKey instance.");
|
||||||
|
|
||||||
key = new SecretKeySpec(keyBytes, algorithm.getJcaName());
|
key = new SecretKeySpec(keyBytes, algorithm.getJcaName());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user