Commit c036e210 authored by Matt Caswell's avatar Matt Caswell
Browse files

Remove RECORD_LAYER_set_ssl and introduce RECORD_LAYER_init

parent bbcd6d7f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,6 @@ typedef struct record_layer_st {
 *                                                                           *
 *****************************************************************************/

#define RECORD_LAYER_set_ssl(rl, s)             ((rl)->s = (s))
#define RECORD_LAYER_set_read_ahead(rl, ra)     ((rl)->read_ahead = (ra))
#define RECORD_LAYER_get_read_ahead(rl)         ((rl)->read_ahead)
#define RECORD_LAYER_get_rbuf(rl)               (&(rl)->rbuf)
@@ -166,6 +165,7 @@ typedef struct record_layer_st {
#define RECORD_LAYER_get_rrec(rl)               (&(rl)->rrec)
#define RECORD_LAYER_get_wrec(rl)               (&(rl)->wrec)

void RECORD_LAYER_init(RECORD_LAYER *rl, SSL *s);
void RECORD_LAYER_clear(RECORD_LAYER *rl);
void RECORD_LAYER_release(RECORD_LAYER *rl);
int RECORD_LAYER_read_pending(RECORD_LAYER *rl);
+7 −0
Original line number Diff line number Diff line
@@ -132,6 +132,13 @@
# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0
#endif

void RECORD_LAYER_init(RECORD_LAYER *rl, SSL *s)
{
    rl->s = s;
    SSL3_RECORD_clear(&rl->rrec);
    SSL3_RECORD_clear(&rl->wrec);
}

void RECORD_LAYER_clear(RECORD_LAYER *rl)
{
    unsigned char *rp, *wp;
+1 −3
Original line number Diff line number Diff line
@@ -282,9 +282,7 @@ SSL *SSL_new(SSL_CTX *ctx)
        goto err;
    memset(s, 0, sizeof(SSL));

    RECORD_LAYER_set_ssl(&s->rlayer, s);
    SSL3_RECORD_clear(RECORD_LAYER_get_rrec(&s->rlayer));
    SSL3_RECORD_clear(RECORD_LAYER_get_wrec(&s->rlayer));
    RECORD_LAYER_init(&s->rlayer, s);

#ifndef OPENSSL_NO_KRB5
    s->kssl_ctx = kssl_ctx_new();