schannel: more work on reponse NL_AUTH_MESSAGES.
authorGünther Deschner <gd@samba.org>
Fri, 11 Sep 2009 00:18:59 +0000 (02:18 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 11 Sep 2009 00:57:19 +0000 (02:57 +0200)
Guenther

librpc/gen_ndr/ndr_schannel.c
librpc/gen_ndr/ndr_schannel.h
librpc/gen_ndr/schannel.h
librpc/idl/schannel.idl
librpc/ndr/ndr_schannel.c
librpc/ndr/ndr_schannel.h

index 98021e566cad2ea40b042d57321993040856a125..4bbb56a8b0587122ac39f066d88738608a90241d 100644 (file)
@@ -571,6 +571,62 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_BUFFER(struct ndr_pull *ndr,
        return NDR_ERR_SUCCESS;
 }
 
+_PUBLIC_ enum ndr_err_code ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_push *ndr, int ndr_flags, const union NL_AUTH_MESSAGE_BUFFER_REPLY *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               switch (level) {
+                       case NL_NEGOTIATE_RESPONSE: {
+                               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy));
+                       break; }
+
+                       default: {
+                       break; }
+
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               switch (level) {
+                       case NL_NEGOTIATE_RESPONSE:
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_pull *ndr, int ndr_flags, union NL_AUTH_MESSAGE_BUFFER_REPLY *r)
+{
+       int level;
+       level = ndr_pull_get_switch_value(ndr, r);
+       if (ndr_flags & NDR_SCALARS) {
+               switch (level) {
+                       case NL_NEGOTIATE_RESPONSE: {
+                               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
+                       break; }
+
+                       default: {
+                       break; }
+
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               switch (level) {
+                       case NL_NEGOTIATE_RESPONSE:
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
 _PUBLIC_ enum ndr_err_code ndr_push_NL_AUTH_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NL_AUTH_MESSAGE *r)
 {
        {
@@ -590,6 +646,8 @@ _PUBLIC_ enum ndr_err_code ndr_push_NL_AUTH_MESSAGE(struct ndr_push *ndr, int nd
                        NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_dns_host));
                        NDR_CHECK(ndr_push_set_switch_value(ndr, &r->utf8_netbios_computer, r->Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME));
                        NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_netbios_computer));
+                       NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Buffer, r->MessageType & NL_NEGOTIATE_RESPONSE));
+                       NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_SCALARS, &r->Buffer));
                }
                if (ndr_flags & NDR_BUFFERS) {
                        NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->oem_netbios_domain));
@@ -597,6 +655,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_NL_AUTH_MESSAGE(struct ndr_push *ndr, int nd
                        NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_domain));
                        NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_host));
                        NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_netbios_computer));
+                       NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_BUFFERS, &r->Buffer));
                }
                ndr->flags = _flags_save_STRUCT;
        }
@@ -622,6 +681,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE(struct ndr_pull *ndr, int nd
                        NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_dns_host));
                        NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->utf8_netbios_computer, r->Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME));
                        NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_netbios_computer));
+                       NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Buffer, r->MessageType & NL_NEGOTIATE_RESPONSE));
+                       NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_SCALARS, &r->Buffer));
                }
                if (ndr_flags & NDR_BUFFERS) {
                        NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->oem_netbios_domain));
@@ -629,6 +690,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE(struct ndr_pull *ndr, int nd
                        NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_domain));
                        NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_host));
                        NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_netbios_computer));
+                       NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_BUFFERS, &r->Buffer));
                }
                ndr->flags = _flags_save_STRUCT;
        }
@@ -654,6 +716,8 @@ _PUBLIC_ void ndr_print_NL_AUTH_MESSAGE(struct ndr_print *ndr, const char *name,
                ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "utf8_dns_host", &r->utf8_dns_host);
                ndr_print_set_switch_value(ndr, &r->utf8_netbios_computer, r->Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME);
                ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "utf8_netbios_computer", &r->utf8_netbios_computer);
+               ndr_print_set_switch_value(ndr, &r->Buffer, r->MessageType & NL_NEGOTIATE_RESPONSE);
+               ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, "Buffer", &r->Buffer);
                ndr->depth--;
                ndr->flags = _flags_save_STRUCT;
        }
index 3e049058fd640b26d6c8e4d53a71450700282af1..ed4093366a663bb9b986e54a8c1f6baeb4fb6fdf 100644 (file)
@@ -25,6 +25,9 @@ void ndr_print_NL_AUTH_MESSAGE_FLAGS(struct ndr_print *ndr, const char *name, ui
 enum ndr_err_code ndr_push_NL_AUTH_MESSAGE_BUFFER(struct ndr_push *ndr, int ndr_flags, const union NL_AUTH_MESSAGE_BUFFER *r);
 enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_BUFFER(struct ndr_pull *ndr, int ndr_flags, union NL_AUTH_MESSAGE_BUFFER *r);
 void ndr_print_NL_AUTH_MESSAGE_BUFFER(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER *r);
+enum ndr_err_code ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_push *ndr, int ndr_flags, const union NL_AUTH_MESSAGE_BUFFER_REPLY *r);
+enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_pull *ndr, int ndr_flags, union NL_AUTH_MESSAGE_BUFFER_REPLY *r);
+void ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER_REPLY *r);
 enum ndr_err_code ndr_push_NL_AUTH_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NL_AUTH_MESSAGE *r);
 enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct NL_AUTH_MESSAGE *r);
 void ndr_print_NL_AUTH_MESSAGE(struct ndr_print *ndr, const char *name, const struct NL_AUTH_MESSAGE *r);
index 83357d8568684af511806158effba7075ebd6617..6a85af2f46ba591c4068e0105467105ee91afa52 100644 (file)
@@ -76,6 +76,10 @@ union NL_AUTH_MESSAGE_BUFFER {
        const char * u;/* [case(NL_FLAG_UTF8_DNS_DOMAIN_NAME)] */
 }/* [noprint,nodiscriminant,public] */;
 
+union NL_AUTH_MESSAGE_BUFFER_REPLY {
+       uint32_t dummy;/* [case(NL_NEGOTIATE_RESPONSE)] */
+}/* [noprint,nodiscriminant,public] */;
+
 struct NL_AUTH_MESSAGE {
        enum NL_AUTH_MESSAGE_TYPE MessageType;
        uint32_t Flags;
@@ -84,6 +88,7 @@ struct NL_AUTH_MESSAGE {
        union NL_AUTH_MESSAGE_BUFFER utf8_dns_domain;/* [switch_is(Flags&NL_FLAG_UTF8_DNS_DOMAIN_NAME)] */
        union NL_AUTH_MESSAGE_BUFFER utf8_dns_host;/* [switch_is(Flags&NL_FLAG_UTF8_DNS_HOST_NAME)] */
        union NL_AUTH_MESSAGE_BUFFER utf8_netbios_computer;/* [switch_is(Flags&NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME)] */
+       union NL_AUTH_MESSAGE_BUFFER_REPLY Buffer;/* [switch_is(MessageType&NL_NEGOTIATE_RESPONSE)] */
 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
 
 enum NL_SIGNATURE_ALGORITHM
index c3bf3aaeef5f19bc2bd8ecaf72a204399c26655d..d9b230d70bfa93d9c42df54264e9b803196b8000 100644 (file)
@@ -82,9 +82,14 @@ interface schannel
                [case (NL_FLAG_UTF8_DNS_DOMAIN_NAME)]           nbt_string u;
                [case (NL_FLAG_UTF8_DNS_HOST_NAME)]             nbt_string u;
                [case (NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME)]     nbt_string u;
-               [default];
+               [default]                                       ;
        } NL_AUTH_MESSAGE_BUFFER;
 
+       typedef [public,nodiscriminant,noprint] union {
+               [case (NL_NEGOTIATE_RESPONSE)]                  uint32 dummy;
+               [default]                                       ;
+       } NL_AUTH_MESSAGE_BUFFER_REPLY;
+
        typedef [public,flag(NDR_PAHEX)] struct {
                NL_AUTH_MESSAGE_TYPE MessageType;
                NL_AUTH_MESSAGE_FLAGS Flags;
@@ -93,6 +98,7 @@ interface schannel
                [switch_is(Flags & NL_FLAG_UTF8_DNS_DOMAIN_NAME)]       NL_AUTH_MESSAGE_BUFFER utf8_dns_domain;
                [switch_is(Flags & NL_FLAG_UTF8_DNS_HOST_NAME)]         NL_AUTH_MESSAGE_BUFFER utf8_dns_host;
                [switch_is(Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME)] NL_AUTH_MESSAGE_BUFFER utf8_netbios_computer;
+               [switch_is(MessageType & NL_NEGOTIATE_RESPONSE)]        NL_AUTH_MESSAGE_BUFFER_REPLY Buffer;
        } NL_AUTH_MESSAGE;
 
        /* MS-NRPC 2.2.1.3.2 NL_AUTH_SIGNATURE */
index 9cf0e09d669ea1cfa8f479913800a9310193d9e4..02796f7d9fd0e841106420c306d48996e51eb892 100644 (file)
@@ -54,3 +54,18 @@ _PUBLIC_ void ndr_print_NL_AUTH_MESSAGE_BUFFER(struct ndr_print *ndr, const char
 
        }
 }
+
+_PUBLIC_ void ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER_REPLY *r)
+{
+       int level;
+       level = ndr_print_get_switch_value(ndr, r);
+       switch (level) {
+               case NL_NEGOTIATE_RESPONSE:
+                       ndr_print_uint32(ndr, name, r->dummy);
+               break;
+
+               default:
+               break;
+
+       }
+}
index 5834488ab9603029d3db7ac60896d80655379958..d2dce7911a3a819a93bcb9a0f3b42fe3487ae063 100644 (file)
@@ -20,3 +20,5 @@
 */
 
 void ndr_print_NL_AUTH_MESSAGE_BUFFER(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER *r);
+void ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_print *ndr, const char *name, const union NL_AUTH_MESSAGE_BUFFER_REPLY *r);
+