[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-319-g9831e76

Günther Deschner gd at samba.org
Tue Sep 15 09:55:28 MDT 2009


The branch, master has been updated
       via  9831e7675c2f393bd02167f435b202e818d4d50b (commit)
       via  ed03edc2e49c686d582abe0506f9422bfb795201 (commit)
      from  fdf3bd6203b35fc82bda1fd07cc91b76de3f9edd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9831e7675c2f393bd02167f435b202e818d4d50b
Author: Günther Deschner <gd at samba.org>
Date:   Tue Sep 15 00:26:31 2009 +0200

    ntlmssp: pretty print a VERSION structure.
    
    Guenther

commit ed03edc2e49c686d582abe0506f9422bfb795201
Author: Günther Deschner <gd at samba.org>
Date:   Mon Sep 14 23:25:33 2009 +0200

    ntlmssp: better document to what structures we are reffering to.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/ndr_ntlmssp.c |   16 ----------------
 librpc/gen_ndr/ndr_ntlmssp.h |    1 -
 librpc/gen_ndr/ntlmssp.h     |    2 +-
 librpc/idl/ntlmssp.idl       |   30 ++++++++++++++++++++++++++----
 librpc/ndr/ndr_ntlmssp.c     |   17 +++++++++++++++++
 librpc/ndr/ndr_ntlmssp.h     |    2 ++
 6 files changed, 46 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/ndr_ntlmssp.c b/librpc/gen_ndr/ndr_ntlmssp.c
index b593d9e..2b4e70e 100644
--- a/librpc/gen_ndr/ndr_ntlmssp.c
+++ b/librpc/gen_ndr/ndr_ntlmssp.c
@@ -250,22 +250,6 @@ static enum ndr_err_code ndr_pull_ntlmssp_Version(struct ndr_pull *ndr, int ndr_
 	return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_ntlmssp_Version(struct ndr_print *ndr, const char *name, const union ntlmssp_Version *r)
-{
-	int level;
-	level = ndr_print_get_switch_value(ndr, r);
-	ndr_print_union(ndr, name, level, "ntlmssp_Version");
-	switch (level) {
-		case NTLMSSP_NEGOTIATE_VERSION:
-			ndr_print_VERSION(ndr, "version", &r->version);
-		break;
-
-		default:
-		break;
-
-	}
-}
-
 _PUBLIC_ enum ndr_err_code ndr_push_NEGOTIATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NEGOTIATE_MESSAGE *r)
 {
 	if (ndr_flags & NDR_SCALARS) {
diff --git a/librpc/gen_ndr/ndr_ntlmssp.h b/librpc/gen_ndr/ndr_ntlmssp.h
index ab095d1..de31c6c 100644
--- a/librpc/gen_ndr/ndr_ntlmssp.h
+++ b/librpc/gen_ndr/ndr_ntlmssp.h
@@ -50,7 +50,6 @@ void ndr_print_LM_RESPONSE(struct ndr_print *ndr, const char *name, const struct
 enum ndr_err_code ndr_push_LMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LMv2_RESPONSE *r);
 enum ndr_err_code ndr_pull_LMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LMv2_RESPONSE *r);
 void ndr_print_LMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct LMv2_RESPONSE *r);
-void ndr_print_ntlmssp_LM_RESPONSE(struct ndr_print *ndr, const char *name, const union ntlmssp_LM_RESPONSE *r);
 enum ndr_err_code ndr_push_NTLM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLM_RESPONSE *r);
 enum ndr_err_code ndr_pull_NTLM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLM_RESPONSE *r);
 void ndr_print_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLM_RESPONSE *r);
diff --git a/librpc/gen_ndr/ntlmssp.h b/librpc/gen_ndr/ntlmssp.h
index 4509915..5205dce 100644
--- a/librpc/gen_ndr/ntlmssp.h
+++ b/librpc/gen_ndr/ntlmssp.h
@@ -104,7 +104,7 @@ struct VERSION {
 
 union ntlmssp_Version {
 	struct VERSION version;/* [case(NTLMSSP_NEGOTIATE_VERSION)] */
-}/* [nodiscriminant] */;
+}/* [noprint,nodiscriminant] */;
 
 struct NEGOTIATE_MESSAGE {
 	const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */
diff --git a/librpc/idl/ntlmssp.idl b/librpc/idl/ntlmssp.idl
index 0bb30bb..8cabec3 100644
--- a/librpc/idl/ntlmssp.idl
+++ b/librpc/idl/ntlmssp.idl
@@ -18,6 +18,8 @@ interface ntlmssp
 		NtLmAuthenticate	= 0x00000003
 	} ntlmssp_MessageType;
 
+	/* [MS-NLMP] 2.2.2.5 NEGOTIATE */
+
 	typedef [bitmap32bit] bitmap {
 		NTLMSSP_NEGOTIATE_UNICODE			= 0x00000001,
 		NTLMSSP_NEGOTIATE_OEM				= 0x00000002, /* NTLM_NEGOTIATE_OEM in MS-NLMP */
@@ -82,6 +84,8 @@ interface ntlmssp
 		NTLMSSP_REVISION_W2K3		= 0x0F
 	} ntlmssp_NTLMRevisionCurrent;
 
+	/* [MS-NLMP] 2.2.2.10 VERSION */
+
 	typedef struct {
 		ntlmssp_WindowsMajorVersion ProductMajorVersion;
 		ntlmssp_WindowsMinorVersion ProductMinorVersion;
@@ -90,12 +94,12 @@ interface ntlmssp
 		ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent;
 	} VERSION;
 
-	typedef [nodiscriminant] union {
+	typedef [noprint,nodiscriminant] union {
 		[case(NTLMSSP_NEGOTIATE_VERSION)] VERSION version;
 		[default];
 	} ntlmssp_Version;
 
-	/* NTLMSSP negotiate message */
+	/* [MS-NLMP] 2.2.1.1 NEGOTIATE_MESSAGE */
 
 	typedef [public] struct {
 		[charset(DOS),value("NTLMSSP")] uint8 Signature[8];
@@ -124,6 +128,8 @@ interface ntlmssp
 		MsvChannelBindings	= 10
 	} ntlmssp_AvId;
 
+	/* [MS-NLMP] 2.2.2.2 Restriction_Encoding */
+
 	typedef struct {
 		uint32 Size;
 		[value(0)] uint32 Z4;
@@ -152,6 +158,8 @@ interface ntlmssp
 		[default]			[flag(NDR_REMAINING)] DATA_BLOB blob;
 	} ntlmssp_AvValue;
 
+	/* [MS-NLMP] 2.2.2.1 AV_PAIR */
+
 	typedef [public,flag(NDR_NOALIGN)] struct {
 		ntlmssp_AvId AvId;
 		[value(ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience, 0))] uint16 AvLen;
@@ -163,7 +171,7 @@ interface ntlmssp
 		AV_PAIR pair[count];
 	} AV_PAIR_LIST;
 
-	/* NTLMSSP challenge message */
+	/* [MS-NLMP] 2.2.1.2 CHALLENGE_MESSAGE */
 
 	typedef [public,flag(NDR_PAHEX)] struct {
 		[charset(DOS),value("NTLMSSP")] uint8 Signature[8];
@@ -180,10 +188,14 @@ interface ntlmssp
 		[switch_is(NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_Version Version;
 	} CHALLENGE_MESSAGE;
 
+	/* [MS-NLMP] 2.2.2.3 LM_RESPONSE */
+
 	typedef [public,flag(NDR_PAHEX)] struct {
 		uint8 Response[24];
 	} LM_RESPONSE;
 
+	/* [MS-NLMP] 2.2.2.4 LMv2_RESPONSE */
+
 	typedef [public,flag(NDR_PAHEX)] struct {
 		uint8 Response[16];
 		uint8 ChallengeFromClient[8];
@@ -194,10 +206,14 @@ interface ntlmssp
 		[default];
 	} ntlmssp_LM_RESPONSE;
 
+	/* [MS-NLMP] 2.2.2.6 NTLM_RESPONSE */
+
 	typedef [public,flag(NDR_PAHEX)] struct {
 		uint8 Response[24];
 	} NTLM_RESPONSE;
 
+	/* [MS-NLMP] 2.2.2.7 NTLMv2_CLIENT_CHALLENGE */
+
 	typedef [flag(NDR_PAHEX)] struct {
 		[value(1)] uint8 RespType;
 		[value(1)] uint8 HiRespType;
@@ -209,6 +225,8 @@ interface ntlmssp
 		[subcontext(0)] [flag(NDR_REMAINING)] AV_PAIR_LIST AvPairs;
 	} NTLMv2_CLIENT_CHALLENGE;
 
+	/* [MS-NLMP] 2.2.2.8 NTLMv2_RESPONSE */
+
 	typedef [public,flag(NDR_PAHEX)] struct {
 		uint8 Response[16];
 		NTLMv2_CLIENT_CHALLENGE Challenge;
@@ -224,7 +242,7 @@ interface ntlmssp
 		uint8 MIC[16];
 	} MIC;
 
-	/* NTLMSSP authenticate message */
+	/* [MS-NLMP] 2.2.1.3 AUTHENTICATE_MESSAGE */
 
 	typedef [public,flag(NDR_REMAINING)] struct {
 		[charset(DOS),value("NTLMSSP")] uint8 Signature[8];
@@ -260,6 +278,8 @@ interface ntlmssp
 	/* NTLMSSP signature size */
 	const int NTLMSSP_SIG_SIZE = 16;
 
+	/* [MS-NLMP] 2.2.2.9.1 NTLMSSP_MESSAGE_SIGNATURE */
+
 	typedef [public] struct {
 		 [value(NTLMSSP_SIGN_VERSION)] uint32 Version;
 		 uint32 RandomPad;
@@ -267,6 +287,8 @@ interface ntlmssp
 		 uint32 SeqNum;
 	} NTLMSSP_MESSAGE_SIGNATURE;
 
+	/* [MS-NLMP] 2.2.2.9.2 NTLMSSP_MESSAGE_SIGNATURE for Extended Session Security */
+
 	typedef [public,flag(NDR_PAHEX)] struct {
 		 [value(NTLMSSP_SIGN_VERSION)] uint32 Version;
 		 uint8 Checksum[8];
diff --git a/librpc/ndr/ndr_ntlmssp.c b/librpc/ndr/ndr_ntlmssp.c
index 5c28726..4808aa5 100644
--- a/librpc/ndr/ndr_ntlmssp.c
+++ b/librpc/ndr/ndr_ntlmssp.c
@@ -162,3 +162,20 @@ _PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx,
 		}
 	}
 }
+
+_PUBLIC_ void ndr_print_ntlmssp_Version(struct ndr_print *ndr, const char *name, const union ntlmssp_Version *r)
+{
+	int level;
+	level = ndr_print_get_switch_value(ndr, r);
+	switch (level) {
+		case NTLMSSP_NEGOTIATE_VERSION:
+			ndr_print_VERSION(ndr, name, &r->version);
+		break;
+
+		default:
+		break;
+
+	}
+}
+
+
diff --git a/librpc/ndr/ndr_ntlmssp.h b/librpc/ndr/ndr_ntlmssp.h
index 6d76be2..b574f15 100644
--- a/librpc/ndr/ndr_ntlmssp.h
+++ b/librpc/ndr/ndr_ntlmssp.h
@@ -31,3 +31,5 @@ _PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx,
 					    struct smb_iconv_convenience *ic,
 					    const DATA_BLOB *lm_response,
 					    bool ntlmv2);
+_PUBLIC_ void ndr_print_ntlmssp_Version(struct ndr_print *ndr, const char *name, const union ntlmssp_Version *r);
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list