mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
options: Add SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS option.
Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -333,7 +333,8 @@ enum ssh_options_e {
|
|||||||
SSH_OPTIONS_KEY_EXCHANGE,
|
SSH_OPTIONS_KEY_EXCHANGE,
|
||||||
SSH_OPTIONS_HOSTKEYS,
|
SSH_OPTIONS_HOSTKEYS,
|
||||||
SSH_OPTIONS_GSSAPI_SERVER_IDENTITY,
|
SSH_OPTIONS_GSSAPI_SERVER_IDENTITY,
|
||||||
SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY
|
SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY,
|
||||||
|
SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ struct ssh_session_struct {
|
|||||||
char compressionlevel;
|
char compressionlevel;
|
||||||
char *gss_server_identity;
|
char *gss_server_identity;
|
||||||
char *gss_client_identity;
|
char *gss_client_identity;
|
||||||
|
int gss_delegate_creds;
|
||||||
} opts;
|
} opts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -375,6 +375,10 @@ int ssh_options_set_algo(ssh_session session, int algo,
|
|||||||
* Set it to specify the GSSAPI client identity that libssh
|
* Set it to specify the GSSAPI client identity that libssh
|
||||||
* should expect when connecting to the server (const char *).
|
* should expect when connecting to the server (const char *).
|
||||||
*
|
*
|
||||||
|
* - SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS
|
||||||
|
* Set it to specify that GSSAPI should delegate credentials
|
||||||
|
* to the server (int, 0 = false).
|
||||||
|
*
|
||||||
* @param value The value to set. This is a generic pointer and the
|
* @param value The value to set. This is a generic pointer and the
|
||||||
* datatype which is used should be set according to the
|
* datatype which is used should be set according to the
|
||||||
* type set.
|
* type set.
|
||||||
@@ -828,6 +832,17 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS:
|
||||||
|
if (value == NULL) {
|
||||||
|
ssh_set_error_invalid(session);
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
int x = *(int *)value;
|
||||||
|
|
||||||
|
session->opts.gss_delegate_creds = (x & 0xff);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ssh_set_error(session, SSH_REQUEST_DENIED, "Unknown ssh option %d", type);
|
ssh_set_error(session, SSH_REQUEST_DENIED, "Unknown ssh option %d", type);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user