-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Description
Hello again Richard (I'm guessing).
Building on VMS V8.4 introduces a dependency on SYS$GETTIM_PREC that precludes an executable from running on say V8.3 (and there are lots of VMS systems about that have not moved to V8.4 for various reasons). To address this dependency I suggest adopting the approach used for SYS$GET_ENTROPY, that is, dynamically loading the SYS$GETTIM_PREC address at runtime. If it cannot be found (e.g. on V8.3) then just setting the address to be SYS$GETTIM (which is always available). This will extend the availability of OpenSSL builds provided by say VSI, to a significantly broader range of VMS systems.
#define PUBLIC_VECTORS "SYS$LIBRARY:SYS$PUBLIC_VECTORS.EXE"
#define GET_GETTIM_PREC "SYS$GETTIM_PREC"
static void (*get_gettim_prec_address)(void*) = NULL;
static void init_get_gettim_prec_address(void)
{
get_gettim_prec_address = dlsym(dlopen(PUBLIC_VECTORS, 0), GET_GETTIM_PREC);
if (get_gettim_prec_address == NULL) get_gettim_prec_address = (void*)sys$gettim;
}
#undef PUBLIC_VECTORS
Then for rand_pool_add_nonce_data()
data.pid = getpid();
data.tid = CRYPTO_THREAD_get_current_id();
if (get_gettim_prec_address == NULL) init_get_gettim_prec_address();
get_gettim_prec_address((void*)&data.time);
and rand_pool_add_additional_data()
data.tid = CRYPTO_THREAD_get_current_id();
if (get_gettim_prec_address == NULL) init_get_gettim_prec_address();
get_gettim_prec_address((void*)&data.time);
This has been tested under OpenSSL 1.1.1l on VMS V8.4 and V8.3.
The full modified OpenSSL 1.1.1l rand_vms.c for comparison purposes can be found at