mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
tests/torture.c: update the definition of torture_setup_tokens() to take load_public as an option that
determines if public keys must be loaded in pkcs #11 tokens or not. tests: Adds the load_public parameter in all files where torture_setup_tokens() was used. Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@ -37,7 +37,7 @@ struct pki_st {
|
||||
enum ssh_keytypes_e type;
|
||||
};
|
||||
|
||||
static int setup_tokens_ecdsa(void **state, int ecdsa_bits, const char *obj_tempname)
|
||||
static int setup_tokens_ecdsa(void **state, int ecdsa_bits, const char *obj_tempname, const char *load_public)
|
||||
{
|
||||
|
||||
struct pki_st *test_state = *state;
|
||||
@ -67,7 +67,7 @@ static int setup_tokens_ecdsa(void **state, int ecdsa_bits, const char *obj_temp
|
||||
torture_get_testkey(test_state->type, 0));
|
||||
torture_write_file(pub_filename,
|
||||
torture_get_testkey_pub_pem(test_state->type));
|
||||
torture_setup_tokens(cwd, priv_filename, obj_tempname);
|
||||
torture_setup_tokens(cwd, priv_filename, obj_tempname, load_public);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -99,9 +99,9 @@ static int setup_directory_structure(void **state)
|
||||
snprintf(conf_path, sizeof(conf_path), "%s/softhsm.conf", test_state->temp_dir);
|
||||
setenv("SOFTHSM2_CONF", conf_path, 1);
|
||||
|
||||
setup_tokens_ecdsa(state, 256, "ecdsa256");
|
||||
setup_tokens_ecdsa(state, 384, "ecdsa384");
|
||||
setup_tokens_ecdsa(state, 521, "ecdsa521");
|
||||
setup_tokens_ecdsa(state, 256, "ecdsa256", "1");
|
||||
setup_tokens_ecdsa(state, 384, "ecdsa384", "1");
|
||||
setup_tokens_ecdsa(state, 521, "ecdsa521", "1");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ static int setup_tokens(void **state)
|
||||
torture_write_file(keys_path_pub,
|
||||
torture_get_testkey_pub_pem(SSH_KEYTYPE_RSA));
|
||||
|
||||
torture_setup_tokens(cwd, keys_path, obj_tempname);
|
||||
torture_setup_tokens(cwd, keys_path, obj_tempname, "1");
|
||||
|
||||
snprintf(conf_path, sizeof(conf_path), "%s/softhsm.conf", cwd);
|
||||
|
||||
|
Reference in New Issue
Block a user