aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-05 12:37:44 -0800
committerDoug Hogan <[email protected]>2019-01-08 01:11:59 -0800
commitd28469e30e4ceb6df579eefb7ae6e637b29b2616 (patch)
tree7159a32067d62844755f8e29a888adb28a00e9a8 /lib/crypto/c_src
parentadc780e8b1a2c9fd555f6435de851ed0ab609094 (diff)
downloadotp-d28469e30e4ceb6df579eefb7ae6e637b29b2616.tar.gz
otp-d28469e30e4ceb6df579eefb7ae6e637b29b2616.tar.bz2
otp-d28469e30e4ceb6df579eefb7ae6e637b29b2616.zip
Revamp test_init()
Diffstat (limited to 'lib/crypto/c_src')
-rw-r--r--lib/crypto/c_src/otp_test_engine.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/crypto/c_src/otp_test_engine.c b/lib/crypto/c_src/otp_test_engine.c
index 2c8cce094e..59a2287e6c 100644
--- a/lib/crypto/c_src/otp_test_engine.c
+++ b/lib/crypto/c_src/otp_test_engine.c
@@ -87,13 +87,12 @@ static int test_init(ENGINE *e) {
printf("OTP Test Engine Initializatzion!\r\n");
#if defined(FAKE_RSA_IMPL)
- if ( !RSA_meth_set_finish(test_rsa_method, test_rsa_free)
- || !RSA_meth_set_sign(test_rsa_method, test_rsa_sign)
- || !RSA_meth_set_verify(test_rsa_method, test_rsa_verify)
- ) {
- fprintf(stderr, "Setup RSA_METHOD failed\r\n");
- return 0;
- }
+ if (!RSA_meth_set_finish(test_rsa_method, test_rsa_free))
+ goto err;
+ if (!RSA_meth_set_sign(test_rsa_method, test_rsa_sign))
+ goto err;
+ if (!RSA_meth_set_verify(test_rsa_method, test_rsa_verify))
+ goto err;
#endif /* if defined(FAKE_RSA_IMPL) */
/* Load all digest and cipher algorithms. Needed for password protected private keys */
@@ -101,6 +100,10 @@ static int test_init(ENGINE *e) {
OpenSSL_add_all_digests();
return 111;
+
+ err:
+ fprintf(stderr, "Setup RSA_METHOD failed\r\n");
+ return 0;
}
static void add_test_data(unsigned char *md, unsigned int len)