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

Unified Diff: net/quic/crypto/aead_base_encrypter_openssl.cc

Issue 401153002: Switch to BoringSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase across DEPS change Created 6 years, 5 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/crypto/aead_base_decrypter_openssl.cc ('k') | net/socket/openssl_ssl_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aead_base_encrypter_openssl.cc
diff --git a/net/quic/crypto/aead_base_encrypter_openssl.cc b/net/quic/crypto/aead_base_encrypter_openssl.cc
index 9f053abf93286df6b15a5ba72ddb3561cb7ee8a6..7f2d3c6ca1d62b48241f942df361daf873ba259e 100644
--- a/net/quic/crypto/aead_base_encrypter_openssl.cc
+++ b/net/quic/crypto/aead_base_encrypter_openssl.cc
@@ -81,14 +81,18 @@ bool AeadBaseEncrypter::Encrypt(StringPiece nonce,
return false;
}
- 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) {
+ 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())) {
DLogOpenSslErrors();
return false;
}
« no previous file with comments | « net/quic/crypto/aead_base_decrypter_openssl.cc ('k') | net/socket/openssl_ssl_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698