diff options
Diffstat (limited to 'src/lib/libssl/s3_pkt.c')
-rw-r--r-- | src/lib/libssl/s3_pkt.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/lib/libssl/s3_pkt.c b/src/lib/libssl/s3_pkt.c index a1d0ef9299..004ede2ef0 100644 --- a/src/lib/libssl/s3_pkt.c +++ b/src/lib/libssl/s3_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s3_pkt.c,v 1.62 2017/01/23 04:15:28 jsing Exp $ */ | 1 | /* $OpenBSD: s3_pkt.c,v 1.63 2017/01/23 04:55:26 beck Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -513,8 +513,8 @@ ssl3_write_bytes(SSL *s, int type, const void *buf_, int len) | |||
513 | tot = S3I(s)->wnum; | 513 | tot = S3I(s)->wnum; |
514 | S3I(s)->wnum = 0; | 514 | S3I(s)->wnum = 0; |
515 | 515 | ||
516 | if (SSL_in_init(s) && !s->in_handshake) { | 516 | if (SSL_in_init(s) && !s->internal->in_handshake) { |
517 | i = s->handshake_func(s); | 517 | i = s->internal->handshake_func(s); |
518 | if (i < 0) | 518 | if (i < 0) |
519 | return (i); | 519 | return (i); |
520 | if (i == 0) { | 520 | if (i == 0) { |
@@ -886,9 +886,9 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) | |||
886 | * Now S3I(s)->handshake_fragment_len == 0 if | 886 | * Now S3I(s)->handshake_fragment_len == 0 if |
887 | * type == SSL3_RT_HANDSHAKE. | 887 | * type == SSL3_RT_HANDSHAKE. |
888 | */ | 888 | */ |
889 | if (!s->in_handshake && SSL_in_init(s)) { | 889 | if (!s->internal->in_handshake && SSL_in_init(s)) { |
890 | /* type == SSL3_RT_APPLICATION_DATA */ | 890 | /* type == SSL3_RT_APPLICATION_DATA */ |
891 | i = s->handshake_func(s); | 891 | i = s->internal->handshake_func(s); |
892 | if (i < 0) | 892 | if (i < 0) |
893 | return (i); | 893 | return (i); |
894 | if (i == 0) { | 894 | if (i == 0) { |
@@ -1049,17 +1049,17 @@ start: | |||
1049 | goto f_err; | 1049 | goto f_err; |
1050 | } | 1050 | } |
1051 | 1051 | ||
1052 | if (s->msg_callback) | 1052 | if (s->internal->msg_callback) |
1053 | s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, | 1053 | s->internal->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, |
1054 | S3I(s)->handshake_fragment, 4, s, | 1054 | S3I(s)->handshake_fragment, 4, s, |
1055 | s->msg_callback_arg); | 1055 | s->internal->msg_callback_arg); |
1056 | 1056 | ||
1057 | if (SSL_is_init_finished(s) && | 1057 | if (SSL_is_init_finished(s) && |
1058 | !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && | 1058 | !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && |
1059 | !S3I(s)->renegotiate) { | 1059 | !S3I(s)->renegotiate) { |
1060 | ssl3_renegotiate(s); | 1060 | ssl3_renegotiate(s); |
1061 | if (ssl3_renegotiate_check(s)) { | 1061 | if (ssl3_renegotiate_check(s)) { |
1062 | i = s->handshake_func(s); | 1062 | i = s->internal->handshake_func(s); |
1063 | if (i < 0) | 1063 | if (i < 0) |
1064 | return (i); | 1064 | return (i); |
1065 | if (i == 0) { | 1065 | if (i == 0) { |
@@ -1109,12 +1109,12 @@ start: | |||
1109 | 1109 | ||
1110 | S3I(s)->alert_fragment_len = 0; | 1110 | S3I(s)->alert_fragment_len = 0; |
1111 | 1111 | ||
1112 | if (s->msg_callback) | 1112 | if (s->internal->msg_callback) |
1113 | s->msg_callback(0, s->version, SSL3_RT_ALERT, | 1113 | s->internal->msg_callback(0, s->version, SSL3_RT_ALERT, |
1114 | S3I(s)->alert_fragment, 2, s, s->msg_callback_arg); | 1114 | S3I(s)->alert_fragment, 2, s, s->internal->msg_callback_arg); |
1115 | 1115 | ||
1116 | if (s->info_callback != NULL) | 1116 | if (s->internal->info_callback != NULL) |
1117 | cb = s->info_callback; | 1117 | cb = s->internal->info_callback; |
1118 | else if (s->ctx->internal->info_callback != NULL) | 1118 | else if (s->ctx->internal->info_callback != NULL) |
1119 | cb = s->ctx->internal->info_callback; | 1119 | cb = s->ctx->internal->info_callback; |
1120 | 1120 | ||
@@ -1200,10 +1200,10 @@ start: | |||
1200 | 1200 | ||
1201 | rr->length = 0; | 1201 | rr->length = 0; |
1202 | 1202 | ||
1203 | if (s->msg_callback) { | 1203 | if (s->internal->msg_callback) { |
1204 | s->msg_callback(0, s->version, | 1204 | s->internal->msg_callback(0, s->version, |
1205 | SSL3_RT_CHANGE_CIPHER_SPEC, rr->data, 1, s, | 1205 | SSL3_RT_CHANGE_CIPHER_SPEC, rr->data, 1, s, |
1206 | s->msg_callback_arg); | 1206 | s->internal->msg_callback_arg); |
1207 | } | 1207 | } |
1208 | 1208 | ||
1209 | S3I(s)->change_cipher_spec = 1; | 1209 | S3I(s)->change_cipher_spec = 1; |
@@ -1214,14 +1214,14 @@ start: | |||
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | /* Unexpected handshake message (Client Hello, or protocol violation) */ | 1216 | /* Unexpected handshake message (Client Hello, or protocol violation) */ |
1217 | if ((S3I(s)->handshake_fragment_len >= 4) && !s->in_handshake) { | 1217 | if ((S3I(s)->handshake_fragment_len >= 4) && !s->internal->in_handshake) { |
1218 | if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && | 1218 | if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && |
1219 | !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) { | 1219 | !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) { |
1220 | s->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; | 1220 | s->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; |
1221 | s->renegotiate = 1; | 1221 | s->renegotiate = 1; |
1222 | s->new_session = 1; | 1222 | s->new_session = 1; |
1223 | } | 1223 | } |
1224 | i = s->handshake_func(s); | 1224 | i = s->internal->handshake_func(s); |
1225 | if (i < 0) | 1225 | if (i < 0) |
1226 | return (i); | 1226 | return (i); |
1227 | if (i == 0) { | 1227 | if (i == 0) { |
@@ -1265,7 +1265,7 @@ start: | |||
1265 | case SSL3_RT_ALERT: | 1265 | case SSL3_RT_ALERT: |
1266 | case SSL3_RT_HANDSHAKE: | 1266 | case SSL3_RT_HANDSHAKE: |
1267 | /* we already handled all of these, with the possible exception | 1267 | /* we already handled all of these, with the possible exception |
1268 | * of SSL3_RT_HANDSHAKE when s->in_handshake is set, but that | 1268 | * of SSL3_RT_HANDSHAKE when s->internal->in_handshake is set, but that |
1269 | * should not happen when type != rr->type */ | 1269 | * should not happen when type != rr->type */ |
1270 | al = SSL_AD_UNEXPECTED_MESSAGE; | 1270 | al = SSL_AD_UNEXPECTED_MESSAGE; |
1271 | SSLerr(SSL_F_SSL3_READ_BYTES, ERR_R_INTERNAL_ERROR); | 1271 | SSLerr(SSL_F_SSL3_READ_BYTES, ERR_R_INTERNAL_ERROR); |
@@ -1391,12 +1391,12 @@ ssl3_dispatch_alert(SSL *s) | |||
1391 | if (s->s3->send_alert[0] == SSL3_AL_FATAL) | 1391 | if (s->s3->send_alert[0] == SSL3_AL_FATAL) |
1392 | (void)BIO_flush(s->wbio); | 1392 | (void)BIO_flush(s->wbio); |
1393 | 1393 | ||
1394 | if (s->msg_callback) | 1394 | if (s->internal->msg_callback) |
1395 | s->msg_callback(1, s->version, SSL3_RT_ALERT, | 1395 | s->internal->msg_callback(1, s->version, SSL3_RT_ALERT, |
1396 | s->s3->send_alert, 2, s, s->msg_callback_arg); | 1396 | s->s3->send_alert, 2, s, s->internal->msg_callback_arg); |
1397 | 1397 | ||
1398 | if (s->info_callback != NULL) | 1398 | if (s->internal->info_callback != NULL) |
1399 | cb = s->info_callback; | 1399 | cb = s->internal->info_callback; |
1400 | else if (s->ctx->internal->info_callback != NULL) | 1400 | else if (s->ctx->internal->info_callback != NULL) |
1401 | cb = s->ctx->internal->info_callback; | 1401 | cb = s->ctx->internal->info_callback; |
1402 | 1402 | ||