Skip to content

Commit d2254c6

Browse files
committed
test/provider: Explicitly initialize OpenSSL after setting env vars.
When running with a libica version without commit opencryptoki/libica@42e197f it is necessary to explicitly initialize OpenSSL before loading libica. Because otherwise libica's library constructor will initialize OpenSSL the first time, which in turn will load the IBMCA provider, and it will fall into the same problem as fixed by above libica commit, i.e. the provider won't be able to get the supported algorithms from libica an thus will not register any algorithms. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
1 parent 2f420ff commit d2254c6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

test/provider/dhkey.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ int main(int argc, char **argv)
461461
return 77;
462462
}
463463

464+
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
465+
464466
ret = check_libica();
465467
if (ret != 0)
466468
return ret;

test/provider/eckey.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,8 @@ int main(int argc, char **argv)
895895
return 77;
896896
}
897897

898+
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
899+
898900
ret = check_libica();
899901
if (ret != 0)
900902
return ret;

test/provider/rsakey.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ int main(int argc, char **argv)
839839
return 77;
840840
}
841841

842+
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
843+
842844
ret = check_libica();
843845
if (ret != 0)
844846
return ret;

0 commit comments

Comments
 (0)