#define RECORD_LAYER_get_wbuf(rl) (&(rl)->wbuf)
#define RECORD_LAYER_get_rrec(rl) (&(rl)->rrec)
#define RECORD_LAYER_get_wrec(rl) (&(rl)->wrec)
+#define RECORD_LAYER_setup_comp_buffer(rl) (SSL3_RECORD_setup(&(rl)->rrec))
void RECORD_LAYER_init(RECORD_LAYER *rl, SSL *s);
void RECORD_LAYER_clear(RECORD_LAYER *rl);
r->comp = NULL;
}
-int SSL3_RECORD_setup(SSL3_RECORD *r, size_t len)
+int SSL3_RECORD_setup(SSL3_RECORD *r)
{
if (r->comp == NULL)
- r->comp = (unsigned char *) OPENSSL_malloc(len);
+ r->comp = (unsigned char *)
+ OPENSSL_malloc(SSL3_RT_MAX_ENCRYPTED_LENGTH);
if (r->comp == NULL)
return 0;
return 1;
void SSL3_RECORD_clear(SSL3_RECORD *r);
void SSL3_RECORD_release(SSL3_RECORD *r);
-int SSL3_RECORD_setup(SSL3_RECORD *r, size_t len);
+int SSL3_RECORD_setup(SSL3_RECORD *r);
void SSL3_RECORD_set_seq_num(SSL3_RECORD *r, const unsigned char *seq_num);
int ssl3_get_record(SSL *s);
__owur int ssl3_do_compress(SSL *ssl);
SSL_R_COMPRESSION_LIBRARY_ERROR);
goto err2;
}
- if(!SSL3_RECORD_setup(RECORD_LAYER_get_rrec(&s->rlayer),
- SSL3_RT_MAX_PLAIN_LENGTH))
+ if(!RECORD_LAYER_setup_comp_buffer(&s->rlayer))
goto err;
}
#endif
SSL_R_COMPRESSION_LIBRARY_ERROR);
goto err2;
}
- if (SSL3_RECORD_setup(RECORD_LAYER_get_rrec(&s->rlayer),
- SSL3_RT_MAX_ENCRYPTED_LENGTH))
+ if (!RECORD_LAYER_setup_comp_buffer(&s->rlayer))
goto err;
}
#endif