summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMilan Broz <gmazyland@gmail.com>2022-08-18 16:18:42 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-08-18 19:41:10 +0300
commita20700c55f0eb8dbb8368b756a571c116163a0bc (patch)
tree9a5b82e0e0506f31712365614e1bf6e25eadfda0 /tests
parent8a1f50e66364389b8a867801ead8327a663b0c03 (diff)
downloadlibgcrypt-a20700c55f0eb8dbb8368b756a571c116163a0bc.tar.gz
kdf: Allow empty password for Argon2
* cipher/kdf.c (_gcry_kdf_open) allow empty password for Argon2. -- This patch fixes libcryptsetup requirement to support empty passwords for PBKDF (and passes Argon2 test vectors there now). Signed-off-by: Milan Broz <gmazyland@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/t-kdf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/t-kdf.c b/tests/t-kdf.c
index 17402762..c0192d7b 100644
--- a/tests/t-kdf.c
+++ b/tests/t-kdf.c
@@ -1471,6 +1471,32 @@ check_argon2 (void)
"\x0d\x64\x0d\xf5\x8d\x78\x76\x6c\x08\xc0\x37\xa3\x4a\x8b\x53\xc9"
"\xd0\x1e\xf0\x45\x2d\x75\xb6\x5e\xb5\x25\x20\xe9\x6b\x01\xe6\x59"
},
+ {
+ /* empty password */
+ GCRY_KDF_ARGON2I,
+ { 32, 3, 128, 1 },
+ 0, NULL,
+ 16,
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ 0, NULL,
+ 0, NULL,
+ 32,
+ "\xbb\x1f\xf2\xb9\x9f\xd4\x4a\xd9\xdf\x7f\xb9\x54\x55\x9e\xb8\xeb"
+ "\xb5\x9d\xab\xce\x2e\x62\x9f\x9b\x89\x09\xfe\xde\x57\xcc\x63\x86"
+ },
+ {
+ /* empty password */
+ GCRY_KDF_ARGON2ID,
+ { 32, 3, 128, 1 },
+ 0, NULL,
+ 16,
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ 0, NULL,
+ 0, NULL,
+ 32,
+ "\x09\x2f\x38\x35\xac\xb2\x43\x92\x93\xeb\xcd\xe8\x04\x16\x6a\x31"
+ "\xce\x14\xd4\x55\xdb\xd8\xf7\xe6\xb4\xf5\x9d\x64\x8e\xd0\x3a\xdb"
+ },
};
unsigned char out[32];
int i;