From c5fb65dff53be5bbb452bae7ba11647dae211505 Mon Sep 17 00:00:00 2001 From: Kurt Alfred Kluever Date: Thu, 5 Sep 2024 08:53:10 -0700 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 671389453 Change-Id: Iac9840a5be59b0d577410a9ee180db709c16ab19 --- .../com/google/crypto/tink/integration/awskms/BUILD.bazel | 1 + .../google/crypto/tink/integration/awskms/FakeAwsKms.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/crypto/tink/integration/awskms/BUILD.bazel b/src/main/java/com/google/crypto/tink/integration/awskms/BUILD.bazel index 54b0d34..fe24351 100644 --- a/src/main/java/com/google/crypto/tink/integration/awskms/BUILD.bazel +++ b/src/main/java/com/google/crypto/tink/integration/awskms/BUILD.bazel @@ -39,6 +39,7 @@ java_library( "@tink_java//src/main/java/com/google/crypto/tink:aead", "@tink_java//src/main/java/com/google/crypto/tink:key_templates", "@tink_java//src/main/java/com/google/crypto/tink:registry_cluster", + "@tink_java//src/main/java/com/google/crypto/tink:registry_configuration", "@maven//:com_amazonaws_aws_java_sdk_core", "@maven//:com_amazonaws_aws_java_sdk_kms", ], diff --git a/src/main/java/com/google/crypto/tink/integration/awskms/FakeAwsKms.java b/src/main/java/com/google/crypto/tink/integration/awskms/FakeAwsKms.java index 8b466e9..c3100fc 100644 --- a/src/main/java/com/google/crypto/tink/integration/awskms/FakeAwsKms.java +++ b/src/main/java/com/google/crypto/tink/integration/awskms/FakeAwsKms.java @@ -24,6 +24,7 @@ import com.google.crypto.tink.Aead; import com.google.crypto.tink.KeyTemplates; import com.google.crypto.tink.KeysetHandle; +import com.google.crypto.tink.RegistryConfiguration; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.security.GeneralSecurityException; @@ -50,7 +51,9 @@ private static byte[] serializeContext(Map encryptionContext) { public FakeAwsKms(List validKeyIds) throws GeneralSecurityException { for (String keyId : validKeyIds) { - Aead aead = KeysetHandle.generateNew(KeyTemplates.get("AES128_GCM")).getPrimitive(Aead.class); + Aead aead = + KeysetHandle.generateNew(KeyTemplates.get("AES128_GCM")) + .getPrimitive(RegistryConfiguration.get(), Aead.class); aeads.put(keyId, aead); } }