aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-05 12:38:13 -0800
committerDoug Hogan <[email protected]>2019-01-08 01:11:59 -0800
commit42adba07051941d0093c34044d4d25159edf70ba (patch)
treee5356418ddc021dc171b891f5bc019d7dcaedb1b /lib/crypto
parentd28469e30e4ceb6df579eefb7ae6e637b29b2616 (diff)
downloadotp-42adba07051941d0093c34044d4d25159edf70ba.tar.gz
otp-42adba07051941d0093c34044d4d25159edf70ba.tar.bz2
otp-42adba07051941d0093c34044d4d25159edf70ba.zip
Revamp test_engine_md5_final()
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/c_src/otp_test_engine.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/crypto/c_src/otp_test_engine.c b/lib/crypto/c_src/otp_test_engine.c
index 59a2287e6c..94f88fed79 100644
--- a/lib/crypto/c_src/otp_test_engine.c
+++ b/lib/crypto/c_src/otp_test_engine.c
@@ -155,15 +155,15 @@ static int test_engine_md5_update(EVP_MD_CTX *ctx,const void *data, size_t count
static int test_engine_md5_final(EVP_MD_CTX *ctx,unsigned char *md) {
#ifdef OLD
- int ret;
-
fprintf(stderr, "MD5 final size of EVP_MD: %lu\r\n", sizeof(EVP_MD));
- ret = MD5_Final(md, data(ctx));
+ if (!MD5_Final(md, data(ctx)))
+ goto err;
- if (ret > 0) {
- add_test_data(md, MD5_DIGEST_LENGTH);
- }
- return ret;
+ add_test_data(md, MD5_DIGEST_LENGTH);
+ return 1;
+
+ err:
+ return 0;
#else
fprintf(stderr, "MD5 final\r\n");
add_test_data(md, MD5_DIGEST_LENGTH);