diff options
Diffstat (limited to 'src/lib/libssl/d1_clnt.c')
| -rw-r--r-- | src/lib/libssl/d1_clnt.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/lib/libssl/d1_clnt.c b/src/lib/libssl/d1_clnt.c index 48e5e06bde..a6ed09c51d 100644 --- a/src/lib/libssl/d1_clnt.c +++ b/src/lib/libssl/d1_clnt.c | |||
| @@ -538,6 +538,13 @@ int dtls1_connect(SSL *s) | |||
| 538 | SSL3_ST_CW_CHANGE_A,SSL3_ST_CW_CHANGE_B); | 538 | SSL3_ST_CW_CHANGE_A,SSL3_ST_CW_CHANGE_B); |
| 539 | if (ret <= 0) goto end; | 539 | if (ret <= 0) goto end; |
| 540 | 540 | ||
| 541 | #ifndef OPENSSL_NO_SCTP | ||
| 542 | /* Change to new shared key of SCTP-Auth, | ||
| 543 | * will be ignored if no SCTP used. | ||
| 544 | */ | ||
| 545 | BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY, 0, NULL); | ||
| 546 | #endif | ||
| 547 | |||
| 541 | s->state=SSL3_ST_CW_FINISHED_A; | 548 | s->state=SSL3_ST_CW_FINISHED_A; |
| 542 | s->init_num=0; | 549 | s->init_num=0; |
| 543 | 550 | ||
| @@ -564,16 +571,6 @@ int dtls1_connect(SSL *s) | |||
| 564 | goto end; | 571 | goto end; |
| 565 | } | 572 | } |
| 566 | 573 | ||
| 567 | #ifndef OPENSSL_NO_SCTP | ||
| 568 | if (s->hit) | ||
| 569 | { | ||
| 570 | /* Change to new shared key of SCTP-Auth, | ||
| 571 | * will be ignored if no SCTP used. | ||
| 572 | */ | ||
| 573 | BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY, 0, NULL); | ||
| 574 | } | ||
| 575 | #endif | ||
| 576 | |||
| 577 | dtls1_reset_seq_numbers(s, SSL3_CC_WRITE); | 574 | dtls1_reset_seq_numbers(s, SSL3_CC_WRITE); |
| 578 | break; | 575 | break; |
| 579 | 576 | ||
| @@ -616,13 +613,6 @@ int dtls1_connect(SSL *s) | |||
| 616 | } | 613 | } |
| 617 | else | 614 | else |
| 618 | { | 615 | { |
| 619 | #ifndef OPENSSL_NO_SCTP | ||
| 620 | /* Change to new shared key of SCTP-Auth, | ||
| 621 | * will be ignored if no SCTP used. | ||
| 622 | */ | ||
| 623 | BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY, 0, NULL); | ||
| 624 | #endif | ||
| 625 | |||
| 626 | #ifndef OPENSSL_NO_TLSEXT | 616 | #ifndef OPENSSL_NO_TLSEXT |
| 627 | /* Allow NewSessionTicket if ticket expected */ | 617 | /* Allow NewSessionTicket if ticket expected */ |
| 628 | if (s->tlsext_ticket_expected) | 618 | if (s->tlsext_ticket_expected) |
| @@ -783,7 +773,7 @@ int dtls1_client_hello(SSL *s) | |||
| 783 | unsigned char *buf; | 773 | unsigned char *buf; |
| 784 | unsigned char *p,*d; | 774 | unsigned char *p,*d; |
| 785 | unsigned int i,j; | 775 | unsigned int i,j; |
| 786 | unsigned long l; | 776 | unsigned long Time,l; |
| 787 | SSL_COMP *comp; | 777 | SSL_COMP *comp; |
| 788 | 778 | ||
| 789 | buf=(unsigned char *)s->init_buf->data; | 779 | buf=(unsigned char *)s->init_buf->data; |
| @@ -808,11 +798,13 @@ int dtls1_client_hello(SSL *s) | |||
| 808 | 798 | ||
| 809 | /* if client_random is initialized, reuse it, we are | 799 | /* if client_random is initialized, reuse it, we are |
| 810 | * required to use same upon reply to HelloVerify */ | 800 | * required to use same upon reply to HelloVerify */ |
| 811 | for (i=0;p[i]=='\0' && i<sizeof(s->s3->client_random);i++) | 801 | for (i=0;p[i]=='\0' && i<sizeof(s->s3->client_random);i++) ; |
| 812 | ; | ||
| 813 | if (i==sizeof(s->s3->client_random)) | 802 | if (i==sizeof(s->s3->client_random)) |
| 814 | ssl_fill_hello_random(s, 0, p, | 803 | { |
| 815 | sizeof(s->s3->client_random)); | 804 | Time=(unsigned long)time(NULL); /* Time */ |
| 805 | l2n(Time,p); | ||
| 806 | RAND_pseudo_bytes(p,sizeof(s->s3->client_random)-4); | ||
| 807 | } | ||
| 816 | 808 | ||
| 817 | /* Do the message type and length last */ | 809 | /* Do the message type and length last */ |
| 818 | d=p= &(buf[DTLS1_HM_HEADER_LENGTH]); | 810 | d=p= &(buf[DTLS1_HM_HEADER_LENGTH]); |
