浏览代码

[tls] Include current time within the client random bytes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 年前
父节点
当前提交
5da712385e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      src/net/tls.c

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

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;

正在加载...
取消
保存