summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clispnego.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-10-18 10:26:06 +0000
committerAndrew Tridgell <tridge@samba.org>2001-10-18 10:26:06 +0000
commit353c290f059347265b9be2aa1010c2956da06485 (patch)
tree47a4d21728e0e69cdaf88248d9317d4c7db02754 /source/libsmb/clispnego.c
parent7c3542ba8764be48b88255dd7f73ea6d87be10ac (diff)
downloadsamba-353c290f059347265b9be2aa1010c2956da06485.tar.gz
samba-353c290f059347265b9be2aa1010c2956da06485.tar.xz
samba-353c290f059347265b9be2aa1010c2956da06485.zip
the beginnings of kerberos support in smbd. It doesn't work yet, but
it should give something for others to hack on and possibly find what I'm doing wrong.
Diffstat (limited to 'source/libsmb/clispnego.c')
-rw-r--r--source/libsmb/clispnego.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/libsmb/clispnego.c b/source/libsmb/clispnego.c
index 78cae3315a8..c421d759134 100644
--- a/source/libsmb/clispnego.c
+++ b/source/libsmb/clispnego.c
@@ -241,6 +241,29 @@ static DATA_BLOB spnego_gen_krb5_wrap(DATA_BLOB ticket)
return ret;
}
+/*
+ parse a krb5 GSS-API wrapper packet giving a ticket
+*/
+BOOL spnego_parse_krb5_wrap(DATA_BLOB blob, DATA_BLOB *ticket)
+{
+ BOOL ret;
+ ASN1_DATA data;
+
+ asn1_load(&data, blob);
+ asn1_start_tag(&data, ASN1_APPLICATION(0));
+ asn1_check_OID(&data, OID_KERBEROS5);
+ asn1_check_BOOLEAN(&data, 0);
+ *ticket = data_blob(data.data, asn1_tag_remaining(&data));
+ asn1_read(&data, ticket->data, ticket->length);
+ asn1_end_tag(&data);
+
+ ret = !data.has_error;
+
+ asn1_free(&data);
+
+ return ret;
+}
+
/*
generate a SPNEGO negTokenTarg packet, ready for a EXTENDED_SECURITY