aboutsummaryrefslogtreecommitdiff
path: root/src/gssapi.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/gssapi.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/gssapi.c')
-rw-r--r--src/gssapi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gssapi.c b/src/gssapi.c
index a0ab3646..edcb66d4 100644
--- a/src/gssapi.c
+++ b/src/gssapi.c
@@ -672,12 +672,17 @@ int ssh_gssapi_auth_mic(ssh_session session){
OM_uint32 maj_stat, min_stat;
char name_buf[256];
gss_buffer_desc hostname;
+ const char *gss_host = session->opts.host;
if (ssh_gssapi_init(session) == SSH_ERROR)
return SSH_AUTH_ERROR;
+ if (session->opts.gss_server_identity != NULL) {
+ gss_host = session->opts.gss_server_identity;
+ }
/* import target host name */
- snprintf(name_buf, sizeof(name_buf), "host@%s", session->opts.host);
+ snprintf(name_buf, sizeof(name_buf), "host@%s", gss_host);
+
hostname.value = name_buf;
hostname.length = strlen(name_buf) + 1;
maj_stat = gss_import_name(&min_stat, &hostname,