summaryrefslogtreecommitdiffstats
path: root/ssl/s23_clnt.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-09 10:28:42 -0400
committerNick Mathewson <nickm@torproject.org>2013-10-09 10:28:42 -0400
commit3da721dac9382c48812c8eba455528fd59af2eef (patch)
treeaa3dfa04b2157499d84cd979cfaeed2cb8e11beb /ssl/s23_clnt.c
parentf4c93b46edb51da71f09eda99e83eaf193a33c08 (diff)
Refactor {client,server}_random to call an intermediate function
I'll be using this to make an option for randomizing the time.
Diffstat (limited to 'ssl/s23_clnt.c')
-rw-r--r--ssl/s23_clnt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c
index c9ef0f5cfc..01e492adfb 100644
--- a/ssl/s23_clnt.c
+++ b/ssl/s23_clnt.c
@@ -269,6 +269,13 @@ static int ssl23_no_ssl2_ciphers(SSL *s)
return 1;
}
+/* Fill a ClientRandom or ServerRandom field of length len. Returns <= 0
+ * on failure, 1 on success. */
+int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len)
+ {
+ return RAND_pseudo_bytes(result, len);
+ }
+
static int ssl23_client_hello(SSL *s)
{
unsigned char *buf;
@@ -355,7 +362,7 @@ static int ssl23_client_hello(SSL *s)
#endif
p=s->s3->client_random;
- if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE) <= 0)
+ if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
return -1;
if (version == TLS1_2_VERSION)