From 9d1f26d71925a17139a978b279ad5a46802cd6e3 Mon Sep 17 00:00:00 2001 From: Greg Rubin Date: Thu, 7 Mar 2024 11:35:33 -0800 Subject: [PATCH] Use LibCryptoRng for random IV --- src/com/amazon/corretto/crypto/provider/AesGcmSpi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/amazon/corretto/crypto/provider/AesGcmSpi.java b/src/com/amazon/corretto/crypto/provider/AesGcmSpi.java index 88b98d96..f45738b4 100644 --- a/src/com/amazon/corretto/crypto/provider/AesGcmSpi.java +++ b/src/com/amazon/corretto/crypto/provider/AesGcmSpi.java @@ -290,7 +290,7 @@ protected AlgorithmParameters engineGetParameters() { if (ivForParams == null) { // We aren't initialized so we return default and random values ivForParams = new byte[DEFAULT_IV_LENGTH_BYTES]; - new SecureRandom().nextBytes(ivForParams); + new LibCryptoRng().nextBytes(ivForParams); } parameters.init(new GCMParameterSpec(tagLength * 8, ivForParams)); return parameters;