Index: net/quic/core/crypto/crypto_server_test.cc |
diff --git a/net/quic/core/crypto/crypto_server_test.cc b/net/quic/core/crypto/crypto_server_test.cc |
index 941e2fedd0b0c59afc63556f0ff6694561adc7bc..9776deb7462a329357f2f51b7f244cb470f4c3d1 100644 |
--- a/net/quic/core/crypto/crypto_server_test.cc |
+++ b/net/quic/core/crypto/crypto_server_test.cc |
@@ -8,7 +8,6 @@ |
#include <ostream> |
#include <vector> |
-#include "crypto/secure_hash.h" |
#include "net/quic/core/crypto/cert_compressor.h" |
#include "net/quic/core/crypto/common_cert_set.h" |
#include "net/quic/core/crypto/crypto_handshake.h" |
@@ -29,6 +28,7 @@ |
#include "net/quic/test_tools/quic_crypto_server_config_peer.h" |
#include "net/quic/test_tools/quic_test_utils.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "third_party/boringssl/src/include/openssl/sha.h" |
using base::StringPiece; |
using std::string; |
@@ -1085,14 +1085,13 @@ TEST(CryptoServerConfigGenerationTest, SCIDIsHashOfServerConfig) { |
scfg->MarkDirty(); |
const QuicData& serialized(scfg->GetSerialized()); |
- std::unique_ptr<crypto::SecureHash> hash( |
- crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
- hash->Update(serialized.data(), serialized.length()); |
- uint8_t digest[16]; |
- hash->Finish(digest, sizeof(digest)); |
+ uint8_t digest[SHA256_DIGEST_LENGTH]; |
+ SHA256(reinterpret_cast<const uint8_t*>(serialized.data()), |
+ serialized.length(), digest); |
- ASSERT_EQ(scid.size(), sizeof(digest)); |
- EXPECT_EQ(0, memcmp(digest, scid_str.c_str(), sizeof(digest))); |
+ // scid is a SHA-256 hash, truncated to 16 bytes. |
+ ASSERT_EQ(scid.size(), 16u); |
+ EXPECT_EQ(0, memcmp(digest, scid_str.c_str(), scid.size())); |
} |
class CryptoServerTestNoConfig : public CryptoServerTest { |