From d7e0aa4b59fc46f038370bf8dc64821eb4a7d804 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 24 Oct 2018 18:04:50 +0000 Subject: Make more of libssl's record layer state internal. In January 2017, we changed large amounts of libssl's data structures to be non-visible/internal, however intentionally left things that the software ecosystem was needing to use. The four or so applications that reached into libssl for record layer related state now implement alternative code. As such, make these data structures internal. ok tb@ --- src/lib/libssl/d1_pkt.c | 36 +++++++++++++++++----------------- src/lib/libssl/s3_lib.c | 28 +++++++++++++------------- src/lib/libssl/ssl3.h | 14 +------------ src/lib/libssl/ssl_both.c | 24 +++++++++++------------ src/lib/libssl/ssl_locl.h | 12 +++++++++++- src/lib/libssl/ssl_packet.c | 6 +++--- src/lib/libssl/ssl_pkt.c | 48 ++++++++++++++++++++++----------------------- src/lib/libssl/t1_enc.c | 6 +++--- 8 files changed, 86 insertions(+), 88 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index b3104d21e7..825c1838a1 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_pkt.c,v 1.64 2018/08/24 19:35:05 jsing Exp $ */ +/* $OpenBSD: d1_pkt.c,v 1.65 2018/10/24 18:04:50 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -200,11 +200,11 @@ dtls1_copy_record(SSL *s, pitem *item) rdata = (DTLS1_RECORD_DATA *)item->data; - free(s->s3->rbuf.buf); + free(S3I(s)->rbuf.buf); s->internal->packet = rdata->packet; s->internal->packet_length = rdata->packet_length; - memcpy(&(s->s3->rbuf), &(rdata->rbuf), sizeof(SSL3_BUFFER)); + memcpy(&(S3I(s)->rbuf), &(rdata->rbuf), sizeof(SSL3_BUFFER)); memcpy(&(S3I(s)->rrec), &(rdata->rrec), sizeof(SSL3_RECORD)); /* Set proper sequence number for mac calculation */ @@ -231,7 +231,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) rdata->packet = s->internal->packet; rdata->packet_length = s->internal->packet_length; - memcpy(&(rdata->rbuf), &(s->s3->rbuf), sizeof(SSL3_BUFFER)); + memcpy(&(rdata->rbuf), &(S3I(s)->rbuf), sizeof(SSL3_BUFFER)); memcpy(&(rdata->rrec), &(S3I(s)->rrec), sizeof(SSL3_RECORD)); item->data = rdata; @@ -239,7 +239,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) s->internal->packet = NULL; s->internal->packet_length = 0; - memset(&(s->s3->rbuf), 0, sizeof(SSL3_BUFFER)); + memset(&(S3I(s)->rbuf), 0, sizeof(SSL3_BUFFER)); memset(&(S3I(s)->rrec), 0, sizeof(SSL3_RECORD)); if (!ssl3_setup_buffers(s)) @@ -643,7 +643,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) SSL3_RECORD *rr; void (*cb)(const SSL *ssl, int type2, int val) = NULL; - if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ + if (S3I(s)->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_buffers(s)) return (-1); @@ -880,7 +880,7 @@ start: } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) /* no read-ahead left? */ + if (S3I(s)->rbuf.left == 0) /* no read-ahead left? */ { BIO *bio; /* In the case where we try to read application data, @@ -1035,7 +1035,7 @@ start: } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) /* no read-ahead left? */ + if (S3I(s)->rbuf.left == 0) /* no read-ahead left? */ { BIO *bio; /* In the case where we try to read application data, @@ -1188,13 +1188,13 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len) /* first check if there is a SSL3_BUFFER still being written * out. This will happen with non blocking IO */ - if (s->s3->wbuf.left != 0) { + if (S3I(s)->wbuf.left != 0) { OPENSSL_assert(0); /* XDTLS: want to see if we ever get here */ return (ssl3_write_pending(s, type, buf, len)); } /* If we have an alert to send, lets send it */ - if (s->s3->alert_dispatch) { + if (S3I(s)->alert_dispatch) { i = s->method->ssl_dispatch_alert(s); if (i <= 0) return (i); @@ -1205,7 +1205,7 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len) return 0; wr = &(S3I(s)->wrec); - wb = &(s->s3->wbuf); + wb = &(S3I(s)->wbuf); sess = s->session; if ((sess == NULL) || (s->internal->enc_write_ctx == NULL) || @@ -1382,23 +1382,23 @@ dtls1_dispatch_alert(SSL *s) unsigned char buf[DTLS1_AL_HEADER_LENGTH]; unsigned char *ptr = &buf[0]; - s->s3->alert_dispatch = 0; + S3I(s)->alert_dispatch = 0; memset(buf, 0x00, sizeof(buf)); - *ptr++ = s->s3->send_alert[0]; - *ptr++ = s->s3->send_alert[1]; + *ptr++ = S3I(s)->send_alert[0]; + *ptr++ = S3I(s)->send_alert[1]; i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf)); if (i <= 0) { - s->s3->alert_dispatch = 1; + S3I(s)->alert_dispatch = 1; /* fprintf( stderr, "not done with alert\n" ); */ } else { - if (s->s3->send_alert[0] == SSL3_AL_FATAL) + if (S3I(s)->send_alert[0] == SSL3_AL_FATAL) (void)BIO_flush(s->wbio); if (s->internal->msg_callback) s->internal->msg_callback(1, s->version, SSL3_RT_ALERT, - s->s3->send_alert, 2, s, s->internal->msg_callback_arg); + S3I(s)->send_alert, 2, s, s->internal->msg_callback_arg); if (s->internal->info_callback != NULL) cb = s->internal->info_callback; @@ -1406,7 +1406,7 @@ dtls1_dispatch_alert(SSL *s) cb = s->ctx->internal->info_callback; if (cb != NULL) { - j = (s->s3->send_alert[0]<<8)|s->s3->send_alert[1]; + j = (S3I(s)->send_alert[0]<<8)|S3I(s)->send_alert[1]; cb(s, SSL_CB_WRITE_ALERT, j); } } diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 02e6c66a47..6fcbbfc2c5 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.170 2018/09/06 16:40:45 jsing Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.171 2018/10/24 18:04:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1543,10 +1543,10 @@ ssl3_clear(SSL *s) freezero(S3I(s)->tmp.x25519, X25519_KEY_LENGTH); S3I(s)->tmp.x25519 = NULL; - rp = s->s3->rbuf.buf; - wp = s->s3->wbuf.buf; - rlen = s->s3->rbuf.len; - wlen = s->s3->wbuf.len; + rp = S3I(s)->rbuf.buf; + wp = S3I(s)->wbuf.buf; + rlen = S3I(s)->rbuf.len; + wlen = S3I(s)->wbuf.len; BIO_free(S3I(s)->handshake_buffer); S3I(s)->handshake_buffer = NULL; @@ -1561,10 +1561,10 @@ ssl3_clear(SSL *s) memset(s->s3, 0, sizeof(*s->s3)); S3I(s) = internal; - s->s3->rbuf.buf = rp; - s->s3->wbuf.buf = wp; - s->s3->rbuf.len = rlen; - s->s3->wbuf.len = wlen; + S3I(s)->rbuf.buf = rp; + S3I(s)->wbuf.buf = wp; + S3I(s)->rbuf.len = rlen; + S3I(s)->wbuf.len = wlen; ssl_free_wbio_buffer(s); @@ -2406,11 +2406,11 @@ ssl3_shutdown(SSL *s) ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY); /* * Our shutdown alert has been sent now, and if it still needs - * to be written, s->s3->alert_dispatch will be true + * to be written, S3I(s)->alert_dispatch will be true */ - if (s->s3->alert_dispatch) + if (S3I(s)->alert_dispatch) return(-1); /* return WANT_WRITE */ - } else if (s->s3->alert_dispatch) { + } else if (S3I(s)->alert_dispatch) { /* resend it if not sent */ ret = s->method->ssl_dispatch_alert(s); if (ret == -1) { @@ -2431,7 +2431,7 @@ ssl3_shutdown(SSL *s) } if ((s->internal->shutdown == (SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) && - !s->s3->alert_dispatch) + !S3I(s)->alert_dispatch) return (1); else return (0); @@ -2509,7 +2509,7 @@ ssl3_renegotiate_check(SSL *s) int ret = 0; if (S3I(s)->renegotiate) { - if ((s->s3->rbuf.left == 0) && (s->s3->wbuf.left == 0) && + if ((S3I(s)->rbuf.left == 0) && (S3I(s)->wbuf.left == 0) && !SSL_in_init(s)) { /* * If we are the server, and we have sent diff --git a/src/lib/libssl/ssl3.h b/src/lib/libssl/ssl3.h index f8833fa1bb..726fb9db0b 100644 --- a/src/lib/libssl/ssl3.h +++ b/src/lib/libssl/ssl3.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl3.h,v 1.47 2018/04/07 16:55:13 jsing Exp $ */ +/* $OpenBSD: ssl3.h,v 1.48 2018/10/24 18:04:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -363,18 +363,6 @@ typedef struct ssl3_state_st { unsigned char server_random[SSL3_RANDOM_SIZE]; unsigned char client_random[SSL3_RANDOM_SIZE]; - SSL3_BUFFER rbuf; /* read IO goes into here */ - SSL3_BUFFER wbuf; /* write IO goes into here */ - - /* we allow one fatal and one warning alert to be outstanding, - * send close alert via the warning alert */ - int alert_dispatch; - unsigned char send_alert[2]; - - struct { - int new_mac_secret_size; - } tmp; - struct ssl3_state_internal_st *internal; } SSL3_STATE; diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c index 788505e602..81fd1f80c5 100644 --- a/src/lib/libssl/ssl_both.c +++ b/src/lib/libssl/ssl_both.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_both.c,v 1.12 2018/08/24 17:30:32 jsing Exp $ */ +/* $OpenBSD: ssl_both.c,v 1.13 2018/10/24 18:04:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -700,16 +700,16 @@ ssl3_setup_read_buffer(SSL *s) align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1); - if (s->s3->rbuf.buf == NULL) { + if (S3I(s)->rbuf.buf == NULL) { len = SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align; if ((p = malloc(len)) == NULL) goto err; - s->s3->rbuf.buf = p; - s->s3->rbuf.len = len; + S3I(s)->rbuf.buf = p; + S3I(s)->rbuf.len = len; } - s->internal->packet = &(s->s3->rbuf.buf[0]); + s->internal->packet = &(S3I(s)->rbuf.buf[0]); return 1; err: @@ -730,7 +730,7 @@ ssl3_setup_write_buffer(SSL *s) align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1); - if (s->s3->wbuf.buf == NULL) { + if (S3I(s)->wbuf.buf == NULL) { len = s->max_send_fragment + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + headerlen + align; if (!(s->internal->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) @@ -739,8 +739,8 @@ ssl3_setup_write_buffer(SSL *s) if ((p = malloc(len)) == NULL) goto err; - s->s3->wbuf.buf = p; - s->s3->wbuf.len = len; + S3I(s)->wbuf.buf = p; + S3I(s)->wbuf.len = len; } return 1; @@ -763,15 +763,15 @@ ssl3_setup_buffers(SSL *s) int ssl3_release_write_buffer(SSL *s) { - free(s->s3->wbuf.buf); - s->s3->wbuf.buf = NULL; + free(S3I(s)->wbuf.buf); + S3I(s)->wbuf.buf = NULL; return 1; } int ssl3_release_read_buffer(SSL *s) { - free(s->s3->rbuf.buf); - s->s3->rbuf.buf = NULL; + free(S3I(s)->rbuf.buf); + S3I(s)->rbuf.buf = NULL; return 1; } diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index d022d21568..9a018547ab 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.215 2018/09/08 14:29:52 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.216 2018/10/24 18:04:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -748,6 +748,14 @@ typedef struct ssl3_state_internal_st { int write_mac_secret_size; unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; + SSL3_BUFFER rbuf; /* read IO goes into here */ + SSL3_BUFFER wbuf; /* write IO goes into here */ + + /* we allow one fatal and one warning alert to be outstanding, + * send close alert via the warning alert */ + int alert_dispatch; + unsigned char send_alert[2]; + /* flags for countermeasure against known-IV weakness */ int need_empty_fragments; int empty_fragment_done; @@ -793,6 +801,8 @@ typedef struct ssl3_state_internal_st { SSL_HANDSHAKE hs; struct { + int new_mac_secret_size; + /* actually only needs to be 16+20 */ unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2]; diff --git a/src/lib/libssl/ssl_packet.c b/src/lib/libssl/ssl_packet.c index 5556ffb9f1..ca5afb7d93 100644 --- a/src/lib/libssl/ssl_packet.c +++ b/src/lib/libssl/ssl_packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_packet.c,v 1.6 2017/05/06 16:18:36 jsing Exp $ */ +/* $OpenBSD: ssl_packet.c,v 1.7 2018/10/24 18:04:50 jsing Exp $ */ /* * Copyright (c) 2016, 2017 Joel Sing * @@ -210,10 +210,10 @@ ssl_convert_sslv2_client_hello(SSL *s) if (!CBB_finish(&cbb, &data, &data_len)) goto err; - if (data_len > s->s3->rbuf.len) + if (data_len > S3I(s)->rbuf.len) goto err; - s->internal->packet = s->s3->rbuf.buf; + s->internal->packet = S3I(s)->rbuf.buf; s->internal->packet_length = data_len; memcpy(s->internal->packet, data, data_len); ret = 1; diff --git a/src/lib/libssl/ssl_pkt.c b/src/lib/libssl/ssl_pkt.c index 4e3ac7722a..6e3764d360 100644 --- a/src/lib/libssl/ssl_pkt.c +++ b/src/lib/libssl/ssl_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_pkt.c,v 1.13 2018/09/08 14:39:41 jsing Exp $ */ +/* $OpenBSD: ssl_pkt.c,v 1.14 2018/10/24 18:04:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -141,7 +141,7 @@ ssl_force_want_read(SSL *s) /* * If extend == 0, obtain new n-byte packet; if extend == 1, increase * packet by another n bytes. - * The packet will be in the sub-array of s->s3->rbuf.buf specified + * The packet will be in the sub-array of S3I(s)->rbuf.buf specified * by s->internal->packet and s->internal->packet_length. * (If s->internal->read_ahead is set, 'max' bytes may be stored in rbuf * [plus s->internal->packet_length bytes if extend == 1].) @@ -157,7 +157,7 @@ ssl3_read_n(SSL *s, int n, int max, int extend) if (n <= 0) return n; - rb = &(s->s3->rbuf); + rb = &(S3I(s)->rbuf); if (rb->buf == NULL) if (!ssl3_setup_read_buffer(s)) return -1; @@ -239,7 +239,7 @@ ssl3_read_n(SSL *s, int n, int max, int extend) } while (left < n) { - /* Now we have len+left bytes at the front of s->s3->rbuf.buf + /* Now we have len+left bytes at the front of S3I(s)->rbuf.buf * and need to read in more until we have len+n (up to * len+max if possible) */ @@ -288,7 +288,7 @@ ssl3_packet_read(SSL *s, int plen) { int n; - n = ssl3_read_n(s, plen, s->s3->rbuf.len, 0); + n = ssl3_read_n(s, plen, S3I(s)->rbuf.len, 0); if (n <= 0) return n; if (s->internal->packet_length < plen) @@ -387,7 +387,7 @@ ssl3_get_record(SSL *s) goto err; } - if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH) { + if (rr->length > S3I(s)->rbuf.len - SSL3_RT_HEADER_LENGTH) { al = SSL_AD_RECORD_OVERFLOW; SSLerror(s, SSL_R_PACKET_LENGTH_TOO_LONG); goto f_err; @@ -629,7 +629,7 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, int eivlen; size_t align; SSL3_RECORD *wr; - SSL3_BUFFER *wb = &(s->s3->wbuf); + SSL3_BUFFER *wb = &(S3I(s)->wbuf); SSL_SESSION *sess; if (wb->buf == NULL) @@ -642,7 +642,7 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, return (ssl3_write_pending(s, type, buf, len)); /* If we have an alert to send, lets send it */ - if (s->s3->alert_dispatch) { + if (S3I(s)->alert_dispatch) { i = s->method->ssl_dispatch_alert(s); if (i <= 0) return (i); @@ -818,12 +818,12 @@ err: return -1; } -/* if s->s3->wbuf.left != 0, we need to call this */ +/* if S3I(s)->wbuf.left != 0, we need to call this */ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, unsigned int len) { int i; - SSL3_BUFFER *wb = &(s->s3->wbuf); + SSL3_BUFFER *wb = &(S3I(s)->wbuf); /* XXXX */ if ((S3I(s)->wpend_tot > (int)len) || ((S3I(s)->wpend_buf != buf) && @@ -901,7 +901,7 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) unsigned int n; SSL3_RECORD *rr; - if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ + if (S3I(s)->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_read_buffer(s)) return (-1); @@ -1031,7 +1031,7 @@ start: s->internal->rstate = SSL_ST_READ_HEADER; rr->off = 0; if (s->internal->mode & SSL_MODE_RELEASE_BUFFERS && - s->s3->rbuf.left == 0) + S3I(s)->rbuf.left == 0) ssl3_release_read_buffer(s); } } @@ -1115,7 +1115,7 @@ start: } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) { + if (S3I(s)->rbuf.left == 0) { /* no read-ahead left? */ /* In the case where we try to read application data, * but we trigger an SSL handshake, we return -1 with @@ -1276,7 +1276,7 @@ start: } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) { /* no read-ahead left? */ + if (S3I(s)->rbuf.left == 0) { /* no read-ahead left? */ /* In the case where we try to read application data, * but we trigger an SSL handshake, we return -1 with * the retry option set. Otherwise renegotiation may @@ -1403,10 +1403,10 @@ ssl3_send_alert(SSL *s, int level, int desc) if ((level == 2) && (s->session != NULL)) SSL_CTX_remove_session(s->ctx, s->session); - s->s3->alert_dispatch = 1; - s->s3->send_alert[0] = level; - s->s3->send_alert[1] = desc; - if (s->s3->wbuf.left == 0) /* data still being written out? */ + S3I(s)->alert_dispatch = 1; + S3I(s)->send_alert[0] = level; + S3I(s)->send_alert[1] = desc; + if (S3I(s)->wbuf.left == 0) /* data still being written out? */ return s->method->ssl_dispatch_alert(s); /* else data is still being written out, we will get written @@ -1420,20 +1420,20 @@ ssl3_dispatch_alert(SSL *s) int i, j; void (*cb)(const SSL *ssl, int type, int val) = NULL; - s->s3->alert_dispatch = 0; - i = do_ssl3_write(s, SSL3_RT_ALERT, &s->s3->send_alert[0], 2, 0); + S3I(s)->alert_dispatch = 0; + i = do_ssl3_write(s, SSL3_RT_ALERT, &S3I(s)->send_alert[0], 2, 0); if (i <= 0) { - s->s3->alert_dispatch = 1; + S3I(s)->alert_dispatch = 1; } else { /* Alert sent to BIO. If it is important, flush it now. * If the message does not get sent due to non-blocking IO, * we will not worry too much. */ - if (s->s3->send_alert[0] == SSL3_AL_FATAL) + if (S3I(s)->send_alert[0] == SSL3_AL_FATAL) (void)BIO_flush(s->wbio); if (s->internal->msg_callback) s->internal->msg_callback(1, s->version, SSL3_RT_ALERT, - s->s3->send_alert, 2, s, s->internal->msg_callback_arg); + S3I(s)->send_alert, 2, s, s->internal->msg_callback_arg); if (s->internal->info_callback != NULL) cb = s->internal->info_callback; @@ -1441,7 +1441,7 @@ ssl3_dispatch_alert(SSL *s) cb = s->ctx->internal->info_callback; if (cb != NULL) { - j = (s->s3->send_alert[0]<<8)|s->s3->send_alert[1]; + j = (S3I(s)->send_alert[0]<<8)|S3I(s)->send_alert[1]; cb(s, SSL_CB_WRITE_ALERT, j); } } diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index b8ebf52417..2a38d8de6a 100644 --- a/src/lib/libssl/t1_enc.c +++ b/src/lib/libssl/t1_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_enc.c,v 1.114 2018/09/08 14:39:41 jsing Exp $ */ +/* $OpenBSD: t1_enc.c,v 1.115 2018/10/24 18:04:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -579,7 +579,7 @@ tls1_change_cipher_state(SSL *s, int which) iv_len = EVP_CIPHER_iv_length(cipher); } - mac_secret_size = s->s3->tmp.new_mac_secret_size; + mac_secret_size = S3I(s)->tmp.new_mac_secret_size; key_block = S3I(s)->hs.key_block; client_write_mac_secret = key_block; @@ -666,7 +666,7 @@ tls1_setup_key_block(SSL *s) S3I(s)->tmp.new_sym_enc = cipher; S3I(s)->tmp.new_hash = mac; S3I(s)->tmp.new_mac_pkey_type = mac_type; - s->s3->tmp.new_mac_secret_size = mac_secret_size; + S3I(s)->tmp.new_mac_secret_size = mac_secret_size; tls1_cleanup_key_block(s); -- cgit v1.2.3-55-g6feb