reta commented on code in PR #3435:
URL: https://github.com/apache/cxf/pull/3435#discussion_r3913815268
##########
rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyDecryptionAlgorithm.java:
##########
@@ -41,22 +42,54 @@ public WrappedKeyDecryptionAlgorithm(Key cekDecryptionKey,
KeyAlgorithm supporte
this.cekDecryptionKey = cekDecryptionKey;
this.supportedAlgo = supportedAlgo;
this.unwrap = unwrap;
+ if (KeyAlgorithm.RSA1_5 == supportedAlgo) {
+ LOG.warning("The RSA1_5 JWE key encryption algorithm is
deprecated: RSAES-PKCS1-v1_5 is"
+ + " vulnerable to padding oracle attacks, consider migrating
to RSA-OAEP");
+ }
}
public byte[] getDecryptedContentEncryptionKey(JweDecryptionInput
jweDecryptionInput) {
KeyProperties keyProps = new
KeyProperties(getKeyEncryptionAlgorithm(jweDecryptionInput));
AlgorithmParameterSpec spec =
getAlgorithmParameterSpec(jweDecryptionInput);
if (spec != null) {
keyProps.setAlgoSpec(spec);
}
- if (!unwrap) {
- keyProps.setBlockSize(getKeyCipherBlockSize());
- return
CryptoUtils.decryptBytes(getEncryptedContentEncryptionKey(jweDecryptionInput),
- getCekDecryptionKey(), keyProps);
+ byte[] fallbackCek = supportedAlgo == KeyAlgorithm.RSA1_5
Review Comment:
Sorry @coheigea , may be missing something here, but if `fallbackCek` is
always random, how the decryption is going to work? The content is guaranteed
to be encrypted with different key, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]