diff --git a/src/test/java/com/google/crypto/tink/integration/awskms/AwsKmsClientTest.java b/src/test/java/com/google/crypto/tink/integration/awskms/AwsKmsClientTest.java index 76cf2c3..8b96fa3 100644 --- a/src/test/java/com/google/crypto/tink/integration/awskms/AwsKmsClientTest.java +++ b/src/test/java/com/google/crypto/tink/integration/awskms/AwsKmsClientTest.java @@ -27,6 +27,7 @@ import com.google.crypto.tink.KeysetHandle; import com.google.crypto.tink.KmsClient; import com.google.crypto.tink.KmsClientsTestUtil; +import com.google.crypto.tink.RegistryConfiguration; import com.google.crypto.tink.aead.AeadConfig; import com.google.crypto.tink.aead.KmsAeadKeyManager; import com.google.crypto.tink.aead.KmsEnvelopeAead; @@ -165,13 +166,15 @@ public void registerBoundWithFakeAwsKms_kmsEnvelopeAeadCanOnlyBeCreatedForBounde // getPrimitive works for kekUri KeyTemplate envelopeTemplate = KmsEnvelopeAeadKeyManager.createKeyTemplate(kekUri, dekTemplate); KeysetHandle handle = KeysetHandle.generateNew(envelopeTemplate); - Aead unused = handle.getPrimitive(Aead.class); + Aead unused = handle.getPrimitive(RegistryConfiguration.get(), Aead.class); // getPrimitive does not work for kekUri2 KeyTemplate envelopeTemplate2 = KmsEnvelopeAeadKeyManager.createKeyTemplate(kekUri2, dekTemplate); KeysetHandle handle2 = KeysetHandle.generateNew(envelopeTemplate2); - assertThrows(GeneralSecurityException.class, () -> handle2.getPrimitive(Aead.class)); + assertThrows( + GeneralSecurityException.class, + () -> handle2.getPrimitive(RegistryConfiguration.get(), Aead.class)); } @Test @@ -192,14 +195,14 @@ public void registerTwoBoundWithFakeAwsKms_kmsAeadWorks() throws Exception { KeyTemplate kmsTemplate = KmsAeadKeyManager.createKeyTemplate(kekUri); KeysetHandle handle = KeysetHandle.generateNew(kmsTemplate); - Aead kmsAead = handle.getPrimitive(Aead.class); + Aead kmsAead = handle.getPrimitive(RegistryConfiguration.get(), Aead.class); byte[] ciphertext = kmsAead.encrypt(plaintext, associatedData); byte[] decrypted = kmsAead.decrypt(ciphertext, associatedData); assertThat(decrypted).isEqualTo(plaintext); KeyTemplate kmsTemplate2 = KmsAeadKeyManager.createKeyTemplate(kekUri2); KeysetHandle handle2 = KeysetHandle.generateNew(kmsTemplate2); - Aead kmsAead2 = handle2.getPrimitive(Aead.class); + Aead kmsAead2 = handle2.getPrimitive(RegistryConfiguration.get(), Aead.class); byte[] ciphertext2 = kmsAead2.encrypt(plaintext, associatedData); byte[] decrypted2 = kmsAead2.decrypt(ciphertext2, associatedData); assertThat(decrypted2).isEqualTo(plaintext); diff --git a/src/test/java/com/google/crypto/tink/integration/awskms/BUILD.bazel b/src/test/java/com/google/crypto/tink/integration/awskms/BUILD.bazel index c1b579a..5af1015 100644 --- a/src/test/java/com/google/crypto/tink/integration/awskms/BUILD.bazel +++ b/src/test/java/com/google/crypto/tink/integration/awskms/BUILD.bazel @@ -27,6 +27,7 @@ java_test( "@tink_java//src/main/java/com/google/crypto/tink:kms_client", "@tink_java//src/main/java/com/google/crypto/tink:kms_clients_test_util", "@tink_java//src/main/java/com/google/crypto/tink:registry_cluster", + "@tink_java//src/main/java/com/google/crypto/tink:registry_configuration", "@tink_java//src/main/java/com/google/crypto/tink/aead:aead_config", "@tink_java//src/main/java/com/google/crypto/tink/aead:kms_aead_key_manager", "@tink_java//src/main/java/com/google/crypto/tink/aead:kms_envelope_aead",