]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[tls] Include current time within the client random bytes
authorMichael Brown <mcb30@ipxe.org>
Mon, 19 Mar 2012 23:05:26 +0000 (23:05 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 19 Mar 2012 23:07:13 +0000 (23:07 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tls.c

index 1688dfc38f6400ac559a7eb7ec93427834785d10..276b23577a59b4a1ed1a2227400283bba21b784b 100644 (file)
@@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
+#include <time.h>
 #include <errno.h>
 #include <byteswap.h>
 #include <ipxe/hmac.h>
@@ -2030,7 +2031,7 @@ int add_tls ( struct interface *xfer, const char *name,
        tls_clear_cipher ( tls, &tls->tx_cipherspec_pending );
        tls_clear_cipher ( tls, &tls->rx_cipherspec );
        tls_clear_cipher ( tls, &tls->rx_cipherspec_pending );
-       tls->client_random.gmt_unix_time = 0;
+       tls->client_random.gmt_unix_time = time ( NULL );
        if ( ( rc = tls_generate_random ( tls, &tls->client_random.random,
                          ( sizeof ( tls->client_random.random ) ) ) ) != 0 ) {
                goto err_random;