From 9df008a786e8d70aa482eeae4531a1c3d082c985 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 17 Jul 2017 23:26:22 +0200 Subject: [PATCH] Add some invalid base64 strings to pwhash_str_verify() tests --- test/default/pwhash.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/default/pwhash.c b/test/default/pwhash.c index 8531cbf4..2a6fef79 100644 --- a/test/default/pwhash.c +++ b/test/default/pwhash.c @@ -337,6 +337,18 @@ main(void) "password", strlen("password")) != -1 || errno != EINVAL) { printf("pwhash_str_verify(invalid(9)) failure\n"); } + if (crypto_pwhash_str_verify( + "$argon2i$v=1$m=4096,t=3,p=2$b2RpZHVla~=mRpc29kaXNrdw" + "$TNnWIwlu1061JHrnCqIAmjs3huSxYIU+0jWipu7Kc9M", + "password", strlen("password")) != -1 || errno != EINVAL) { + printf("pwhash_str_verify(invalid(10)) failure\n"); + } + if (crypto_pwhash_str_verify( + "$argon2i$v=1$m=4096,t=3,p=2$b2RpZHVlamRpc29kaXNrdw" + "$TNnWIwlu1061JHrnCqIAmjs3huSxYI~=U+0jWipu7Kc9M", + "password", strlen("password")) != -1 || errno != EINVAL) { + printf("pwhash_str_verify(invalid(11)) failure\n"); + } assert(crypto_pwhash_bytes_min() > 0U); assert(crypto_pwhash_bytes_max() > crypto_pwhash_bytes_min()); assert(crypto_pwhash_passwd_max() > crypto_pwhash_passwd_min());