PR: 2778(part)

Submitted by: John Fitzgibbon <john_fitzgibbon@yahoo.com>

Time is always encoded as 4 bytes, not sizeof(Time).
This commit is contained in:
Dr. Stephen Henson 2012-03-31 18:02:35 +00:00
parent cdc575c46b
commit 7fdccda37d

View File

@ -771,7 +771,7 @@ int dtls1_send_server_hello(SSL *s)
p=s->s3->server_random; p=s->s3->server_random;
Time=(unsigned long)time(NULL); /* Time */ Time=(unsigned long)time(NULL); /* Time */
l2n(Time,p); l2n(Time,p);
RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-sizeof(Time)); RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4);
/* Do the message type and length last */ /* Do the message type and length last */
d=p= &(buf[DTLS1_HM_HEADER_LENGTH]); d=p= &(buf[DTLS1_HM_HEADER_LENGTH]);