Allow the mechOID to be written separately.
authorJeremy Allison <jra@samba.org>
Thu, 14 Feb 2008 19:29:54 +0000 (11:29 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 14 Feb 2008 19:29:54 +0000 (11:29 -0800)
Jeremy.
(This used to be commit e3e08c6e7d270e1be7a9d3042b1f36f5a291f90a)

source3/libsmb/clispnego.c

index f95b11e4cded9153788be458a7091d01cda0ff8b..a75032a47d6a66851a57ece7dcaf1c00012711b0 100644 (file)
@@ -498,11 +498,13 @@ DATA_BLOB spnego_gen_auth_response(DATA_BLOB *reply, NTSTATUS nt_status,
        asn1_write_enumerated(&data, negResult);
        asn1_pop_tag(&data);
 
-       if (reply->data != NULL) {
+       if (mechOID) {
                asn1_push_tag(&data,ASN1_CONTEXT(1));
                asn1_write_OID(&data, mechOID);
                asn1_pop_tag(&data);
-               
+       }
+
+       if (reply && reply->data != NULL) {
                asn1_push_tag(&data,ASN1_CONTEXT(2));
                asn1_write_OctetString(&data, reply->data, reply->length);
                asn1_pop_tag(&data);