aboutsummaryrefslogtreecommitdiff
path: root/cc/primitive_set.h
diff options
context:
space:
mode:
authorlizatretyakova <lizatretyakova@google.com>2021-11-03 07:49:59 -0700
committerCopybara-Service <copybara-worker@google.com>2021-11-03 07:50:50 -0700
commita6dbd7e7950016f376f4b0b2016f3b644c0e9916 (patch)
tree7dceb281552cd050a61217c0c8f78b144b1b61f6 /cc/primitive_set.h
parentff026423b0da6bc390f614a4c64c4b1fa52266f2 (diff)
downloadtink-a6dbd7e7950016f376f4b0b2016f3b644c0e9916.tar.gz
Replace the deprecated crypto::tink::util::error::INVALID_ARGUMENT usages with its absl version absl::StatusCode::kInvalidArgument in tink/cc/{,core}.
This CL is a part of Tink migration to using absl::Status{,Or} and absl::StatusCode. PiperOrigin-RevId: 407335339
Diffstat (limited to 'cc/primitive_set.h')
-rw-r--r--cc/primitive_set.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/cc/primitive_set.h b/cc/primitive_set.h
index 8ea306d8d..f88c97451 100644
--- a/cc/primitive_set.h
+++ b/cc/primitive_set.h
@@ -60,13 +60,13 @@ class PrimitiveSet {
std::unique_ptr<P> primitive,
const google::crypto::tink::KeysetInfo::KeyInfo& key_info) {
if (key_info.status() != google::crypto::tink::KeyStatusType::ENABLED) {
- return util::Status(crypto::tink::util::error::INVALID_ARGUMENT,
+ return util::Status(absl::StatusCode::kInvalidArgument,
"The key must be ENABLED.");
}
auto identifier_result = CryptoFormat::GetOutputPrefix(key_info);
if (!identifier_result.ok()) return identifier_result.status();
if (primitive == nullptr) {
- return util::Status(crypto::tink::util::error::INVALID_ARGUMENT,
+ return util::Status(absl::StatusCode::kInvalidArgument,
"The primitive must be non-null.");
}
std::string identifier = identifier_result.ValueOrDie();
@@ -143,16 +143,16 @@ class PrimitiveSet {
// Sets the given 'primary' as the primary primitive of this set.
crypto::tink::util::Status set_primary(Entry<P>* primary) {
if (!primary) {
- return util::Status(crypto::tink::util::error::INVALID_ARGUMENT,
+ return util::Status(absl::StatusCode::kInvalidArgument,
"The primary primitive must be non-null.");
}
if (primary->get_status() != google::crypto::tink::KeyStatusType::ENABLED) {
- return util::Status(crypto::tink::util::error::INVALID_ARGUMENT,
+ return util::Status(absl::StatusCode::kInvalidArgument,
"Primary has to be enabled.");
}
auto entries_result = get_primitives(primary->get_identifier());
if (!entries_result.ok()) {
- return util::Status(crypto::tink::util::error::INVALID_ARGUMENT,
+ return util::Status(absl::StatusCode::kInvalidArgument,
"Primary cannot be set to an entry which is "
"not held by this primitive set.");
}