diff --git a/test/default/pwhash.c b/test/default/pwhash.c index 74bcb5b2..b5006d65 100644 --- a/test/default/pwhash.c +++ b/test/default/pwhash.c @@ -204,11 +204,41 @@ static void tv3(void) { "Y0!?iQa9M%5ekffW(`", "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A6....1....$TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$.6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A.....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A6.........TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i44269$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AH" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx54269" }, + { "Y0!?iQa9M%5ekffW(`", + "$7^A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$!6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A!....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, + { "Y0!?iQa9M%5ekffW(`", + "$7$A6....!....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" + "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, { "", "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, { "Y0!?iQa9M%5ekffW(`", - "$7fA6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4" + "$7fA6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4#" "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" }, { "Y0!?iQa9M%5ekffW(`", "$7$AX....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" @@ -226,13 +256,21 @@ static void tv3(void) "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" "" }, }; + char *out; + char *passwd; size_t i = 0U; do { + out = sodium_malloc(strlen(tests[i].out) + 1U); + memcpy(out, tests[i].out, strlen(tests[i].out) + 1U); + passwd = sodium_malloc(strlen(tests[i].passwd) + 1U); + memcpy(passwd, tests[i].passwd, strlen(tests[i].passwd) + 1U); if (crypto_pwhash_scryptsalsa208sha256_str_verify( - tests[i].out, tests[i].passwd, strlen(tests[i].passwd)) != 0) { + out, passwd, strlen(passwd)) != 0) { printf("pwhash_str failure: [%u]\n", (unsigned int)i); } + sodium_free(out); + sodium_free(passwd); } while (++i < (sizeof tests) / (sizeof tests[0])); } diff --git a/test/default/pwhash.exp b/test/default/pwhash.exp index 7a38fa41..5c58d530 100644 --- a/test/default/pwhash.exp +++ b/test/default/pwhash.exp @@ -18,4 +18,14 @@ pwhash_str failure: [14] pwhash_str failure: [15] pwhash_str failure: [16] pwhash_str failure: [17] +pwhash_str failure: [18] +pwhash_str failure: [19] +pwhash_str failure: [20] +pwhash_str failure: [21] +pwhash_str failure: [22] +pwhash_str failure: [23] +pwhash_str failure: [24] +pwhash_str failure: [25] +pwhash_str failure: [26] +pwhash_str failure: [27] OK