diff options
| author | beck <> | 2017-01-22 07:16:39 +0000 |
|---|---|---|
| committer | beck <> | 2017-01-22 07:16:39 +0000 |
| commit | 8b577048370d1347763a8493952aef0075de26fd (patch) | |
| tree | c03f505a3f0822dbc7a4d9523cfde19318c0d121 /src/lib/libssl/d1_srvr.c | |
| parent | d61f56adf55001d197f90e95665918f07a218523 (diff) | |
| download | openbsd-8b577048370d1347763a8493952aef0075de26fd.tar.gz openbsd-8b577048370d1347763a8493952aef0075de26fd.tar.bz2 openbsd-8b577048370d1347763a8493952aef0075de26fd.zip | |
Move most of DTLS1_STATE to internal.
ok jsing@
Diffstat (limited to 'src/lib/libssl/d1_srvr.c')
| -rw-r--r-- | src/lib/libssl/d1_srvr.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 4322a219f5..6990e39f60 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: d1_srvr.c,v 1.70 2017/01/21 06:50:02 jsing Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.71 2017/01/22 07:16:39 beck Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
| 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
| @@ -193,14 +193,14 @@ dtls1_accept(SSL *s) | |||
| 193 | else if (s->ctx->info_callback != NULL) | 193 | else if (s->ctx->info_callback != NULL) |
| 194 | cb = s->ctx->info_callback; | 194 | cb = s->ctx->info_callback; |
| 195 | 195 | ||
| 196 | listen = s->d1->listen; | 196 | listen = D1I(s)->listen; |
| 197 | 197 | ||
| 198 | /* init things to blank */ | 198 | /* init things to blank */ |
| 199 | s->in_handshake++; | 199 | s->in_handshake++; |
| 200 | if (!SSL_in_init(s) || SSL_in_before(s)) | 200 | if (!SSL_in_init(s) || SSL_in_before(s)) |
| 201 | SSL_clear(s); | 201 | SSL_clear(s); |
| 202 | 202 | ||
| 203 | s->d1->listen = listen; | 203 | D1I(s)->listen = listen; |
| 204 | 204 | ||
| 205 | if (s->cert == NULL) { | 205 | if (s->cert == NULL) { |
| 206 | SSLerr(SSL_F_DTLS1_ACCEPT, SSL_R_NO_CERTIFICATE_SET); | 206 | SSLerr(SSL_F_DTLS1_ACCEPT, SSL_R_NO_CERTIFICATE_SET); |
| @@ -317,13 +317,13 @@ dtls1_accept(SSL *s) | |||
| 317 | /* If we're just listening, stop here */ | 317 | /* If we're just listening, stop here */ |
| 318 | if (listen && s->state == SSL3_ST_SW_SRVR_HELLO_A) { | 318 | if (listen && s->state == SSL3_ST_SW_SRVR_HELLO_A) { |
| 319 | ret = 2; | 319 | ret = 2; |
| 320 | s->d1->listen = 0; | 320 | D1I(s)->listen = 0; |
| 321 | /* Set expected sequence numbers | 321 | /* Set expected sequence numbers |
| 322 | * to continue the handshake. | 322 | * to continue the handshake. |
| 323 | */ | 323 | */ |
| 324 | s->d1->handshake_read_seq = 2; | 324 | D1I(s)->handshake_read_seq = 2; |
| 325 | s->d1->handshake_write_seq = 1; | 325 | D1I(s)->handshake_write_seq = 1; |
| 326 | s->d1->next_handshake_write_seq = 1; | 326 | D1I(s)->next_handshake_write_seq = 1; |
| 327 | goto end; | 327 | goto end; |
| 328 | } | 328 | } |
| 329 | 329 | ||
| @@ -534,7 +534,7 @@ dtls1_accept(SSL *s) | |||
| 534 | case SSL3_ST_SR_CERT_VRFY_A: | 534 | case SSL3_ST_SR_CERT_VRFY_A: |
| 535 | case SSL3_ST_SR_CERT_VRFY_B: | 535 | case SSL3_ST_SR_CERT_VRFY_B: |
| 536 | 536 | ||
| 537 | s->d1->change_cipher_spec_ok = 1; | 537 | D1I(s)->change_cipher_spec_ok = 1; |
| 538 | /* we should decide if we expected this one */ | 538 | /* we should decide if we expected this one */ |
| 539 | ret = ssl3_get_cert_verify(s); | 539 | ret = ssl3_get_cert_verify(s); |
| 540 | if (ret <= 0) | 540 | if (ret <= 0) |
| @@ -545,7 +545,7 @@ dtls1_accept(SSL *s) | |||
| 545 | 545 | ||
| 546 | case SSL3_ST_SR_FINISHED_A: | 546 | case SSL3_ST_SR_FINISHED_A: |
| 547 | case SSL3_ST_SR_FINISHED_B: | 547 | case SSL3_ST_SR_FINISHED_B: |
| 548 | s->d1->change_cipher_spec_ok = 1; | 548 | D1I(s)->change_cipher_spec_ok = 1; |
| 549 | ret = ssl3_get_finished(s, SSL3_ST_SR_FINISHED_A, | 549 | ret = ssl3_get_finished(s, SSL3_ST_SR_FINISHED_A, |
| 550 | SSL3_ST_SR_FINISHED_B); | 550 | SSL3_ST_SR_FINISHED_B); |
| 551 | if (ret <= 0) | 551 | if (ret <= 0) |
| @@ -652,10 +652,10 @@ dtls1_accept(SSL *s) | |||
| 652 | ret = 1; | 652 | ret = 1; |
| 653 | 653 | ||
| 654 | /* done handshaking, next message is client hello */ | 654 | /* done handshaking, next message is client hello */ |
| 655 | s->d1->handshake_read_seq = 0; | 655 | D1I(s)->handshake_read_seq = 0; |
| 656 | /* next message is server hello */ | 656 | /* next message is server hello */ |
| 657 | s->d1->handshake_write_seq = 0; | 657 | D1I(s)->handshake_write_seq = 0; |
| 658 | s->d1->next_handshake_write_seq = 0; | 658 | D1I(s)->next_handshake_write_seq = 0; |
| 659 | goto end; | 659 | goto end; |
| 660 | /* break; */ | 660 | /* break; */ |
| 661 | 661 | ||
| @@ -705,16 +705,16 @@ dtls1_send_hello_verify_request(SSL *s) | |||
| 705 | *(p++) = s->version & 0xFF; | 705 | *(p++) = s->version & 0xFF; |
| 706 | 706 | ||
| 707 | if (s->ctx->app_gen_cookie_cb == NULL || | 707 | if (s->ctx->app_gen_cookie_cb == NULL || |
| 708 | s->ctx->app_gen_cookie_cb(s, s->d1->cookie, | 708 | s->ctx->app_gen_cookie_cb(s, D1I(s)->cookie, |
| 709 | &(s->d1->cookie_len)) == 0) { | 709 | &(D1I(s)->cookie_len)) == 0) { |
| 710 | SSLerr(SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST, | 710 | SSLerr(SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST, |
| 711 | ERR_R_INTERNAL_ERROR); | 711 | ERR_R_INTERNAL_ERROR); |
| 712 | return 0; | 712 | return 0; |
| 713 | } | 713 | } |
| 714 | 714 | ||
| 715 | *(p++) = (unsigned char) s->d1->cookie_len; | 715 | *(p++) = (unsigned char) D1I(s)->cookie_len; |
| 716 | memcpy(p, s->d1->cookie, s->d1->cookie_len); | 716 | memcpy(p, D1I(s)->cookie, D1I(s)->cookie_len); |
| 717 | p += s->d1->cookie_len; | 717 | p += D1I(s)->cookie_len; |
| 718 | 718 | ||
| 719 | ssl3_handshake_msg_finish(s, p - d); | 719 | ssl3_handshake_msg_finish(s, p - d); |
| 720 | 720 | ||
