summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-07-20 11:04:19 -0700
committerJeremy Allison <jra@samba.org>2010-07-20 11:04:19 -0700
commit8a882b645c7913a12776065d239cd97d0628108c (patch)
tree635430e8f01345460594bfc472d730924ca7cd38 /source3/libsmb
parent668744964db9210d7b106dcaa27ea1152bd635cd (diff)
downloadsamba-8a882b645c7913a12776065d239cd97d0628108c.tar.gz
samba-8a882b645c7913a12776065d239cd97d0628108c.tar.bz2
samba-8a882b645c7913a12776065d239cd97d0628108c.zip
Remove gen_negTokenTarg(), as it's not actually creating a TokenTarg frame, but a TokenInit one.
Move to using spnego_gen_negTokenInit() instead. Jeremy
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifsinfo.c2
-rw-r--r--source3/libsmb/clispnego.c48
2 files changed, 2 insertions, 48 deletions
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 2274df4585..3c8e5442ce 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -801,7 +801,7 @@ static NTSTATUS make_cli_gss_blob(struct smb_trans_enc_state *es,
blob_out = data_blob(tok_out.value, tok_out.length);
/* Wrap in an SPNEGO wrapper */
- *p_blob_out = gen_negTokenTarg(krb_mechs, blob_out);
+ *p_blob_out = spnego_gen_negTokenInit(krb_mechs, &blob_out, NULL);
fail:
diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c
index 891f080df0..99d5b88512 100644
--- a/source3/libsmb/clispnego.c
+++ b/source3/libsmb/clispnego.c
@@ -214,52 +214,6 @@ bool spnego_parse_negTokenInit(DATA_BLOB blob,
}
/*
- generate a negTokenTarg packet given a list of OIDs and a security blob
-*/
-DATA_BLOB gen_negTokenTarg(const char *OIDs[], DATA_BLOB blob)
-{
- int i;
- ASN1_DATA *data;
- DATA_BLOB ret;
-
- data = asn1_init(talloc_tos());
- if (data == NULL) {
- return data_blob_null;
- }
-
- asn1_push_tag(data, ASN1_APPLICATION(0));
- asn1_write_OID(data,OID_SPNEGO);
- asn1_push_tag(data, ASN1_CONTEXT(0));
- asn1_push_tag(data, ASN1_SEQUENCE(0));
-
- asn1_push_tag(data, ASN1_CONTEXT(0));
- asn1_push_tag(data, ASN1_SEQUENCE(0));
- for (i=0; OIDs[i]; i++) {
- asn1_write_OID(data,OIDs[i]);
- }
- asn1_pop_tag(data);
- asn1_pop_tag(data);
-
- asn1_push_tag(data, ASN1_CONTEXT(2));
- asn1_write_OctetString(data,blob.data,blob.length);
- asn1_pop_tag(data);
-
- asn1_pop_tag(data);
- asn1_pop_tag(data);
-
- asn1_pop_tag(data);
-
- if (data->has_error) {
- DEBUG(1,("Failed to build negTokenTarg at offset %d\n", (int)data->ofs));
- }
-
- ret = data_blob(data->data, data->length);
- asn1_free(data);
-
- return ret;
-}
-
-/*
generate a krb5 GSS-API wrapper packet given a ticket
*/
DATA_BLOB spnego_gen_krb5_wrap(const DATA_BLOB ticket, const uint8 tok_id[2])
@@ -357,7 +311,7 @@ int spnego_gen_negTokenTarg(const char *principal, int time_offset,
tkt_wrapped = spnego_gen_krb5_wrap(tkt, TOK_ID_KRB_AP_REQ);
/* and wrap that in a shiny SPNEGO wrapper */
- *targ = gen_negTokenTarg(krb_mechs, tkt_wrapped);
+ *targ = spnego_gen_negTokenInit(krb_mechs, &tkt_wrapped, NULL);
data_blob_free(&tkt_wrapped);
data_blob_free(&tkt);