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

Unified Diff: net/quic/test_tools/crypto_test_utils_openssl.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/quic_utils_test.cc ('k') | net/socket/next_proto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/crypto_test_utils_openssl.cc
diff --git a/net/quic/test_tools/crypto_test_utils_openssl.cc b/net/quic/test_tools/crypto_test_utils_openssl.cc
index 39b48a5b8e32ea589e06ba26ca77ce4ae575741c..5bcbccb58fb07c91907a30a9d6c5b327e2ddd49d 100644
--- a/net/quic/test_tools/crypto_test_utils_openssl.cc
+++ b/net/quic/test_tools/crypto_test_utils_openssl.cc
@@ -64,9 +64,10 @@ class TestChannelIDKey : public ChannelIDKey {
// The signature consists of a pair of 32-byte numbers.
static const size_t kSignatureLength = 32 * 2;
scoped_ptr<uint8[]> signature(new uint8[kSignatureLength]);
- memset(signature.get(), 0, kSignatureLength);
- BN_bn2bin(sig.get()->r, signature.get() + 32 - BN_num_bytes(sig.get()->r));
- BN_bn2bin(sig.get()->s, signature.get() + 64 - BN_num_bytes(sig.get()->s));
+ if (!BN_bn2bin_padded(&signature[0], 32, sig->r) ||
+ !BN_bn2bin_padded(&signature[32], 32, sig->s)) {
+ return false;
+ }
*out_signature = string(reinterpret_cast<char*>(signature.get()),
kSignatureLength);
« no previous file with comments | « net/quic/quic_utils_test.cc ('k') | net/socket/next_proto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698