diff options
author | beck <> | 2017-05-06 22:24:58 +0000 |
---|---|---|
committer | beck <> | 2017-05-06 22:24:58 +0000 |
commit | de2b05d4b4bdc8132abc4507b6d3e48eeba9340b (patch) | |
tree | 4bcdcd934dd374037387e49c88e9fc7a9c2362be /src/lib/libssl/d1_srvr.c | |
parent | 0e5e712591c7f580f436de535348a0d768707768 (diff) | |
download | openbsd-de2b05d4b4bdc8132abc4507b6d3e48eeba9340b.tar.gz openbsd-de2b05d4b4bdc8132abc4507b6d3e48eeba9340b.tar.bz2 openbsd-de2b05d4b4bdc8132abc4507b6d3e48eeba9340b.zip |
Bring in an SSL_HANDSHAKE structure and commence the great shovelling
ok jsing@, gcc@, regress@
Diffstat (limited to 'src/lib/libssl/d1_srvr.c')
-rw-r--r-- | src/lib/libssl/d1_srvr.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 605f0a59ad..1ef8bce56b 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.86 2017/03/10 16:03:27 jsing Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.87 2017/05/06 22:24:57 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. |
@@ -277,7 +277,7 @@ dtls1_accept(SSL *s) | |||
277 | ret = ssl3_send_hello_request(s); | 277 | ret = ssl3_send_hello_request(s); |
278 | if (ret <= 0) | 278 | if (ret <= 0) |
279 | goto end; | 279 | goto end; |
280 | S3I(s)->tmp.next_state = SSL3_ST_SR_CLNT_HELLO_A; | 280 | S3I(s)->hs.next_state = SSL3_ST_SR_CLNT_HELLO_A; |
281 | s->internal->state = SSL3_ST_SW_FLUSH; | 281 | s->internal->state = SSL3_ST_SW_FLUSH; |
282 | s->internal->init_num = 0; | 282 | s->internal->init_num = 0; |
283 | 283 | ||
@@ -335,7 +335,7 @@ dtls1_accept(SSL *s) | |||
335 | if (ret <= 0) | 335 | if (ret <= 0) |
336 | goto end; | 336 | goto end; |
337 | s->internal->state = SSL3_ST_SW_FLUSH; | 337 | s->internal->state = SSL3_ST_SW_FLUSH; |
338 | S3I(s)->tmp.next_state = SSL3_ST_SR_CLNT_HELLO_A; | 338 | S3I(s)->hs.next_state = SSL3_ST_SR_CLNT_HELLO_A; |
339 | 339 | ||
340 | /* HelloVerifyRequest resets Finished MAC */ | 340 | /* HelloVerifyRequest resets Finished MAC */ |
341 | if (!tls1_init_finished_mac(s)) { | 341 | if (!tls1_init_finished_mac(s)) { |
@@ -366,7 +366,7 @@ dtls1_accept(SSL *s) | |||
366 | case SSL3_ST_SW_CERT_A: | 366 | case SSL3_ST_SW_CERT_A: |
367 | case SSL3_ST_SW_CERT_B: | 367 | case SSL3_ST_SW_CERT_B: |
368 | /* Check if it is anon DH. */ | 368 | /* Check if it is anon DH. */ |
369 | if (!(S3I(s)->tmp.new_cipher->algorithm_auth & | 369 | if (!(S3I(s)->hs.new_cipher->algorithm_auth & |
370 | SSL_aNULL)) { | 370 | SSL_aNULL)) { |
371 | dtls1_start_timer(s); | 371 | dtls1_start_timer(s); |
372 | ret = ssl3_send_server_certificate(s); | 372 | ret = ssl3_send_server_certificate(s); |
@@ -385,7 +385,7 @@ dtls1_accept(SSL *s) | |||
385 | 385 | ||
386 | case SSL3_ST_SW_KEY_EXCH_A: | 386 | case SSL3_ST_SW_KEY_EXCH_A: |
387 | case SSL3_ST_SW_KEY_EXCH_B: | 387 | case SSL3_ST_SW_KEY_EXCH_B: |
388 | alg_k = S3I(s)->tmp.new_cipher->algorithm_mkey; | 388 | alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; |
389 | 389 | ||
390 | /* Only send if using a DH key exchange. */ | 390 | /* Only send if using a DH key exchange. */ |
391 | if (alg_k & (SSL_kDHE|SSL_kECDHE)) { | 391 | if (alg_k & (SSL_kDHE|SSL_kECDHE)) { |
@@ -422,7 +422,7 @@ dtls1_accept(SSL *s) | |||
422 | if (!(s->verify_mode & SSL_VERIFY_PEER) || | 422 | if (!(s->verify_mode & SSL_VERIFY_PEER) || |
423 | ((s->session->peer != NULL) && | 423 | ((s->session->peer != NULL) && |
424 | (s->verify_mode & SSL_VERIFY_CLIENT_ONCE)) || | 424 | (s->verify_mode & SSL_VERIFY_CLIENT_ONCE)) || |
425 | ((S3I(s)->tmp.new_cipher->algorithm_auth & | 425 | ((S3I(s)->hs.new_cipher->algorithm_auth & |
426 | SSL_aNULL) && !(s->verify_mode & | 426 | SSL_aNULL) && !(s->verify_mode & |
427 | SSL_VERIFY_FAIL_IF_NO_PEER_CERT))) { | 427 | SSL_VERIFY_FAIL_IF_NO_PEER_CERT))) { |
428 | /* no cert request */ | 428 | /* no cert request */ |
@@ -446,7 +446,7 @@ dtls1_accept(SSL *s) | |||
446 | ret = ssl3_send_server_done(s); | 446 | ret = ssl3_send_server_done(s); |
447 | if (ret <= 0) | 447 | if (ret <= 0) |
448 | goto end; | 448 | goto end; |
449 | S3I(s)->tmp.next_state = SSL3_ST_SR_CERT_A; | 449 | S3I(s)->hs.next_state = SSL3_ST_SR_CERT_A; |
450 | s->internal->state = SSL3_ST_SW_FLUSH; | 450 | s->internal->state = SSL3_ST_SW_FLUSH; |
451 | s->internal->init_num = 0; | 451 | s->internal->init_num = 0; |
452 | break; | 452 | break; |
@@ -457,14 +457,14 @@ dtls1_accept(SSL *s) | |||
457 | /* If the write error was fatal, stop trying */ | 457 | /* If the write error was fatal, stop trying */ |
458 | if (!BIO_should_retry(s->wbio)) { | 458 | if (!BIO_should_retry(s->wbio)) { |
459 | s->internal->rwstate = SSL_NOTHING; | 459 | s->internal->rwstate = SSL_NOTHING; |
460 | s->internal->state = S3I(s)->tmp.next_state; | 460 | s->internal->state = S3I(s)->hs.next_state; |
461 | } | 461 | } |
462 | 462 | ||
463 | ret = -1; | 463 | ret = -1; |
464 | goto end; | 464 | goto end; |
465 | } | 465 | } |
466 | s->internal->rwstate = SSL_NOTHING; | 466 | s->internal->rwstate = SSL_NOTHING; |
467 | s->internal->state = S3I(s)->tmp.next_state; | 467 | s->internal->state = S3I(s)->hs.next_state; |
468 | break; | 468 | break; |
469 | 469 | ||
470 | case SSL3_ST_SR_CERT_A: | 470 | case SSL3_ST_SR_CERT_A: |
@@ -590,7 +590,7 @@ dtls1_accept(SSL *s) | |||
590 | case SSL3_ST_SW_CHANGE_A: | 590 | case SSL3_ST_SW_CHANGE_A: |
591 | case SSL3_ST_SW_CHANGE_B: | 591 | case SSL3_ST_SW_CHANGE_B: |
592 | 592 | ||
593 | s->session->cipher = S3I(s)->tmp.new_cipher; | 593 | s->session->cipher = S3I(s)->hs.new_cipher; |
594 | if (!tls1_setup_key_block(s)) { | 594 | if (!tls1_setup_key_block(s)) { |
595 | ret = -1; | 595 | ret = -1; |
596 | goto end; | 596 | goto end; |
@@ -625,10 +625,10 @@ dtls1_accept(SSL *s) | |||
625 | goto end; | 625 | goto end; |
626 | s->internal->state = SSL3_ST_SW_FLUSH; | 626 | s->internal->state = SSL3_ST_SW_FLUSH; |
627 | if (s->internal->hit) { | 627 | if (s->internal->hit) { |
628 | S3I(s)->tmp.next_state = SSL3_ST_SR_FINISHED_A; | 628 | S3I(s)->hs.next_state = SSL3_ST_SR_FINISHED_A; |
629 | 629 | ||
630 | } else { | 630 | } else { |
631 | S3I(s)->tmp.next_state = SSL_ST_OK; | 631 | S3I(s)->hs.next_state = SSL_ST_OK; |
632 | } | 632 | } |
633 | s->internal->init_num = 0; | 633 | s->internal->init_num = 0; |
634 | break; | 634 | break; |