diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-01-19 19:46:42 +0000 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-01-19 19:46:42 +0000 |
commit | dfc3780b3efa0ff99daecd7d43078a45050e818b (patch) | |
tree | f425c16ece9d24ffb337d9072105825738172249 | |
parent | bc632172e86863128d64cb7ff6f331934fe09213 (diff) | |
parent | f6c8c42e0464cb1061fa91a44b3cc16e3f138fdf (diff) | |
download | gnutls-dfc3780b3efa0ff99daecd7d43078a45050e818b.tar.gz |
Merge branch 'tmp-fix-crypto-selftests' into 'master'
crypto-selftests.c: Fix checking return value
See merge request gnutls/gnutls!880
-rw-r--r-- | lib/crypto-selftests.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/crypto-selftests.c b/lib/crypto-selftests.c index 3d24c3aede..c2ad7d72fb 100644 --- a/lib/crypto-selftests.c +++ b/lib/crypto-selftests.c @@ -579,7 +579,7 @@ static int test_cipher(gnutls_cipher_algorithm_t cipher, ret = gnutls_cipher_decrypt2(hd, - vectors[i].ciphertext, + vectors[i].ciphertext, vectors[i].plaintext_size, tmp, sizeof(tmp)); if (ret < 0) { @@ -1293,7 +1293,7 @@ static int test_digest(gnutls_digest_algorithm_t dig, gnutls_hash_deinit(hd, data); data_size = gnutls_hash_get_len(dig); - if (ret < 0) + if (data_size <= 0) return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); if (data_size != vectors[i].output_size || @@ -1482,7 +1482,7 @@ static int test_mac(gnutls_mac_algorithm_t mac, gnutls_hmac_deinit(hd, data); data_size = gnutls_hmac_get_len(mac); - if (ret < 0) + if (data_size <= 0) return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); if (data_size != vectors[i].output_size || |