Commit a75cc71d authored by David Woodhouse's avatar David Woodhouse

Add openconnect_set_key_password()

For auto-provisioning via NetworkManager it's actually quite useful to be
able to set vpninfo->cert_password and have that special case handled,
instead of having to inject the password into the user's keyring somehow.

It's either that or revise the FSID hack...
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent ae8d3c19
......@@ -99,6 +99,7 @@ OPENCONNECT_5_5 {
openconnect_get_supported_protocols;
openconnect_free_supported_protocols;
openconnect_has_tss2_blob_support;
openconnect_set_key_password;
} OPENCONNECT_5_4;
OPENCONNECT_PRIVATE {
......
......@@ -655,6 +655,13 @@ void openconnect_set_cert_expiry_warning(struct openconnect_info *vpninfo,
vpninfo->cert_expire_warning = seconds;
}
int openconnect_set_key_password(struct openconnect_info *vpninfo, const char *pass)
{
STRDUP(vpninfo->cert_password, pass);
return 0;
}
void openconnect_set_pfs(struct openconnect_info *vpninfo, unsigned val)
{
vpninfo->pfs = val;
......
......@@ -37,6 +37,7 @@ extern "C" {
/*
* API version 5.5:
* - add openconnect_set_key_password()
* - Add openconnect_has_tss2_blob_support()
* - Add openconnect_get_supported_protocols()
* - Add openconnect_free_supported_protocols()
......@@ -513,6 +514,7 @@ int openconnect_set_mobile_info(struct openconnect_info *vpninfo,
const char *mobile_device_uniqueid);
int openconnect_set_client_cert(struct openconnect_info *, const char *cert,
const char *sslkey);
int openconnect_set_key_password(struct openconnect_info *vpninfo, const char *pass);
const char *openconnect_get_ifname(struct openconnect_info *);
void openconnect_set_reqmtu(struct openconnect_info *, int reqmtu);
void openconnect_set_dpd(struct openconnect_info *, int min_seconds);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment