Skip to content

Commit cd3ac2c

Browse files
author
Anirav Kareddy
committed
removed warnIfEncryptionContextIsPresent() method from this class and transferred it over to RawKeyring class which AES + RSA extend from (note: this method is only for AES + RSA Keyrings)
1 parent dfa7b4f commit cd3ac2c

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/main/java/software/amazon/encryption/s3/materials/S3Keyring.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,6 @@ public DecryptionMaterials onDecrypt(final DecryptionMaterials materials, List<E
129129

130130
abstract protected Map<String, DecryptDataKeyStrategy> decryptDataKeyStrategies();
131131

132-
/**
133-
* Checks if an encryption context is present in the EncryptionMaterials and issues a warning
134-
* if an encryption context is found.
135-
* <p>
136-
* Encryption context is not recommended for use with
137-
* non-KMS keyrings as it may not provide additional security benefits.
138-
*
139-
* @param materials EncryptionMaterials
140-
*/
141-
public void warnIfEncryptionContextIsPresent(EncryptionMaterials materials) {
142-
materials.s3Request().overrideConfiguration()
143-
.flatMap(overrideConfiguration ->
144-
overrideConfiguration.executionAttributes()
145-
.getOptionalAttribute(S3EncryptionClient.ENCRYPTION_CONTEXT))
146-
.ifPresent(ctx -> LogFactory.getLog(getClass()).warn("Usage of Encryption Context provides no security benefit in " + getClass().getSimpleName()));
147-
148-
}
149-
150132
abstract public static class Builder<KeyringT extends S3Keyring, BuilderT extends Builder<KeyringT, BuilderT>> {
151133
private boolean _enableLegacyWrappingAlgorithms = false;
152134
private SecureRandom _secureRandom;

0 commit comments

Comments
 (0)