summaryrefslogtreecommitdiffstats
path: root/ssl/d1_clnt.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-09-07 20:40:59 -0400
committerNick Mathewson <nickm@torproject.org>2013-09-16 13:44:10 -0400
commit4af793036f6ef4f0a1078e5d7155426a98d50e37 (patch)
tree610acd22f68d760448939691b2603fb8c5e8a082 /ssl/d1_clnt.c
parent46ebd9e3bb623d3c15ef2203038956f3f7213620 (diff)
Do not include a timestamp in the ClientHello Random field.
Instead, send random bytes. While the gmt_unix_time record was added in an ostensible attempt to mitigate the dangers of a bad RNG, its presence leaks the host's view of the current time in the clear. This minor leak can help fingerprint TLS instances across networks and protocols... and what's worse, it's doubtful thet the gmt_unix_time record does any good at all for its intended purpose, since: * It's quite possible to open two TLS connections in one second. * If the PRNG output is prone to repeat itself, ephemeral * handshakes (and who knows what else besides) are broken.
Diffstat (limited to 'ssl/d1_clnt.c')
-rw-r--r--ssl/d1_clnt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c
index a6ed09c51d..bfde14e09f 100644
--- a/ssl/d1_clnt.c
+++ b/ssl/d1_clnt.c
@@ -773,7 +773,7 @@ int dtls1_client_hello(SSL *s)
unsigned char *buf;
unsigned char *p,*d;
unsigned int i,j;
- unsigned long Time,l;
+ unsigned long l;
SSL_COMP *comp;
buf=(unsigned char *)s->init_buf->data;
@@ -801,9 +801,7 @@ int dtls1_client_hello(SSL *s)
for (i=0;p[i]=='\0' && i<sizeof(s->s3->client_random);i++) ;
if (i==sizeof(s->s3->client_random))
{
- Time=(unsigned long)time(NULL); /* Time */
- l2n(Time,p);
- RAND_pseudo_bytes(p,sizeof(s->s3->client_random)-4);
+ RAND_pseudo_bytes(p,sizeof(s->s3->client_random));
}
/* Do the message type and length last */