diff options
Diffstat (limited to 'src/lib/libssl/d1_srvr.c')
-rw-r--r-- | src/lib/libssl/d1_srvr.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 29421da9aa..9975e20873 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c | |||
@@ -276,10 +276,11 @@ int dtls1_accept(SSL *s) | |||
276 | case SSL3_ST_SW_HELLO_REQ_B: | 276 | case SSL3_ST_SW_HELLO_REQ_B: |
277 | 277 | ||
278 | s->shutdown=0; | 278 | s->shutdown=0; |
279 | dtls1_clear_record_buffer(s); | ||
279 | dtls1_start_timer(s); | 280 | dtls1_start_timer(s); |
280 | ret=dtls1_send_hello_request(s); | 281 | ret=dtls1_send_hello_request(s); |
281 | if (ret <= 0) goto end; | 282 | if (ret <= 0) goto end; |
282 | s->s3->tmp.next_state=SSL3_ST_SW_HELLO_REQ_C; | 283 | s->s3->tmp.next_state=SSL3_ST_SR_CLNT_HELLO_A; |
283 | s->state=SSL3_ST_SW_FLUSH; | 284 | s->state=SSL3_ST_SW_FLUSH; |
284 | s->init_num=0; | 285 | s->init_num=0; |
285 | 286 | ||
@@ -721,10 +722,13 @@ int dtls1_accept(SSL *s) | |||
721 | if (ret <= 0) goto end; | 722 | if (ret <= 0) goto end; |
722 | 723 | ||
723 | #ifndef OPENSSL_NO_SCTP | 724 | #ifndef OPENSSL_NO_SCTP |
724 | /* Change to new shared key of SCTP-Auth, | 725 | if (!s->hit) |
725 | * will be ignored if no SCTP used. | 726 | { |
726 | */ | 727 | /* Change to new shared key of SCTP-Auth, |
727 | BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY, 0, NULL); | 728 | * will be ignored if no SCTP used. |
729 | */ | ||
730 | BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY, 0, NULL); | ||
731 | } | ||
728 | #endif | 732 | #endif |
729 | 733 | ||
730 | s->state=SSL3_ST_SW_FINISHED_A; | 734 | s->state=SSL3_ST_SW_FINISHED_A; |
@@ -749,7 +753,16 @@ int dtls1_accept(SSL *s) | |||
749 | if (ret <= 0) goto end; | 753 | if (ret <= 0) goto end; |
750 | s->state=SSL3_ST_SW_FLUSH; | 754 | s->state=SSL3_ST_SW_FLUSH; |
751 | if (s->hit) | 755 | if (s->hit) |
756 | { | ||
752 | s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; | 757 | s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; |
758 | |||
759 | #ifndef OPENSSL_NO_SCTP | ||
760 | /* Change to new shared key of SCTP-Auth, | ||
761 | * will be ignored if no SCTP used. | ||
762 | */ | ||
763 | BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY, 0, NULL); | ||
764 | #endif | ||
765 | } | ||
753 | else | 766 | else |
754 | { | 767 | { |
755 | s->s3->tmp.next_state=SSL_ST_OK; | 768 | s->s3->tmp.next_state=SSL_ST_OK; |
@@ -912,15 +925,13 @@ int dtls1_send_server_hello(SSL *s) | |||
912 | unsigned char *p,*d; | 925 | unsigned char *p,*d; |
913 | int i; | 926 | int i; |
914 | unsigned int sl; | 927 | unsigned int sl; |
915 | unsigned long l,Time; | 928 | unsigned long l; |
916 | 929 | ||
917 | if (s->state == SSL3_ST_SW_SRVR_HELLO_A) | 930 | if (s->state == SSL3_ST_SW_SRVR_HELLO_A) |
918 | { | 931 | { |
919 | buf=(unsigned char *)s->init_buf->data; | 932 | buf=(unsigned char *)s->init_buf->data; |
920 | p=s->s3->server_random; | 933 | p=s->s3->server_random; |
921 | Time=(unsigned long)time(NULL); /* Time */ | 934 | ssl_fill_hello_random(s, 1, p, SSL3_RANDOM_SIZE); |
922 | l2n(Time,p); | ||
923 | RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4); | ||
924 | /* Do the message type and length last */ | 935 | /* Do the message type and length last */ |
925 | d=p= &(buf[DTLS1_HM_HEADER_LENGTH]); | 936 | d=p= &(buf[DTLS1_HM_HEADER_LENGTH]); |
926 | 937 | ||