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()
550 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 6); in construct_pbkdf2_params() local
551 OSSL_PARAM *p = params; in construct_pbkdf2_params()
553 if (params == NULL) in construct_pbkdf2_params()
566 return params; in construct_pbkdf2_params()
576 OSSL_PARAM *params; in test_kdf_pbkdf2() local
584 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2()
588 if (!TEST_ptr(params) in test_kdf_pbkdf2()
590 || !TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_pbkdf2()
597 OPENSSL_free(params); in test_kdf_pbkdf2()
608 OSSL_PARAM *params; in test_kdf_pbkdf2_small_output() local
610 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_output()
614 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_output()
616 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_small_output()
624 OPENSSL_free(params); in test_kdf_pbkdf2_small_output()
636 OSSL_PARAM *params; in test_kdf_pbkdf2_large_output() local
641 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_large_output()
645 if (!TEST_ptr(params) in test_kdf_pbkdf2_large_output()
648 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_large_output()
655 OPENSSL_free(params); in test_kdf_pbkdf2_large_output()
665 OSSL_PARAM *params; in test_kdf_pbkdf2_small_salt() local
667 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_salt()
671 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_salt()
674 || !TEST_false(EVP_KDF_CTX_set_params(kctx, params))) in test_kdf_pbkdf2_small_salt()
680 OPENSSL_free(params); in test_kdf_pbkdf2_small_salt()
690 OSSL_PARAM *params; in test_kdf_pbkdf2_small_iterations() local
692 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_iterations()
696 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_iterations()
699 || !TEST_false(EVP_KDF_CTX_set_params(kctx, params))) in test_kdf_pbkdf2_small_iterations()
705 OPENSSL_free(params); in test_kdf_pbkdf2_small_iterations()
716 OSSL_PARAM *params; in test_kdf_pbkdf2_small_salt_pkcs5() local
719 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_salt_pkcs5()
723 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_salt_pkcs5()
726 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_small_salt_pkcs5()
742 OPENSSL_free(params); in test_kdf_pbkdf2_small_salt_pkcs5()
753 OSSL_PARAM *params; in test_kdf_pbkdf2_small_iterations_pkcs5() local
756 params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", in test_kdf_pbkdf2_small_iterations_pkcs5()
760 if (!TEST_ptr(params) in test_kdf_pbkdf2_small_iterations_pkcs5()
763 || !TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_pbkdf2_small_iterations_pkcs5()
779 OPENSSL_free(params); in test_kdf_pbkdf2_small_iterations_pkcs5()
789 OSSL_PARAM *params; in test_kdf_pbkdf2_invalid_digest() local
791 params = construct_pbkdf2_params("passwordPASSWORDpassword", "blah", in test_kdf_pbkdf2_invalid_digest()
795 if (!TEST_ptr(params) in test_kdf_pbkdf2_invalid_digest()
798 || !TEST_false(EVP_KDF_CTX_set_params(kctx, params))) in test_kdf_pbkdf2_invalid_digest()
804 OPENSSL_free(params); in test_kdf_pbkdf2_invalid_digest()
813 OSSL_PARAM params[7], *p = params; in test_kdf_scrypt() local
839 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_scrypt()
856 OSSL_PARAM params[4], *p = params; in test_kdf_ss_hash() local
883 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_ss_hash()
894 OSSL_PARAM params[4], *p = params; in test_kdf_x963() local
936 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_x963()
952 OSSL_PARAM params[7]; in test_kdf_kbkdf_6803_128() local
975 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_128()
977 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_128()
979 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_128()
981 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_128()
983 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_128()
985 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_128()
987 params[p] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_6803_128()
992 params), 0) in test_kdf_kbkdf_6803_128()
1007 OSSL_PARAM params[7]; in test_kdf_kbkdf_6803_256() local
1041 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_256()
1043 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_256()
1045 params[p++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_6803_256()
1047 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_256()
1049 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_256()
1051 params[p++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_6803_256()
1053 params[p] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_6803_256()
1058 params), 0) in test_kdf_kbkdf_6803_256()
1073 OSSL_PARAM *params = OPENSSL_malloc(sizeof(OSSL_PARAM) * 7); in construct_kbkdf_params() local
1074 OSSL_PARAM *p = params; in construct_kbkdf_params()
1076 if (params == NULL) in construct_kbkdf_params()
1093 return params; in construct_kbkdf_params()
1100 OSSL_PARAM *params; in test_kdf_kbkdf_invalid_digest() local
1104 params = construct_kbkdf_params("blah", "HMAC", key, 1, "prf", "test"); in test_kdf_kbkdf_invalid_digest()
1105 if (!TEST_ptr(params)) in test_kdf_kbkdf_invalid_digest()
1111 && TEST_false(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_kbkdf_invalid_digest()
1114 OPENSSL_free(params); in test_kdf_kbkdf_invalid_digest()
1122 OSSL_PARAM *params; in test_kdf_kbkdf_invalid_mac() local
1126 params = construct_kbkdf_params("sha256", "blah", key, 1, "prf", "test"); in test_kdf_kbkdf_invalid_mac()
1127 if (!TEST_ptr(params)) in test_kdf_kbkdf_invalid_mac()
1133 && TEST_false(EVP_KDF_CTX_set_params(kctx, params)); in test_kdf_kbkdf_invalid_mac()
1136 OPENSSL_free(params); in test_kdf_kbkdf_invalid_mac()
1144 OSSL_PARAM *params; in test_kdf_kbkdf_empty_key() local
1149 params = construct_kbkdf_params("sha256", "HMAC", key, 0, "prf", "test"); in test_kdf_kbkdf_empty_key()
1150 if (!TEST_ptr(params)) in test_kdf_kbkdf_empty_key()
1156 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_kbkdf_empty_key()
1160 OPENSSL_free(params); in test_kdf_kbkdf_empty_key()
1168 OSSL_PARAM *params; in test_kdf_kbkdf_1byte_key() local
1173 params = construct_kbkdf_params("sha256", "HMAC", key, 1, "prf", "test"); in test_kdf_kbkdf_1byte_key()
1174 if (!TEST_ptr(params)) in test_kdf_kbkdf_1byte_key()
1179 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0); in test_kdf_kbkdf_1byte_key()
1182 OPENSSL_free(params); in test_kdf_kbkdf_1byte_key()
1190 OSSL_PARAM *params; in test_kdf_kbkdf_zero_output_size() local
1195 params = construct_kbkdf_params("sha256", "HMAC", key, 1, "prf", "test"); in test_kdf_kbkdf_zero_output_size()
1196 if (!TEST_ptr(params)) in test_kdf_kbkdf_zero_output_size()
1202 && TEST_true(EVP_KDF_CTX_set_params(kctx, params)) in test_kdf_kbkdf_zero_output_size()
1206 OPENSSL_free(params); in test_kdf_kbkdf_zero_output_size()
1216 OSSL_PARAM params[6]; in test_kdf_kbkdf_8009_prf1() local
1231 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf1()
1233 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf1()
1235 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf1()
1237 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf1()
1239 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf1()
1241 params[i] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_8009_prf1()
1245 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0) in test_kdf_kbkdf_8009_prf1()
1256 OSSL_PARAM params[6]; in test_kdf_kbkdf_8009_prf2() local
1275 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf2()
1277 params[i++] = OSSL_PARAM_construct_utf8_string( in test_kdf_kbkdf_8009_prf2()
1279 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf2()
1281 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf2()
1283 params[i++] = OSSL_PARAM_construct_octet_string( in test_kdf_kbkdf_8009_prf2()
1285 params[i] = OSSL_PARAM_construct_end(); in test_kdf_kbkdf_8009_prf2()
1289 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0) in test_kdf_kbkdf_8009_prf2()
1307 OSSL_PARAM params[8], *p = params; in test_kdf_kbkdf_fixedinfo() local
1349 && TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result), params), 0) in test_kdf_kbkdf_fixedinfo()
1361 OSSL_PARAM params[6], *p = params; in test_kdf_ss_hmac() local
1391 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_ss_hmac()
1402 OSSL_PARAM params[6], *p = params; in test_kdf_ss_kmac() local
1435 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_ss_kmac()
1446 OSSL_PARAM params[6], *p = params; in test_kdf_sshkdf() local
1492 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_sshkdf()
1555 OSSL_PARAM params[4], *p = params; in test_kdf_x942_asn1() local
1579 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_x942_asn1()
1591 OSSL_PARAM params[4], *p = params; in test_kdf_krb5kdf() local
1615 && TEST_int_gt(EVP_KDF_derive(kctx, out, sizeof(out), params), 0) in test_kdf_krb5kdf()