From 8007e15d86ea4c2cc27b66d43df9ff55e9b8a881 Mon Sep 17 00:00:00 2001 From: Crisrael Lucero Date: Fri, 14 Jul 2023 11:12:40 -0700 Subject: [PATCH] Use absl::variant in ConnectionAuthenticator PiperOrigin-RevId: 548173211 --- presence/implementation/connection_authenticator.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/presence/implementation/connection_authenticator.cc b/presence/implementation/connection_authenticator.cc index 3f1e0a7c..44781602 100644 --- a/presence/implementation/connection_authenticator.cc +++ b/presence/implementation/connection_authenticator.cc @@ -16,13 +16,13 @@ #include #include -#include #include #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" +#include "absl/types/variant.h" #include "internal/crypto/ed25519.h" #include "internal/crypto/hkdf.h" #include "internal/crypto/secure_util.h" @@ -125,10 +125,10 @@ ConnectionAuthenticator::VerifyMessageAsResponder( const std::vector& shared_credentials) const { std::string shared_credential_hash; std::optional matched_local_credential; - if (std::holds_alternative(initiator_data)) { + if (absl::holds_alternative(initiator_data)) { // one-way. we only need to verify if the hash matches one of our // local credentials. - auto auth_data = std::get(initiator_data); + auto auth_data = absl::get(initiator_data); if (auth_data.shared_credential_hash.size() != kPresenceAuthenticatorHkdfKeySize) { return absl::InvalidArgumentError("Invalid shared credential hash size."); @@ -150,7 +150,7 @@ ConnectionAuthenticator::VerifyMessageAsResponder( // We want to check each shared credential to verify using its public key. // Match the local credential. - auto auth_data = std::get(initiator_data); + auto auth_data = absl::get(initiator_data); if (auth_data.shared_credential_hash.size() != kPresenceAuthenticatorHkdfKeySize) { return absl::InvalidArgumentError("Invalid shared credential hash size.");