e_aes.c: fix bug in aesni_gcm_tls_cipher.
authorAndy Polyakov <appro@openssl.org>
Fri, 14 Oct 2011 09:32:06 +0000 (09:32 +0000)
committerAndy Polyakov <appro@openssl.org>
Fri, 14 Oct 2011 09:32:06 +0000 (09:32 +0000)
crypto/evp/e_aes.c

index 558f1a197f3f11067bca677e9021c4867c76e4d4..4b94b2a8404394bf6cb434d03a0c873d3d5edf14 100644 (file)
@@ -369,6 +369,7 @@ static int aesni_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                /* Encrypt payload */
                if (CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, in, out, len,
                                                aesni_ctr32_encrypt_blocks))
                /* Encrypt payload */
                if (CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, in, out, len,
                                                aesni_ctr32_encrypt_blocks))
+                       goto err;
                out += len;
                /* Finally write tag */
                CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);
                out += len;
                /* Finally write tag */
                CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);