Browse Source

[tls] Include current time within the client random bytes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
5da712385e
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/net/tls.c

+ 2
- 1
src/net/tls.c View File

28
 #include <stdlib.h>
28
 #include <stdlib.h>
29
 #include <stdarg.h>
29
 #include <stdarg.h>
30
 #include <string.h>
30
 #include <string.h>
31
+#include <time.h>
31
 #include <errno.h>
32
 #include <errno.h>
32
 #include <byteswap.h>
33
 #include <byteswap.h>
33
 #include <ipxe/hmac.h>
34
 #include <ipxe/hmac.h>
2030
 	tls_clear_cipher ( tls, &tls->tx_cipherspec_pending );
2031
 	tls_clear_cipher ( tls, &tls->tx_cipherspec_pending );
2031
 	tls_clear_cipher ( tls, &tls->rx_cipherspec );
2032
 	tls_clear_cipher ( tls, &tls->rx_cipherspec );
2032
 	tls_clear_cipher ( tls, &tls->rx_cipherspec_pending );
2033
 	tls_clear_cipher ( tls, &tls->rx_cipherspec_pending );
2033
-	tls->client_random.gmt_unix_time = 0;
2034
+	tls->client_random.gmt_unix_time = time ( NULL );
2034
 	if ( ( rc = tls_generate_random ( tls, &tls->client_random.random,
2035
 	if ( ( rc = tls_generate_random ( tls, &tls->client_random.random,
2035
 			  ( sizeof ( tls->client_random.random ) ) ) ) != 0 ) {
2036
 			  ( sizeof ( tls->client_random.random ) ) ) ) != 0 ) {
2036
 		goto err_random;
2037
 		goto err_random;

Loading…
Cancel
Save