summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-01-19 18:04:31 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2019-01-19 18:05:29 +0100
commitf6c8c42e0464cb1061fa91a44b3cc16e3f138fdf (patch)
treef818a9599041e240b5a9079a70da688da41783dd
parentb527be10f829e286130705dfd14f8bb5661e7f35 (diff)
downloadgnutls-tmp-fix-crypto-selftests.tar.gz
crypto-selftests.c: Fix checking return valuetmp-fix-crypto-selftests
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rw-r--r--lib/crypto-selftests.c6
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 ||