Fix another gmt_unix_time case in server_random

This commit is contained in:
Nick Mathewson 2013-10-20 15:08:58 -07:00 committed by Ben Laurie
parent 2016265dfb
commit 2927791d77

View File

@ -1493,19 +1493,13 @@ int ssl3_send_server_hello(SSL *s)
unsigned char *p,*d; unsigned char *p,*d;
int i,sl; int i,sl;
unsigned long l; unsigned long l;
#ifdef OPENSSL_NO_TLSEXT
unsigned long Time;
#endif
if (s->state == SSL3_ST_SW_SRVR_HELLO_A) if (s->state == SSL3_ST_SW_SRVR_HELLO_A)
{ {
buf=(unsigned char *)s->init_buf->data; buf=(unsigned char *)s->init_buf->data;
#ifdef OPENSSL_NO_TLSEXT #ifdef OPENSSL_NO_TLSEXT
p=s->s3->server_random; p=s->s3->server_random;
/* Generate server_random if it was not needed previously */ if (ssl_fill_hello_random(s, 1, p, SSL3_RANDOM_SIZE) <= 0)
Time=(unsigned long)time(NULL); /* Time */
l2n(Time,p);
if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0)
return -1; return -1;
#endif #endif
/* Do the message type and length last */ /* Do the message type and length last */