aboutsummaryrefslogtreecommitdiff
path: root/cc/experimental
diff options
context:
space:
mode:
authorlizatretyakova <lizatretyakova@google.com>2021-09-23 07:45:02 -0700
committerCopybara-Service <copybara-worker@google.com>2021-09-23 07:45:45 -0700
commitae57a0fabc41dcc98c2d288f102e5ccc849d6489 (patch)
tree184e7cb16f44cac2e7477ab55c5461d9bc2ad006 /cc/experimental
parentf849497faa54347bf5bf9e0100991723ca9a3f0a (diff)
downloadtink-ae57a0fabc41dcc98c2d288f102e5ccc849d6489.tar.gz
Replace the second batch of the deprecated crypto::tink::util::Status::error_code() calls with calls to an absl-compatible crypto::tink::util::Status::code().
PiperOrigin-RevId: 398485320
Diffstat (limited to 'cc/experimental')
-rw-r--r--cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_recipient_kem_boringssl_test.cc15
-rw-r--r--cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_sender_kem_boringssl_test.cc13
2 files changed, 15 insertions, 13 deletions
diff --git a/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_recipient_kem_boringssl_test.cc b/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_recipient_kem_boringssl_test.cc
index abf7ad230..a9037ce6e 100644
--- a/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_recipient_kem_boringssl_test.cc
+++ b/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_recipient_kem_boringssl_test.cc
@@ -118,8 +118,8 @@ const char kSaltHex[] = "0b0b0b0b";
const char kInfoHex[] = "0b0b0b0b0b0b0b0b";
// This test evaluates the creation of a Cecpq2HkdfRecipientKemBoringSslTest
-// instance with an unknown curve type. It should fail with an util::error::
-// UNIMPLEMENTED error.
+// instance with an unknown curve type. It should fail with an
+// absl::StatusCode::kUnimplemented error.
TEST(Cecpq2HkdfRecipientKemBoringSslTest, TestUnknownCurve) {
if (IsFipsModeEnabled()) {
GTEST_SKIP() << "Not supported in FIPS-only mode";
@@ -136,12 +136,13 @@ TEST(Cecpq2HkdfRecipientKemBoringSslTest, TestUnknownCurve) {
// The instance creation above should fail with an unimplemented algorithm
// error given the UNKNOWN_CURVE parameter
- EXPECT_EQ(util::error::UNIMPLEMENTED,
- status_or_recipient_kem.status().error_code());
+ EXPECT_EQ(absl::StatusCode::kUnimplemented,
+ status_or_recipient_kem.status().code());
}
// This test evaluates the case where a unsupported curve (NIST_P256) is
-// specified. This test should fail with an util::error::UNIMPLEMENTED error.
+// specified. This test should fail with an absl::StatusCode::kUnimplemented
+// error.
TEST(Cecpq2HkdfRecipientKemBoringSslTest, TestUnsupportedCurve) {
if (IsFipsModeEnabled()) {
GTEST_SKIP() << "Not supported in FIPS-only mode";
@@ -158,8 +159,8 @@ TEST(Cecpq2HkdfRecipientKemBoringSslTest, TestUnsupportedCurve) {
// The instance creation above should fail with an unimplemented algorithm
// error given the UNKNOWN_CURVE parameter
- EXPECT_EQ(util::error::UNIMPLEMENTED,
- status_or_recipient_kem.status().error_code());
+ EXPECT_EQ(absl::StatusCode::kUnimplemented,
+ status_or_recipient_kem.status().code());
}
// This test checks that an error is triggered if an output key lenth smaller
diff --git a/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_sender_kem_boringssl_test.cc b/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_sender_kem_boringssl_test.cc
index 10955f488..a593c0d4e 100644
--- a/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_sender_kem_boringssl_test.cc
+++ b/cc/experimental/pqcrypto/cecpq2/subtle/cecpq2_hkdf_sender_kem_boringssl_test.cc
@@ -45,7 +45,7 @@ namespace {
// This test evaluates the creation of a Cecpq2HkdfSenderKemBoringSsl instance
// with an unknown curve type parameter. It should fail with an
-// util::error::UNIMPLEMENTED error.
+// absl::StatusCode::kUnimplemented error.
TEST(Cecpq2HkdfSenderKemBoringSslTest, TestUnknownCurve) {
if (IsFipsModeEnabled()) {
GTEST_SKIP() << "Not supported in FIPS-only mode";
@@ -65,12 +65,13 @@ TEST(Cecpq2HkdfSenderKemBoringSslTest, TestUnknownCurve) {
// The instance creation above should fail with an unimplemented algorithm
// error given the UNKNOWN_CURVE parameter
- EXPECT_EQ(util::error::UNIMPLEMENTED,
- status_or_sender_kem.status().error_code());
+ EXPECT_EQ(absl::StatusCode::kUnimplemented,
+ status_or_sender_kem.status().code());
}
// This test evaluates the case where an unsupported curve (NIST_P256) is
-// specified. This test should fail with an util::error::UNIMPLEMENTED error.
+// specified. This test should fail with an absl::StatusCode::kUnimplemented
+// error.
TEST(Cecpq2HkdfSenderKemBoringSslTest, TestUnsupportedCurve) {
if (IsFipsModeEnabled()) {
GTEST_SKIP() << "Not supported in FIPS-only mode";
@@ -89,8 +90,8 @@ TEST(Cecpq2HkdfSenderKemBoringSslTest, TestUnsupportedCurve) {
cecpq2_key_pair.hrss_key_pair.hrss_public_key_marshaled);
// This test should fail with an unimplemented algorithm error
- EXPECT_EQ(util::error::UNIMPLEMENTED,
- status_or_sender_kem.status().error_code());
+ EXPECT_EQ(absl::StatusCode::kUnimplemented,
+ status_or_sender_kem.status().code());
}
// This test checks that an error is triggered if an output key lenth smaller