Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: net/quic/core/quic_crypto_server_stream.cc

Issue 2672403003: Replace crypto::SecureHash with calls to SHA256. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/crypto/quic_crypto_server_config.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_crypto_server_stream.cc
diff --git a/net/quic/core/quic_crypto_server_stream.cc b/net/quic/core/quic_crypto_server_stream.cc
index e08827bdd79972ebb50852cec5a298356dda865b..49894819aa420964a646eefe214d591859864c49 100644
--- a/net/quic/core/quic_crypto_server_stream.cc
+++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -6,7 +6,6 @@
#include <memory>
-#include "crypto/secure_hash.h"
#include "net/quic/core/crypto/crypto_protocol.h"
#include "net/quic/core/crypto/crypto_utils.h"
#include "net/quic/core/crypto/quic_crypto_server_config.h"
@@ -18,6 +17,7 @@
#include "net/quic/core/quic_session.h"
#include "net/quic/platform/api/quic_logging.h"
#include "net/quic/platform/api/quic_text_utils.h"
+#include "third_party/boringssl/src/include/openssl/sha.h"
using base::StringPiece;
using std::string;
@@ -417,11 +417,9 @@ bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID(
}
const string& channel_id(crypto_negotiated_params_->channel_id);
- std::unique_ptr<crypto::SecureHash> hash(
- crypto::SecureHash::Create(crypto::SecureHash::SHA256));
- hash->Update(channel_id.data(), channel_id.size());
- uint8_t digest[32];
- hash->Finish(digest, sizeof(digest));
+ uint8_t digest[SHA256_DIGEST_LENGTH];
+ SHA256(reinterpret_cast<const uint8_t*>(channel_id.data()), channel_id.size(),
+ digest);
QuicTextUtils::Base64Encode(digest, arraysize(digest), output);
return true;
« no previous file with comments | « net/quic/core/crypto/quic_crypto_server_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698