From 982cde1a7756da6d5306f10b0a7c9e4ad3d32bbf Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 29 Jul 2017 21:34:28 +0200 Subject: [PATCH] Test crypto_box_open_detached() with a weak PK --- test/default/box_easy2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/default/box_easy2.c b/test/default/box_easy2.c index 81e43387..05cb099f 100644 --- a/test/default/box_easy2.c +++ b/test/default/box_easy2.c @@ -113,6 +113,10 @@ main(void) ret = crypto_box_detached(c, mac, m, (unsigned long long) mlen, nonce, alicepk, bobsk); assert(ret == 0); + if (crypto_box_open_detached(m2, c, mac, (unsigned long long) mlen, nonce, + small_order_p, alicesk) != -1) { + printf("crypto_box_open_detached() with a weak key passed\n"); + } if (crypto_box_open_detached(m2, c, mac, (unsigned long long) mlen, nonce, bobpk, alicesk) != 0) { printf("crypto_box_open_detached() failed\n");