aboutsummaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-11-15 15:36:02 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-11-15 15:50:09 +0100
commit41d99d32e8cadb790bb4c594074b52fa13f40df6 (patch)
tree330a871bf62013f088008967e3d6f706a1c14924 /src/options.c
parentc481f9dafdc7dc5c2eb105493f05846cf7425cec (diff)
downloadlibssh-41d99d32e8cadb790bb4c594074b52fa13f40df6.tar.gz
libssh-41d99d32e8cadb790bb4c594074b52fa13f40df6.tar.xz
libssh-41d99d32e8cadb790bb4c594074b52fa13f40df6.zip
gssapi: Add suppport to set GSSAPI server identity.
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index e02ad4df..d43e25d4 100644
--- a/src/options.c
+++ b/src/options.c
@@ -367,6 +367,10 @@ int ssh_options_set_algo(ssh_session session, int algo,
* Set the command to be executed in order to connect to
* server (const char *).
*
+ * - SSH_OPTIONS_GSSAPI_SERVER_IDENTITY
+ * Set it to specify the GSSAPI server identity that libssh
+ * should expect when connecting to the server (const char *).
+ *
* @param value The value to set. This is a generic pointer and the
* datatype which is used should be set according to the
* type set.
@@ -792,6 +796,20 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
}
}
break;
+ case SSH_OPTIONS_GSSAPI_SERVER_IDENTITY:
+ v = value;
+ if (v == NULL || v[0] == '\0') {
+ ssh_set_error_invalid(session);
+ return -1;
+ } else {
+ SAFE_FREE(session->opts.gss_server_identity);
+ session->opts.gss_server_identity = strdup(v);
+ if (session->opts.gss_server_identity == NULL) {
+ ssh_set_error_oom(session);
+ return -1;
+ }
+ }
+ break;
default:
ssh_set_error(session, SSH_REQUEST_DENIED, "Unknown ssh option %d", type);
return -1;