mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 18:50:27 +09:00
feat(pki): add ssh_pki_ctx to ssh_session
The session struct now contains an ssh_pki_ctx struct as its member to allow for passing user configured pki options across many functions. The ssh_options_set API has been extended to allow users to set this member. Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
@@ -108,6 +108,12 @@ ssh_session ssh_new(void)
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Initialise a default PKI context */
|
||||
session->pki_context = ssh_pki_ctx_new();
|
||||
if (session->pki_context == NULL) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* OPTIONS */
|
||||
session->opts.StrictHostKeyChecking = 1;
|
||||
session->opts.port = 22;
|
||||
@@ -266,6 +272,8 @@ void ssh_free(ssh_session session)
|
||||
|
||||
ssh_agent_free(session->agent);
|
||||
|
||||
SSH_PKI_CTX_FREE(session->pki_context);
|
||||
|
||||
ssh_key_free(session->srv.rsa_key);
|
||||
session->srv.rsa_key = NULL;
|
||||
ssh_key_free(session->srv.ecdsa_key);
|
||||
|
||||
Reference in New Issue
Block a user