aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorjuerg <juerg@google.com>2023-03-28 05:32:26 -0700
committerCopybara-Service <copybara-worker@google.com>2023-03-28 05:33:43 -0700
commit57c858c945eee79e78621a53ab323e61f2fe4041 (patch)
treec866e8a75eb1ccf18c2fb043a4e604d53ab00279 /tools
parent6a0f27a3466be70f3281ac8e914d7ac3a3b52fd0 (diff)
downloadtink-57c858c945eee79e78621a53ab323e61f2fe4041.tar.gz
Remove KMS support from Java and C++ AEAD test CLI.
These were used for cross-language tests. But the KMS AEADs are now tested cross-langauge in kms_aead_test.py, and so this is not needed anymore. PiperOrigin-RevId: 519999658
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/BUILD.bazel3
-rw-r--r--tools/testing/cc/BUILD.bazel6
-rw-r--r--tools/testing/cc/cli_util.cc46
-rw-r--r--tools/testing/java/com/google/crypto/tink/testing/AeadCli.java6
4 files changed, 0 insertions, 61 deletions
diff --git a/tools/testing/BUILD.bazel b/tools/testing/BUILD.bazel
index 2ba468a44..5ba5f41f3 100644
--- a/tools/testing/BUILD.bazel
+++ b/tools/testing/BUILD.bazel
@@ -44,8 +44,5 @@ java_binary(
"@tink_java//src/main/java/com/google/crypto/tink:aead",
"@tink_java//src/main/java/com/google/crypto/tink:registry_cluster",
"@tink_java//src/main/java/com/google/crypto/tink/aead:aead_config",
- "@tink_java//src/main/java/com/google/crypto/tink/integration/awskms:aws_kms_client",
- "@tink_java//src/main/java/com/google/crypto/tink/integration/gcpkms:gcp_kms_client",
- "@tink_java//src/main/java/com/google/crypto/tink/testing:test_util",
],
)
diff --git a/tools/testing/cc/BUILD.bazel b/tools/testing/cc/BUILD.bazel
index 9e6a26d93..34813794d 100644
--- a/tools/testing/cc/BUILD.bazel
+++ b/tools/testing/cc/BUILD.bazel
@@ -9,10 +9,6 @@ cc_library(
name = "cli_util",
srcs = ["cli_util.cc"],
hdrs = ["cli_util.h"],
- data = [
- "//testdata/aws:credentials",
- "//testdata/gcp:credentials",
- ],
deps = [
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
@@ -24,8 +20,6 @@ cc_library(
"@tink_cc//:kms_clients",
"@tink_cc//config:tink_config",
"@tink_cc//util:status",
- "@tink_cc_awskms//:aws_kms_client",
- "@tink_cc_gcpkms//:gcp_kms_client",
],
)
diff --git a/tools/testing/cc/cli_util.cc b/tools/testing/cc/cli_util.cc
index 0fc4d4fb7..72b776ed5 100644
--- a/tools/testing/cc/cli_util.cc
+++ b/tools/testing/cc/cli_util.cc
@@ -29,8 +29,6 @@
#include "tink/cleartext_keyset_handle.h"
#include "tink/config/tink_config.h"
#include "tink/input_stream.h"
-#include "tink/integration/awskms/aws_kms_client.h"
-#include "tink/integration/gcpkms/gcp_kms_client.h"
#include "tink/json_keyset_reader.h"
#include "tink/json_keyset_writer.h"
#include "tink/keyset_handle.h"
@@ -52,8 +50,6 @@ using crypto::tink::KeysetWriter;
using crypto::tink::KmsClients;
using crypto::tink::OutputStream;
using crypto::tink::TinkConfig;
-using crypto::tink::integration::awskms::AwsKmsClient;
-using crypto::tink::integration::gcpkms::GcpKmsClient;
using crypto::tink::util::Status;
namespace {
@@ -185,48 +181,6 @@ void CliUtil::InitTink() {
<< std::endl;
exit(1);
}
-
- Status gcp_result = InitGcp();
- if (!gcp_result.ok()) {
- std::clog << gcp_result.message() << std::endl;
- }
-
- Status aws_result = InitAws();
- if (!aws_result.ok()) {
- std::clog << aws_result.message() << std::endl;
- }
-}
-
-// static
-Status CliUtil::InitGcp() {
- std::string creds_file = std::string(getenv("TEST_SRCDIR")) +
- "/tools/testdata/gcp/credential.json";
- auto client_result = GcpKmsClient::New("", creds_file);
- if (!client_result.ok()) {
- return Status(absl::StatusCode::kInternal,
- "Failed to connect to GCP client.");
- }
- auto client_add_result = KmsClients::Add(std::move(client_result.value()));
- if (!client_add_result.ok()) {
- return Status(absl::StatusCode::kInternal, "Failed to add KMS client.");
- }
- return crypto::tink::util::OkStatus();
-}
-
-// static
-Status CliUtil::InitAws() {
- std::string creds_file = std::string(getenv("TEST_SRCDIR")) +
- "/tools/testdata/aws/credentials.ini";
- auto client_result = AwsKmsClient::New("", creds_file);
- if (!client_result.ok()) {
- return Status(absl::StatusCode::kInternal, "Failed to connect to AWS client.");
- }
- auto client_add_result =
- KmsClients::Add(std::move(client_result.value()));
- if (!client_add_result.ok()) {
- return Status(absl::StatusCode::kInternal, "Failed to add KMS client.");
- }
- return crypto::tink::util::OkStatus();
}
// static
diff --git a/tools/testing/java/com/google/crypto/tink/testing/AeadCli.java b/tools/testing/java/com/google/crypto/tink/testing/AeadCli.java
index 6fd0f27ae..7f81b80ff 100644
--- a/tools/testing/java/com/google/crypto/tink/testing/AeadCli.java
+++ b/tools/testing/java/com/google/crypto/tink/testing/AeadCli.java
@@ -19,9 +19,6 @@ package com.google.crypto.tink.testing;
import com.google.crypto.tink.Aead;
import com.google.crypto.tink.KeysetHandle;
import com.google.crypto.tink.aead.AeadConfig;
-import com.google.crypto.tink.integration.awskms.AwsKmsClient;
-import com.google.crypto.tink.integration.gcpkms.GcpKmsClient;
-import java.util.Optional;
/**
* A command-line utility for testing Aead-primitives. It requires 5 arguments: keyset-file: name of
@@ -44,9 +41,6 @@ public class AeadCli {
String associatedDataFile = args[3];
String outputFilename = args[4];
- GcpKmsClient.register(Optional.empty(), Optional.of(TestUtil.SERVICE_ACCOUNT_FILE));
- AwsKmsClient.register(
- Optional.of(TestUtil.AWS_KMS_TEST_KEY_URI), Optional.of(TestUtil.AWS_CREDS));
AeadConfig.register();
if (!(operation.equals("encrypt") || operation.equals("decrypt"))) {