diff options
Diffstat (limited to 'net/quic/crypto/aead_base_decrypter_openssl.cc')
-rw-r--r-- | net/quic/crypto/aead_base_decrypter_openssl.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/quic/crypto/aead_base_decrypter_openssl.cc b/net/quic/crypto/aead_base_decrypter_openssl.cc index 2190bf6..fad0fe1 100644 --- a/net/quic/crypto/aead_base_decrypter_openssl.cc +++ b/net/quic/crypto/aead_base_decrypter_openssl.cc @@ -86,21 +86,18 @@ bool AeadBaseDecrypter::Decrypt(StringPiece nonce, return false; } - ssize_t len = EVP_AEAD_CTX_open( - ctx_.get(), output, ciphertext.size(), + if (!EVP_AEAD_CTX_open( + ctx_.get(), output, output_length, 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()); - - if (len < 0) { + associated_data.size())) { // 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; } |