瀏覽代碼

[tls] Include current time within the client random bytes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 年之前
父節點
當前提交
5da712385e
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. 2
    1
      src/net/tls.c

+ 2
- 1
src/net/tls.c 查看文件

@@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
28 28
 #include <stdlib.h>
29 29
 #include <stdarg.h>
30 30
 #include <string.h>
31
+#include <time.h>
31 32
 #include <errno.h>
32 33
 #include <byteswap.h>
33 34
 #include <ipxe/hmac.h>
@@ -2030,7 +2031,7 @@ int add_tls ( struct interface *xfer, const char *name,
2030 2031
 	tls_clear_cipher ( tls, &tls->tx_cipherspec_pending );
2031 2032
 	tls_clear_cipher ( tls, &tls->rx_cipherspec );
2032 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 2035
 	if ( ( rc = tls_generate_random ( tls, &tls->client_random.random,
2035 2036
 			  ( sizeof ( tls->client_random.random ) ) ) ) != 0 ) {
2036 2037
 		goto err_random;

Loading…
取消
儲存