diff --git a/src/com/amazon/corretto/crypto/provider/EvpSignatureBase.java b/src/com/amazon/corretto/crypto/provider/EvpSignatureBase.java index 52498a7c..d1ad1cef 100644 --- a/src/com/amazon/corretto/crypto/provider/EvpSignatureBase.java +++ b/src/com/amazon/corretto/crypto/provider/EvpSignatureBase.java @@ -423,8 +423,9 @@ protected void sniffTest(final byte[] signature, final int offset, final int len // Right now we only check RSA signatures to ensure they are the proper length if (key_ instanceof RSAKey) { final RSAKey rsaKey = (RSAKey) key_; - if (length != (rsaKey.getModulus().bitLength() + 7) / 8) { - throw new SignatureException("RSA Signature of invalid length."); + final int expectedLength = (rsaKey.getModulus().bitLength() + 7) / 8; + if (length != expectedLength) { + throw new SignatureException("RSA Signature of invalid length. Expected " + expectedLength); } } }