}
}
-int SSL3_RECORD_setup(SSL3_RECORD *r, unsigned int num_recs)
-{
- unsigned int i;
-
- for (i = 0; i < num_recs; i++) {
- if (r[i].comp == NULL)
- r[i].comp = (unsigned char *)
- OPENSSL_malloc(SSL3_RT_MAX_ENCRYPTED_LENGTH);
- if (r[i].comp == NULL) {
- if (i > 0)
- SSL3_RECORD_release(r, i);
- return 0;
- }
- }
-
- return 1;
-}
-
void SSL3_RECORD_set_seq_num(SSL3_RECORD *r, const unsigned char *seq_num)
{
memcpy(r->seq_num, seq_num, SEQ_NUM_SIZE);
* Peeks ahead into "read_ahead" data to see if we have a whole record waiting
* for us in the buffer.
*/
-static int have_whole_app_data_record_waiting(SSL *s)
+static int ssl3_record_app_data_waiting(SSL *s)
{
SSL3_BUFFER *rbuf;
int left, len;
&& s->enc_read_ctx != NULL
&& (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(s->enc_read_ctx))
& EVP_CIPH_FLAG_PIPELINE)
- && have_whole_app_data_record_waiting(s));
+ && ssl3_record_app_data_waiting(s));
/*
#ifndef OPENSSL_NO_COMP
int i;
+ if (rr->comp == NULL) {
+ rr->comp = (unsigned char *)
+ OPENSSL_malloc(SSL3_RT_MAX_ENCRYPTED_LENGTH);
+ }
+ if (rr->comp == NULL)
+ return 0;
+
i = COMP_expand_block(ssl->expand, rr->comp,
SSL3_RT_MAX_PLAIN_LENGTH, rr->data,
(int)rr->length);
if (i < 0)
- return (0);
+ return 0;
else
rr->length = i;
rr->data = rr->comp;
#endif
- return (1);
+ return 1;
}
int ssl3_do_compress(SSL *ssl, SSL3_RECORD *wr)
}
/*-
- * ssl3_enc encrypts/decrypts the record in |s->wrec| / |s->rrec|, respectively.
+ * ssl3_enc encrypts/decrypts |numpipes| records in |inrecs|
*
* Returns:
* 0: (in non-constant time) if the record is publically invalid (i.e. too
}
/*-
- * tls1_enc encrypts/decrypts the record in |s->wrec| / |s->rrec|, respectively.
+ * tls1_enc encrypts/decrypts |numpipes| in |recs|.
*
* Returns:
* 0: (in non-constant time) if the record is publically invalid (i.e. too