X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fs3_enc.c;h=e963efd47ff2650f9a215a2a87b75fe9fc993ea8;hp=33a6d5264c71a2a3c4f80463ffb8e677ae23e52a;hb=6cb19b7681f600b2f165e4adc57547b097b475fd;hpb=e130841bccfc0bb9da254dc84e23bc6a1c78a64e diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index 33a6d5264c..e963efd47f 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -466,6 +466,15 @@ void ssl3_cleanup_key_block(SSL *s) s->s3->tmp.key_block_length=0; } +/* ssl3_enc encrypts/decrypts the record in |s->wrec| / |s->rrec|, respectively. + * + * Returns: + * 0: (in non-constant time) if the record is publically invalid (i.e. too + * short etc). + * 1: if the record's padding is valid / the encryption was successful. + * -1: if the record's padding is invalid or, if sending, an internal error + * occured. + */ int ssl3_enc(SSL *s, int send) { SSL3_RECORD *rec; @@ -532,8 +541,6 @@ int ssl3_enc(SSL *s, int send) EVP_Cipher(ds,rec->data,rec->input,l); - rec->orig_len = rec->length; - if (EVP_MD_CTX_md(s->read_hash) != NULL) mac_size = EVP_MD_CTX_size(s->read_hash); if ((bs != 1) && !send)