From debed383140257f9e4b223c20e59b7c5318791b7 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 1 Nov 2015 14:45:35 +0100 Subject: [PATCH] Check a return value in the secretbox_easy2 test --- test/default/secretbox_easy2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/default/secretbox_easy2.c b/test/default/secretbox_easy2.c index 6d3821b1..26e0193d 100644 --- a/test/default/secretbox_easy2.c +++ b/test/default/secretbox_easy2.c @@ -19,9 +19,11 @@ int main(void) randombytes_buf(m, (unsigned long long) mlen); randombytes_buf(nonce, sizeof nonce); crypto_secretbox_easy(c, m, (unsigned long long) mlen, nonce, k); - crypto_secretbox_open_easy(m2, c, - (unsigned long long) mlen + crypto_secretbox_MACBYTES, - nonce, k); + if (crypto_secretbox_open_easy(m2, c, + (unsigned long long) mlen + crypto_secretbox_MACBYTES, + nonce, k) != 0) { + printf("crypto_secretbox_open_easy() failed\n"); + } printf("%d\n", memcmp(m, m2, mlen)); for (i = 0; i < mlen + crypto_secretbox_MACBYTES - 1; i++) {