Further fix the zero return codes for bad kem ops

This commit is contained in:
Thom Wiggers 2019-01-29 17:32:30 +01:00
parent 66d5284e43
commit c2747e6860
No known key found for this signature in database
GPG Key ID: 001BB0A7CE26E363

View File

@ -101,8 +101,8 @@ static int test_invalid_sk_a(void) {
randombytes(sk_a, CRYPTO_SECRETKEYBYTES); randombytes(sk_a, CRYPTO_SECRETKEYBYTES);
// Alice uses Bobs response to get her secret key // Alice uses Bobs response to get her secret key
if ((returncode = crypto_kem_dec(key_a, sendb, sk_a)) > -1) { if ((returncode = crypto_kem_dec(key_a, sendb, sk_a)) > 0) {
printf("ERROR failing crypto_kem_dec returned %d instead of negative code\n", returncode); printf("ERROR failing crypto_kem_dec returned %d instead of negative or zero code\n", returncode);
return -1; return -1;
} }