aboutsummaryrefslogtreecommitdiff
path: root/cc/config
diff options
context:
space:
mode:
authorpaulavidas <paulavidas@google.com>2019-08-14 02:52:15 -0700
committerCopybara-Service <copybara-worker@google.com>2019-08-14 02:52:49 -0700
commitfff26152ad5369d9759c6d0086820bd9a77d66a3 (patch)
treeb4803ef2228de9a285f28808e8fec78fb567aa7c /cc/config
parent7097f40773d6c445b4301bfb013667b285ee98a8 (diff)
downloadtink-fff26152ad5369d9759c6d0086820bd9a77d66a3.tar.gz
Deprecate TinkConfig::Latest().
PiperOrigin-RevId: 263313121
Diffstat (limited to 'cc/config')
-rw-r--r--cc/config/BUILD.bazel1
-rw-r--r--cc/config/CMakeLists.txt1
-rw-r--r--cc/config/tink_config.cc22
-rw-r--r--cc/config/tink_config.h2
4 files changed, 9 insertions, 17 deletions
diff --git a/cc/config/BUILD.bazel b/cc/config/BUILD.bazel
index cbc15b27e..7741188d8 100644
--- a/cc/config/BUILD.bazel
+++ b/cc/config/BUILD.bazel
@@ -18,6 +18,7 @@ cc_library(
"//cc/streamingaead:streaming_aead_config",
"//cc/util:status",
"//proto:config_cc_proto",
+ "@com_google_absl//absl/base:core_headers",
],
)
diff --git a/cc/config/CMakeLists.txt b/cc/config/CMakeLists.txt
index c65206e1c..7e7c41334 100644
--- a/cc/config/CMakeLists.txt
+++ b/cc/config/CMakeLists.txt
@@ -14,6 +14,7 @@ tink_cc_library(
tink::streamingaead::streaming_aead_config
tink::util::status
tink::proto::config_cc_proto
+ absl::base
)
tink_cc_library(
diff --git a/cc/config/tink_config.cc b/cc/config/tink_config.cc
index 3969e3dc3..f360e4b5e 100644
--- a/cc/config/tink_config.cc
+++ b/cc/config/tink_config.cc
@@ -24,28 +24,16 @@
#include "tink/signature/signature_config.h"
#include "tink/streamingaead/streaming_aead_config.h"
#include "tink/util/status.h"
+#include "proto/config.pb.h"
+
+using google::crypto::tink::RegistryConfig;
namespace crypto {
namespace tink {
-namespace {
-
-google::crypto::tink::RegistryConfig* GenerateRegistryConfig() {
- google::crypto::tink::RegistryConfig* config =
- new google::crypto::tink::RegistryConfig();
- config->MergeFrom(HybridConfig::Latest()); // includes Mac & Aead
- config->MergeFrom(SignatureConfig::Latest());
- config->MergeFrom(DeterministicAeadConfig::Latest());
- config->MergeFrom(StreamingAeadConfig::Latest());
- config->set_config_name("TINK");
- return config;
-}
-
-} // anonymous namespace
-
// static
-const google::crypto::tink::RegistryConfig& TinkConfig::Latest() {
- static auto config = GenerateRegistryConfig();
+const RegistryConfig& TinkConfig::Latest() {
+ static const RegistryConfig* config = new RegistryConfig();
return *config;
}
diff --git a/cc/config/tink_config.h b/cc/config/tink_config.h
index cf523cbbe..98f0dd4cb 100644
--- a/cc/config/tink_config.h
+++ b/cc/config/tink_config.h
@@ -17,6 +17,7 @@
#ifndef TINK_CONFIG_TINK_CONFIG_H_
#define TINK_CONFIG_TINK_CONFIG_H_
+#include "absl/base/macros.h"
#include "tink/util/status.h"
#include "proto/config.pb.h"
@@ -35,6 +36,7 @@ class TinkConfig {
public:
// Returns config of implementations of all primitives supported
// in the current Tink release.
+ ABSL_DEPRECATED("This is not supported anymore.")
static const google::crypto::tink::RegistryConfig& Latest();
// Registers all primitive wrappers and all key managers for all primitives