Lines Matching refs:params
40 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 4); in construct_tls1_prf_params() local
41 OSSL_PARAM *p = params; in construct_tls1_prf_params()
43 if (params == NULL) in construct_tls1_prf_params()
56 return params; in construct_tls1_prf_params()
64 OSSL_PARAM *params; in test_kdf_tls1_prf() local
70 params = construct_tls1_prf_params("sha256", "secret", "seed"); in test_kdf_tls1_prf()
72 ret = TEST_ptr(params) in test_kdf_tls1_prf()
74 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_tls1_prf()
78 OPENSSL_free(params); in test_kdf_tls1_prf()
86 OSSL_PARAM *params; in test_kdf_tls1_prf_invalid_digest() local
88 params = construct_tls1_prf_params("blah", "secret", "seed"); in test_kdf_tls1_prf_invalid_digest()
90 ret = TEST_ptr(params) in test_kdf_tls1_prf_invalid_digest()
92 && TEST_false(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_tls1_prf_invalid_digest()
95 OPENSSL_free(params); in test_kdf_tls1_prf_invalid_digest()
104 OSSL_PARAM *params; in test_kdf_tls1_prf_zero_output_size() local
106 params = construct_tls1_prf_params("sha256", "secret", "seed"); in test_kdf_tls1_prf_zero_output_size()
109 ret = TEST_ptr(params) in test_kdf_tls1_prf_zero_output_size()
111 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_tls1_prf_zero_output_size()
115 OPENSSL_free(params); in test_kdf_tls1_prf_zero_output_size()
124 OSSL_PARAM *params; in test_kdf_tls1_prf_empty_secret() local
126 params = construct_tls1_prf_params("sha256", "", "seed"); in test_kdf_tls1_prf_empty_secret()
128 ret = TEST_ptr(params) in test_kdf_tls1_prf_empty_secret()
130 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0); in test_kdf_tls1_prf_empty_secret()
133 OPENSSL_free(params); in test_kdf_tls1_prf_empty_secret()
142 OSSL_PARAM *params; in test_kdf_tls1_prf_1byte_secret() local
144 params = construct_tls1_prf_params("sha256", "1", "seed"); in test_kdf_tls1_prf_1byte_secret()
146 ret = TEST_ptr(params) in test_kdf_tls1_prf_1byte_secret()
148 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0); in test_kdf_tls1_prf_1byte_secret()
151 OPENSSL_free(params); in test_kdf_tls1_prf_1byte_secret()
160 OSSL_PARAM *params; in test_kdf_tls1_prf_empty_seed() local
162 params = construct_tls1_prf_params("sha256", "secret", ""); in test_kdf_tls1_prf_empty_seed()
165 ret = TEST_ptr(params) in test_kdf_tls1_prf_empty_seed()
167 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_tls1_prf_empty_seed()
171 OPENSSL_free(params); in test_kdf_tls1_prf_empty_seed()
180 OSSL_PARAM *params; in test_kdf_tls1_prf_1byte_seed() local
182 params = construct_tls1_prf_params("sha256", "secret", "1"); in test_kdf_tls1_prf_1byte_seed()
184 ret = TEST_ptr(params) in test_kdf_tls1_prf_1byte_seed()
186 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0); in test_kdf_tls1_prf_1byte_seed()
189 OPENSSL_free(params); in test_kdf_tls1_prf_1byte_seed()
196 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 5); in construct_hkdf_params() local
197 OSSL_PARAM *p = params; in construct_hkdf_params()
199 if (params == NULL) in construct_hkdf_params()
217 return params; in construct_hkdf_params()
225 OSSL_PARAM *params; in test_kdf_hkdf() local
230 params = construct_hkdf_params("sha256", "secret", 6, "salt", "label"); in test_kdf_hkdf()
232 ret = TEST_ptr(params) in test_kdf_hkdf()
234 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_hkdf()
238 OPENSSL_free(params); in test_kdf_hkdf()
246 OSSL_PARAM *params; in do_kdf_hkdf_gettables() local
251 if (!TEST_ptr(params = construct_hkdf_params( in do_kdf_hkdf_gettables()
256 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params))) in do_kdf_hkdf_gettables()
283 OPENSSL_free(params); in do_kdf_hkdf_gettables()
306 OSSL_PARAM *params; in test_kdf_hkdf_invalid_digest() local
308 params = construct_hkdf_params("blah", "secret", 6, "salt", "label"); in test_kdf_hkdf_invalid_digest()
310 ret = TEST_ptr(params) in test_kdf_hkdf_invalid_digest()
312 && TEST_false(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_hkdf_invalid_digest()
315 OPENSSL_free(params); in test_kdf_hkdf_invalid_digest()
323 OSSL_PARAM params[2]; in test_kdf_hkdf_derive_set_params_fail() local
332 params[0] = OSSL_PARAM_construct_int(OSSL_KDF_PARAM_DIGEST, &i); in test_kdf_hkdf_derive_set_params_fail()
333 params[1] = OSSL_PARAM_construct_end(); in test_kdf_hkdf_derive_set_params_fail()
334 if (!TEST_int_eq(EVP_KDF_derive(kctx, out, sizeof(out), params), 0)) in test_kdf_hkdf_derive_set_params_fail()
346 OSSL_PARAM params[2]; in test_kdf_hkdf_set_invalid_mode() local
350 params[0] = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_MODE, in test_kdf_hkdf_set_invalid_mode()
352 params[1] = OSSL_PARAM_construct_end(); in test_kdf_hkdf_set_invalid_mode()
353 if (!TEST_int_eq(EVP_KDF_CTX_set_params(kctx, params), 0)) in test_kdf_hkdf_set_invalid_mode()
356 params[0] = OSSL_PARAM_construct_int(OSSL_KDF_PARAM_MODE, &bad_mode); in test_kdf_hkdf_set_invalid_mode()
357 if (!TEST_int_eq(EVP_KDF_CTX_set_params(kctx, params), 0)) in test_kdf_hkdf_set_invalid_mode()
370 OSSL_PARAM params[2]; in do_kdf_hkdf_set_invalid_param() local
377 params[0] = OSSL_PARAM_construct_utf8_string(key, "BAD", 0); in do_kdf_hkdf_set_invalid_param()
379 params[0] = OSSL_PARAM_construct_octet_string(key, buf, sizeof(buf)); in do_kdf_hkdf_set_invalid_param()
380 params[1] = OSSL_PARAM_construct_end(); in do_kdf_hkdf_set_invalid_param()
381 if (!TEST_int_eq(EVP_KDF_CTX_set_params(kctx, params), 0)) in do_kdf_hkdf_set_invalid_param()
407 OSSL_PARAM *params; in test_kdf_hkdf_zero_output_size() local
409 params = construct_hkdf_params("sha256", "secret", 6, "salt", "label"); in test_kdf_hkdf_zero_output_size()
412 ret = TEST_ptr(params) in test_kdf_hkdf_zero_output_size()
414 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_hkdf_zero_output_size()
418 OPENSSL_free(params); in test_kdf_hkdf_zero_output_size()
427 OSSL_PARAM *params; in test_kdf_hkdf_empty_key() local
429 params = construct_hkdf_params("sha256", "", 0, "salt", "label"); in test_kdf_hkdf_empty_key()
431 ret = TEST_ptr(params) in test_kdf_hkdf_empty_key()
433 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0); in test_kdf_hkdf_empty_key()
436 OPENSSL_free(params); in test_kdf_hkdf_empty_key()
445 OSSL_PARAM *params; in test_kdf_hkdf_1byte_key() local
447 params = construct_hkdf_params("sha256", "1", 1, "salt", "label"); in test_kdf_hkdf_1byte_key()
449 ret = TEST_ptr(params) in test_kdf_hkdf_1byte_key()
451 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0); in test_kdf_hkdf_1byte_key()
454 OPENSSL_free(params); in test_kdf_hkdf_1byte_key()
463 OSSL_PARAM *params; in test_kdf_hkdf_empty_salt() local
465 params = construct_hkdf_params("sha256", "secret", 6, "", "label"); in test_kdf_hkdf_empty_salt()
467 ret = TEST_ptr(params) in test_kdf_hkdf_empty_salt()
469 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0); in test_kdf_hkdf_empty_salt()
472 OPENSSL_free(params); in test_kdf_hkdf_empty_salt()
479 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 5); in construct_pbkdf1_params() local
480 OSSL_PARAM *p = params; in construct_pbkdf1_params()
482 if (params == NULL) in construct_pbkdf1_params()
494 return params; in construct_pbkdf1_params()
504 OSSL_PARAM *params = NULL; in test_kdf_pbkdf1() local
526 params = construct_pbkdf1_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf1()
530 if (!TEST_ptr(params) in test_kdf_pbkdf1()
532 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf1()
540 OPENSSL_free(params); in test_kdf_pbkdf1()
554 OSSL_PARAM *params = NULL; in test_kdf_pbkdf1_key_too_long() local
571 params = construct_pbkdf1_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf1_key_too_long()
580 if (!TEST_ptr(params) in test_kdf_pbkdf1_key_too_long()
582 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf1_key_too_long()
589 OPENSSL_free(params); in test_kdf_pbkdf1_key_too_long()
599 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 6); in construct_pbkdf2_params() local
600 OSSL_PARAM *p = params; in construct_pbkdf2_params()
602 if (params == NULL) in construct_pbkdf2_params()
615 return params; in construct_pbkdf2_params()
625 OSSL_PARAM *params; in test_kdf_pbkdf2() local
633 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2()
637 if (!TEST_ptr(params) in test_kdf_pbkdf2()
639 || !TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_pbkdf2()
646 OPENSSL_free(params); in test_kdf_pbkdf2()
657 OSSL_PARAM *params; in test_kdf_pbkdf2_small_output() local
659 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_output()
663 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_output()
665 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_small_output()
673 OPENSSL_free(params); in test_kdf_pbkdf2_small_output()
685 OSSL_PARAM *params; in test_kdf_pbkdf2_large_output() local
690 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_large_output()
694 if (!TEST_ptr(params) in test_kdf_pbkdf2_large_output()
697 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_large_output()
704 OPENSSL_free(params); in test_kdf_pbkdf2_large_output()
714 OSSL_PARAM *params; in test_kdf_pbkdf2_small_salt() local
716 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_salt()
720 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_salt()
723 || !TEST_false(EVP_KDF_CTX_set_params(kctx, params))) in test_kdf_pbkdf2_small_salt()
729 OPENSSL_free(params); in test_kdf_pbkdf2_small_salt()
739 OSSL_PARAM *params; in test_kdf_pbkdf2_small_iterations() local
741 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_iterations()
745 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_iterations()
748 || !TEST_false(EVP_KDF_CTX_set_params(kctx, params))) in test_kdf_pbkdf2_small_iterations()
754 OPENSSL_free(params); in test_kdf_pbkdf2_small_iterations()
765 OSSL_PARAM *params; in test_kdf_pbkdf2_small_salt_pkcs5() local
768 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_salt_pkcs5()
772 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_salt_pkcs5()
775 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_small_salt_pkcs5()
791 OPENSSL_free(params); in test_kdf_pbkdf2_small_salt_pkcs5()
802 OSSL_PARAM *params; in test_kdf_pbkdf2_small_iterations_pkcs5() local
805 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_iterations_pkcs5()
809 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_iterations_pkcs5()
812 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_small_iterations_pkcs5()
828 OPENSSL_free(params); in test_kdf_pbkdf2_small_iterations_pkcs5()
838 OSSL_PARAM *params; in test_kdf_pbkdf2_invalid_digest() local
840 params = construct_pbkdf2_params("passwordPASSWORDpassword", "blah", in test_kdf_pbkdf2_invalid_digest()
844 if (!TEST_ptr(params) in test_kdf_pbkdf2_invalid_digest()
847 || !TEST_false(EVP_KDF_CTX_set_params(kctx, params))) in test_kdf_pbkdf2_invalid_digest()
853 OPENSSL_free(params); in test_kdf_pbkdf2_invalid_digest()
862 OSSL_PARAM params[7], *p = params; in test_kdf_scrypt() local
889 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_scrypt()
911 OSSL_PARAM params[4], *p = params; in test_kdf_ss_hash() local
938 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_ss_hash()
949 OSSL_PARAM params[4], *p = params; in test_kdf_x963() local
991 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_x963()
1007 OSSL_PARAM params[7]; in test_kdf_kbkdf_6803_128() local
1030 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_128()
1032 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_128()
1034 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_128()
1036 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_128()
1038 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_128()
1040 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_128()
1042 params[p] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_6803_128()
1047 params), 0) in test_kdf_kbkdf_6803_128()
1062 OSSL_PARAM params[7]; in test_kdf_kbkdf_6803_256() local
1096 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_256()
1098 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_256()
1100 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_256()
1102 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_256()
1104 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_256()
1106 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_256()
1108 params[p] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_6803_256()
1113 params), 0) in test_kdf_kbkdf_6803_256()
1128 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 7); in construct_kbkdf_params() local
1129 OSSL_PARAM *p = params; in construct_kbkdf_params()
1131 if (params == NULL) in construct_kbkdf_params()
1148 return params; in construct_kbkdf_params()
1155 OSSL_PARAM *params; in test_kdf_kbkdf_invalid_digest() local
1159 params = construct_kbkdf_params("blah", "HMAC", key, 1, "prf", "test"); in test_kdf_kbkdf_invalid_digest()
1160 if (!TEST_ptr(params)) in test_kdf_kbkdf_invalid_digest()
1166 && TEST_false(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_kbkdf_invalid_digest()
1169 OPENSSL_free(params); in test_kdf_kbkdf_invalid_digest()
1177 OSSL_PARAM *params; in test_kdf_kbkdf_invalid_mac() local
1181 params = construct_kbkdf_params("sha256", "blah", key, 1, "prf", "test"); in test_kdf_kbkdf_invalid_mac()
1182 if (!TEST_ptr(params)) in test_kdf_kbkdf_invalid_mac()
1188 && TEST_false(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_kbkdf_invalid_mac()
1191 OPENSSL_free(params); in test_kdf_kbkdf_invalid_mac()
1199 OSSL_PARAM *params; in test_kdf_kbkdf_empty_key() local
1204 params = construct_kbkdf_params("sha256", "HMAC", key, 0, "prf", "test"); in test_kdf_kbkdf_empty_key()
1205 if (!TEST_ptr(params)) in test_kdf_kbkdf_empty_key()
1211 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_kbkdf_empty_key()
1215 OPENSSL_free(params); in test_kdf_kbkdf_empty_key()
1223 OSSL_PARAM *params; in test_kdf_kbkdf_1byte_key() local
1228 params = construct_kbkdf_params("sha256", "HMAC", key, 1, "prf", "test"); in test_kdf_kbkdf_1byte_key()
1229 if (!TEST_ptr(params)) in test_kdf_kbkdf_1byte_key()
1234 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0); in test_kdf_kbkdf_1byte_key()
1237 OPENSSL_free(params); in test_kdf_kbkdf_1byte_key()
1245 OSSL_PARAM *params; in test_kdf_kbkdf_zero_output_size() local
1250 params = construct_kbkdf_params("sha256", "HMAC", key, 1, "prf", "test"); in test_kdf_kbkdf_zero_output_size()
1251 if (!TEST_ptr(params)) in test_kdf_kbkdf_zero_output_size()
1257 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_kbkdf_zero_output_size()
1261 OPENSSL_free(params); in test_kdf_kbkdf_zero_output_size()
1271 OSSL_PARAM params[6]; in test_kdf_kbkdf_8009_prf1() local
1286 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf1()
1288 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf1()
1290 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf1()
1292 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf1()
1294 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf1()
1296 params[i] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_8009_prf1()
1300 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0) in test_kdf_kbkdf_8009_prf1()
1311 OSSL_PARAM params[6]; in test_kdf_kbkdf_8009_prf2() local
1330 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf2()
1332 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf2()
1334 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf2()
1336 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf2()
1338 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf2()
1340 params[i] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_8009_prf2()
1344 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0) in test_kdf_kbkdf_8009_prf2()
1362 OSSL_PARAM params[8], *p = params; in test_kdf_kbkdf_fixedinfo() local
1404 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0) in test_kdf_kbkdf_fixedinfo()
1416 OSSL_PARAM params[6], *p = params; in test_kdf_ss_hmac() local
1446 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_ss_hmac()
1457 OSSL_PARAM params[7], *p = params; in test_kdf_ss_kmac() local
1494 && TEST_int_eq(EVP_KDF_CTX_set_params(kctx, params), 1) in test_kdf_ss_kmac()
1509 OSSL_PARAM params[6], *p = params; in test_kdf_sshkdf() local
1555 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_sshkdf()
1618 OSSL_PARAM params[4], *p = params; in test_kdf_x942_asn1() local
1642 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_x942_asn1()
1654 OSSL_PARAM params[4], *p = params; in test_kdf_krb5kdf() local
1678 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_krb5kdf()