diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 20:07:06 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 20:07:06 +0000 |
commit | 2fcd215fc3158d44935845ee86e98346848cab8b (patch) | |
tree | fbf1938a15bc6a027e1912ce9da7d1537f906ef5 /net/quic | |
parent | 5657db4b4384ac2cd77c21a68afda29537811f16 (diff) | |
download | chromium_src-2fcd215fc3158d44935845ee86e98346848cab8b.zip chromium_src-2fcd215fc3158d44935845ee86e98346848cab8b.tar.gz chromium_src-2fcd215fc3158d44935845ee86e98346848cab8b.tar.bz2 |
Revert 283813 "Switch to BoringSSL."
Failed WebRtcBrowserTest on android_dbg_triggered_tests.
> Switch to BoringSSL.
>
> (This is a reland of r283542 which was reverted in r283591 because it
> broke the WebView build. The android_aosp trybots are broken[1] so this
> based on hope.)
>
> This is a much larger change than its diff suggests. If it breaks
> something, please revert first and ask questions later.
>
> [1] http://code.google.com/p/chromium/issues/detail?id=394597
>
> BUG=none
>
> Review URL: https://codereview.chromium.org/399993002
TBR=agl@chromium.org
Review URL: https://codereview.chromium.org/405503002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283845 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic')
-rw-r--r-- | net/quic/crypto/aead_base_decrypter_openssl.cc | 9 | ||||
-rw-r--r-- | net/quic/crypto/aead_base_encrypter_openssl.cc | 20 |
2 files changed, 14 insertions, 15 deletions
diff --git a/net/quic/crypto/aead_base_decrypter_openssl.cc b/net/quic/crypto/aead_base_decrypter_openssl.cc index fad0fe1..2190bf6 100644 --- a/net/quic/crypto/aead_base_decrypter_openssl.cc +++ b/net/quic/crypto/aead_base_decrypter_openssl.cc @@ -86,18 +86,21 @@ bool AeadBaseDecrypter::Decrypt(StringPiece nonce, return false; } - if (!EVP_AEAD_CTX_open( - ctx_.get(), output, output_length, ciphertext.size(), + ssize_t len = EVP_AEAD_CTX_open( + ctx_.get(), output, ciphertext.size(), reinterpret_cast<const uint8_t*>(nonce.data()), nonce.size(), reinterpret_cast<const uint8_t*>(ciphertext.data()), ciphertext.size(), reinterpret_cast<const uint8_t*>(associated_data.data()), - associated_data.size())) { + associated_data.size()); + + if (len < 0) { // Because QuicFramer does trial decryption, decryption errors are expected // when encryption level changes. So we don't log decryption errors. ClearOpenSslErrors(); return false; } + *output_length = len; return true; } diff --git a/net/quic/crypto/aead_base_encrypter_openssl.cc b/net/quic/crypto/aead_base_encrypter_openssl.cc index 7f2d3c6..9f053ab 100644 --- a/net/quic/crypto/aead_base_encrypter_openssl.cc +++ b/net/quic/crypto/aead_base_encrypter_openssl.cc @@ -81,18 +81,14 @@ bool AeadBaseEncrypter::Encrypt(StringPiece nonce, return false; } - size_t len; - if (!EVP_AEAD_CTX_seal( - ctx_.get(), - output, - &len, - plaintext.size() + auth_tag_size_, - reinterpret_cast<const uint8_t*>(nonce.data()), - nonce.size(), - reinterpret_cast<const uint8_t*>(plaintext.data()), - plaintext.size(), - reinterpret_cast<const uint8_t*>(associated_data.data()), - associated_data.size())) { + ssize_t len = EVP_AEAD_CTX_seal( + ctx_.get(), output, plaintext.size() + auth_tag_size_, + reinterpret_cast<const uint8_t*>(nonce.data()), nonce.size(), + reinterpret_cast<const uint8_t*>(plaintext.data()), plaintext.size(), + reinterpret_cast<const uint8_t*>(associated_data.data()), + associated_data.size()); + + if (len < 0) { DLogOpenSslErrors(); return false; } |