Skip to content

Commit

Permalink
Pipeline output/input buf arrays must live until the EVP_Cipher is ca…
Browse files Browse the repository at this point in the history
…lled

The pipeline input/output buf arrays must remain accessible to the
EVP_CIPHER_CTX until EVP_Cipher is subsequently called. This fixes an
asan error discovered by the newly added pipeline test.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #20208)

(cherry picked from commit df9c7ce)
  • Loading branch information
mattcaswell authored and paulidale committed Feb 23, 2023
1 parent 1f82f09 commit 0cc27fe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ssl/record/ssl3_record.c
Expand Up @@ -964,6 +964,7 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int sending,
EVP_CIPHER_CTX *ds;
size_t reclen[SSL_MAX_PIPELINES];
unsigned char buf[SSL_MAX_PIPELINES][EVP_AEAD_TLS1_AAD_LEN];
unsigned char *data[SSL_MAX_PIPELINES];
int i, pad = 0, tmpr;
size_t bs, ctr, padnum, loop;
unsigned char padval;
Expand Down Expand Up @@ -1123,8 +1124,6 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int sending,
}
}
if (n_recs > 1) {
unsigned char *data[SSL_MAX_PIPELINES];

/* Set the output buffers */
for (ctr = 0; ctr < n_recs; ctr++) {
data[ctr] = recs[ctr].data;
Expand Down

0 comments on commit 0cc27fe

Please sign in to comment.