diff options
author | ignatloskutov <ignatloskutov@yandex-team.com> | 2023-10-09 21:24:57 +0300 |
---|---|---|
committer | ignatloskutov <ignatloskutov@yandex-team.com> | 2023-10-09 21:47:29 +0300 |
commit | 86d29f435594b2c441b57ec66a75532b31644bb6 (patch) | |
tree | c870b7e4fbbfff7e665565abcf0304d3286a8648 | |
parent | dc78770b6fd26a1c33de2f1ecd1c503936ddc5f1 (diff) | |
download | ydb-86d29f435594b2c441b57ec66a75532b31644bb6.tar.gz |
S3 client: fix providing local date instead of UTC
-rw-r--r-- | yt/yt/core/crypto/crypto.cpp | 7 | ||||
-rw-r--r-- | yt/yt/core/crypto/crypto.h | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/yt/yt/core/crypto/crypto.cpp b/yt/yt/core/crypto/crypto.cpp index b3f35df114..574bcb10a8 100644 --- a/yt/yt/core/crypto/crypto.cpp +++ b/yt/yt/core/crypto/crypto.cpp @@ -212,7 +212,7 @@ TString GetSha256HexDigestLowerCase(TStringBuf data) using TSha256Hmac = std::array<char, 256 / 8>; -TSha256Hmac CreateSha256HmacImpl(const TString& key, const TString& message) +TSha256Hmac CreateSha256HmacImpl(TStringBuf key, TStringBuf message) { TSha256Hmac hmac; unsigned int opensslIsInsane; @@ -228,13 +228,13 @@ TSha256Hmac CreateSha256HmacImpl(const TString& key, const TString& message) return hmac; } -TString CreateSha256Hmac(const TString& key, const TString& message) +TString CreateSha256Hmac(TStringBuf key, TStringBuf message) { auto hmac = CreateSha256HmacImpl(key, message); return to_lower(HexEncode(hmac.data(), hmac.size())); } -TString CreateSha256HmacRaw(const TString& key, const TString& message) +TString CreateSha256HmacRaw(TStringBuf key, TStringBuf message) { auto hmac = CreateSha256HmacImpl(key, message); return TString(hmac.data(), hmac.size()); @@ -328,4 +328,3 @@ void FromProto(std::optional<NYT::NCrypto::TMD5Hasher>* hasher, const NCrypto::N //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NCrypto - diff --git a/yt/yt/core/crypto/crypto.h b/yt/yt/core/crypto/crypto.h index e5a9217730..df90490ca5 100644 --- a/yt/yt/core/crypto/crypto.h +++ b/yt/yt/core/crypto/crypto.h @@ -93,8 +93,8 @@ TString GetSha256HexDigestLowerCase(TStringBuf data); //////////////////////////////////////////////////////////////////////////////// -TString CreateSha256Hmac(const TString& key, const TString& message); -TString CreateSha256HmacRaw(const TString& key, const TString& message); +TString CreateSha256Hmac(TStringBuf key, TStringBuf message); +TString CreateSha256HmacRaw(TStringBuf key, TStringBuf message); bool ConstantTimeCompare(const TString& trusted, const TString& untrusted); |