aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/otp_test_engine.c
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-05 13:42:54 -0800
committerDoug Hogan <[email protected]>2019-01-08 01:11:59 -0800
commit85e979749ad60c7c3ddd160ca2673a8bf8a581e7 (patch)
tree01a3de2e0e3d2430c08bd8553e78ed9c524945ba /lib/crypto/c_src/otp_test_engine.c
parentf03e582f0cdc2518ecd3b231c721d45b48381fed (diff)
downloadotp-85e979749ad60c7c3ddd160ca2673a8bf8a581e7.tar.gz
otp-85e979749ad60c7c3ddd160ca2673a8bf8a581e7.tar.bz2
otp-85e979749ad60c7c3ddd160ca2673a8bf8a581e7.zip
Revamp test_rsa_verify()
Diffstat (limited to 'lib/crypto/c_src/otp_test_engine.c')
-rw-r--r--lib/crypto/c_src/otp_test_engine.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/crypto/c_src/otp_test_engine.c b/lib/crypto/c_src/otp_test_engine.c
index f971dbc3ca..4557eaa877 100644
--- a/lib/crypto/c_src/otp_test_engine.c
+++ b/lib/crypto/c_src/otp_test_engine.c
@@ -430,8 +430,13 @@ int test_rsa_verify(int dtype,
if ((sizeof(fake_flag) == m_len)
&& bcmp(m,fake_flag,m_len) == 0) {
+ int size;
+
+ if ((size = RSA_size(rsa)) < 0)
+ return 0;
+
printf("To be faked\r\n");
- return (siglen == RSA_size(rsa))
+ return (siglen == (unsigned int)size)
&& chk_test_data(sigret, siglen);
}
return 0;