提交 d6d6aa35 编写于 作者: R Richard Levitte

VMS: only use the high precision on VMS v8.4 and up

It simply isn't available on older versions.

Issue submitted by Mark Daniels

Fixes #7229
Reviewed-by: NTim Hudson <tjh@openssl.org>
Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/7230)
上级 2ccfcbfb
...@@ -478,13 +478,18 @@ int rand_pool_add_nonce_data(RAND_POOL *pool) ...@@ -478,13 +478,18 @@ int rand_pool_add_nonce_data(RAND_POOL *pool)
} data = { 0 }; } data = { 0 };
/* /*
* Add process id, thread id, and a high resolution timestamp to * Add process id, thread id, and a high resolution timestamp
* ensure that the nonce is unique whith high probability for * (where available, which is OpenVMS v8.4 and up) to ensure that
* different process instances. * the nonce is unique whith high probability for different process
* instances.
*/ */
data.pid = getpid(); data.pid = getpid();
data.tid = CRYPTO_THREAD_get_current_id(); data.tid = CRYPTO_THREAD_get_current_id();
#if __CRTL_VER >= 80400000
sys$gettim_prec(&data.time); sys$gettim_prec(&data.time);
#else
sys$gettim((void*)&data.time);
#endif
return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0); return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册