diff options
author | ioannanedelcu <ioannanedelcu@google.com> | 2023-05-31 14:52:59 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-05-31 14:53:58 -0700 |
commit | 8b9be40f3c6d2ff5c220a33afcb997f39ef90b91 (patch) | |
tree | 6ba9e7d9a00312556395e217954266e4943555aa /cc/mac/mac_config_test.cc | |
parent | 4b641ad520a5b6ab64913b6bb0617f85faf9eef8 (diff) | |
download | tink-8b9be40f3c6d2ff5c220a33afcb997f39ef90b91.tar.gz |
Make the SecretKeyAccessToken optional for the key parsers and serializers.
PiperOrigin-RevId: 536830719
Diffstat (limited to 'cc/mac/mac_config_test.cc')
-rw-r--r-- | cc/mac/mac_config_test.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cc/mac/mac_config_test.cc b/cc/mac/mac_config_test.cc index 44009c075..7243a9ac9 100644 --- a/cc/mac/mac_config_test.cc +++ b/cc/mac/mac_config_test.cc @@ -24,6 +24,7 @@ #include "gtest/gtest.h" #include "absl/status/status.h" #include "tink/chunked_mac.h" +#include "tink/insecure_secret_key_access.h" #include "tink/internal/fips_utils.h" #include "tink/internal/mutable_serialization_registry.h" #include "tink/internal/proto_key_serialization.h" @@ -196,7 +197,7 @@ TEST_F(MacConfigTest, AesCmacProtoKeySerializationRegistered) { util::StatusOr<std::unique_ptr<Key>> parsed_key = internal::MutableSerializationRegistry::GlobalInstance().ParseKey( - *proto_key_serialization); + *proto_key_serialization, InsecureSecretKeyAccess::Get()); ASSERT_THAT(parsed_key.status(), StatusIs(absl::StatusCode::kNotFound)); util::StatusOr<AesCmacParameters> params = AesCmacParameters::Create( @@ -213,19 +214,21 @@ TEST_F(MacConfigTest, AesCmacProtoKeySerializationRegistered) { util::StatusOr<std::unique_ptr<Serialization>> serialized_key = internal::MutableSerializationRegistry::GlobalInstance() - .SerializeKey<internal::ProtoKeySerialization>(*key); + .SerializeKey<internal::ProtoKeySerialization>( + *key, InsecureSecretKeyAccess::Get()); ASSERT_THAT(serialized_key.status(), StatusIs(absl::StatusCode::kNotFound)); ASSERT_THAT(MacConfig::Register(), IsOk()); util::StatusOr<std::unique_ptr<Key>> parsed_key2 = internal::MutableSerializationRegistry::GlobalInstance().ParseKey( - *proto_key_serialization); + *proto_key_serialization, InsecureSecretKeyAccess::Get()); ASSERT_THAT(parsed_key2, IsOk()); util::StatusOr<std::unique_ptr<Serialization>> serialized_key2 = internal::MutableSerializationRegistry::GlobalInstance() - .SerializeKey<internal::ProtoKeySerialization>(*key); + .SerializeKey<internal::ProtoKeySerialization>( + *key, InsecureSecretKeyAccess::Get()); ASSERT_THAT(serialized_key2, IsOk()); } |