aboutsummaryrefslogtreecommitdiff
path: root/src/gssapi.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-03-04 18:48:39 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-07-13 14:50:56 +0200
commit65eccf19693dd2f6d4525062fdc04720f373af6f (patch)
tree092e145d1daa3623e7a291d4b0b49d4ecff46599 /src/gssapi.c
parentd9443104123614de9c071c748693edaef6ff7b73 (diff)
downloadlibssh-65eccf19693dd2f6d4525062fdc04720f373af6f.tar.gz
libssh-65eccf19693dd2f6d4525062fdc04720f373af6f.tar.xz
libssh-65eccf19693dd2f6d4525062fdc04720f373af6f.zip
gssapi: retrieve forwarded (delegated) tickets
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/gssapi.c')
-rw-r--r--src/gssapi.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gssapi.c b/src/gssapi.c
index 23f2e3ad..64e08ac3 100644
--- a/src/gssapi.c
+++ b/src/gssapi.c
@@ -26,6 +26,7 @@
#include "libssh/crypto.h"
#include "libssh/callbacks.h"
#include "libssh/string.h"
+#include "libssh/server.h"
#include <gssapi.h>
@@ -402,7 +403,19 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_gssapi_mic){
return SSH_PACKET_USED;
}
-#endif
+/** @brief returns the client credentials of the connected client.
+ * If the client has given a forwardable token, the SSH server will
+ * retrieve it.
+ * @returns gssapi credentials handle.
+ * @returns NULL if no forwardable token is available.
+ */
+LIBSSH_API ssh_gssapi_creds ssh_gssapi_get_creds(ssh_session session){
+ if (!session || !session->gssapi || session->gssapi->client_creds == GSS_C_NO_CREDENTIAL)
+ return NULL;
+ return (ssh_gssapi_creds)session->gssapi->client_creds;
+}
+
+#endif /* SERVER */
static int ssh_gssapi_send_auth_mic(ssh_session session, ssh_string *oid_set, int n_oid){
ssh_string str;