Skip to content

Commit

Permalink
Use |plaintext_len| instead of recalculating it.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Feb 16, 2016
1 parent b713290 commit 80400f5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/cipher/e_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ int evp_aead_aes_gcm_open(const void *ctx_buf, uint8_t *out, size_t *out_len,
}

if (gcm_ctx->ctr) {
if (!CRYPTO_gcm128_decrypt_ctr32(&gcm, key, in, out,
in_len - EVP_AEAD_AES_GCM_TAG_LEN,
if (!CRYPTO_gcm128_decrypt_ctr32(&gcm, key, in, out, plaintext_len,
gcm_ctx->ctr)) {
return 0;
}
Expand Down

0 comments on commit 80400f5

Please sign in to comment.