svn rev #22091: tools/gssmonger/trunk/gssmaster/

raeburn@MIT.EDU raeburn at MIT.EDU
Mon Mar 16 12:47:29 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22091
Commit By: raeburn
Log Message:
Add new text for WrapEx without confidentiality requested.  Add new
field in interference tests indicating a set of flags all of which are
required in order to run the test (as opposed to the existing field of
flags of which any one is required).



Changed Files:
U   tools/gssmonger/trunk/gssmaster/clientapis.c
U   tools/gssmonger/trunk/gssmaster/clientlib.h
U   tools/gssmonger/trunk/gssmaster/interfere.c
Modified: tools/gssmonger/trunk/gssmaster/clientapis.c
===================================================================
--- tools/gssmonger/trunk/gssmaster/clientapis.c	2009-03-15 04:21:12 UTC (rev 22090)
+++ tools/gssmonger/trunk/gssmaster/clientapis.c	2009-03-16 16:47:28 UTC (rev 22091)
@@ -895,27 +895,27 @@
 
 }
 
-ULONG
-ServerWrapEx( IN  HSERVER hServer,
-	      IN  ULONG   ulContextId,
-	      IN  ULONG   Flags,
-	      IN  ULONG   SeqNo,
-	      IN  PVOID   pvPlain,
-	      IN  ULONG   cbPlain,
-	      IN  PVOID   pvSign,
-	      IN  ULONG   cbSign,
+static ULONG
+ServerWrapExCommon( IN  HSERVER hServer,
+		    IN  ULONG   ulContextId,
+		    IN  ULONG   Flags,
+		    IN  ULONG   SeqNo,
+		    IN  ULONG   Conf,
+		    IN  PVOID   pvPlain,
+		    IN  ULONG   cbPlain,
+		    IN  PVOID   pvSign,
+		    IN  ULONG   cbSign,
 
-	      OUT PVOID  *ppvHeader,
-	      OUT PULONG  pcbHeader,
-	      OUT PVOID  *ppvWrappedText,
-	      OUT PULONG  pcbWrappedText,
-	      OUT PVOID  *ppvPad,
-	      OUT PULONG  pcbPad,
-	      OUT PVOID  *ppvTrailer,
-	      OUT PULONG  pcbTrailer ) {
+		    OUT PVOID  *ppvHeader,
+		    OUT PULONG  pcbHeader,
+		    OUT PVOID  *ppvWrappedText,
+		    OUT PULONG  pcbWrappedText,
+		    OUT PVOID  *ppvPad,
+		    OUT PULONG  pcbPad,
+		    OUT PVOID  *ppvTrailer,
+		    OUT PULONG  pcbTrailer ) {
 
     ULONG       ret = GSMERR_OK;
-    ULONG Conf = 1;
     NETARGENTRY InputEntries[] = {
 
       { "ContextId",  sizeof( ulContextId ), &ulContextId, NETARG_NUMBER },
@@ -984,6 +984,84 @@
 }
 
 ULONG
+ServerWrapEx( IN  HSERVER hServer,
+	      IN  ULONG   ulContextId,
+	      IN  ULONG   Flags,
+	      IN  ULONG   SeqNo,
+	      IN  PVOID   pvPlain,
+	      IN  ULONG   cbPlain,
+	      IN  PVOID   pvSign,
+	      IN  ULONG   cbSign,
+
+	      OUT PVOID  *ppvHeader,
+	      OUT PULONG  pcbHeader,
+	      OUT PVOID  *ppvWrappedText,
+	      OUT PULONG  pcbWrappedText,
+	      OUT PVOID  *ppvPad,
+	      OUT PULONG  pcbPad,
+	      OUT PVOID  *ppvTrailer,
+	      OUT PULONG  pcbTrailer )
+{
+    return ServerWrapExCommon( hServer,
+			       ulContextId,
+			       Flags,
+			       SeqNo,
+			       1UL,
+			       pvPlain,
+			       cbPlain,
+			       pvSign,
+			       cbSign,
+
+			       ppvHeader,
+			       pcbHeader,
+			       ppvWrappedText,
+			       pcbWrappedText,
+			       ppvPad,
+			       pcbPad,
+			       ppvTrailer,
+			       pcbTrailer );
+}
+
+ULONG
+ServerWrapExNoConf( IN  HSERVER hServer,
+		    IN  ULONG   ulContextId,
+		    IN  ULONG   Flags,
+		    IN  ULONG   SeqNo,
+		    IN  PVOID   pvPlain,
+		    IN  ULONG   cbPlain,
+		    IN  PVOID   pvSign,
+		    IN  ULONG   cbSign,
+
+		    OUT PVOID  *ppvHeader,
+		    OUT PULONG  pcbHeader,
+		    OUT PVOID  *ppvWrappedText,
+		    OUT PULONG  pcbWrappedText,
+		    OUT PVOID  *ppvPad,
+		    OUT PULONG  pcbPad,
+		    OUT PVOID  *ppvTrailer,
+		    OUT PULONG  pcbTrailer )
+{
+    return ServerWrapExCommon( hServer,
+			       ulContextId,
+			       Flags,
+			       SeqNo,
+			       0UL,
+			       pvPlain,
+			       cbPlain,
+			       pvSign,
+			       cbSign,
+
+			       ppvHeader,
+			       pcbHeader,
+			       ppvWrappedText,
+			       pcbWrappedText,
+			       ppvPad,
+			       pcbPad,
+			       ppvTrailer,
+			       pcbTrailer );
+}
+
+ULONG
 ServerUnwrapEx( IN  HSERVER hServer,
 		IN  ULONG   ulContextId,
 		IN  ULONG   Flags,

Modified: tools/gssmonger/trunk/gssmaster/clientlib.h
===================================================================
--- tools/gssmonger/trunk/gssmaster/clientlib.h	2009-03-15 04:21:12 UTC (rev 22090)
+++ tools/gssmonger/trunk/gssmaster/clientlib.h	2009-03-16 16:47:28 UTC (rev 22091)
@@ -178,7 +178,7 @@
 			     OUT PVOID  *ppvTrailer,
 			     OUT PULONG  pcbTrailer );
 
-ENCODE_IOV_FN ServerWrapEx;
+ENCODE_IOV_FN ServerWrapEx, ServerWrapExNoConf;
 
 typedef ULONG DECODE_IOV_FN( IN  HSERVER hServer,
 			     IN  ULONG   ulContextId,

Modified: tools/gssmonger/trunk/gssmaster/interfere.c
===================================================================
--- tools/gssmonger/trunk/gssmaster/interfere.c	2009-03-15 04:21:12 UTC (rev 22090)
+++ tools/gssmonger/trunk/gssmaster/interfere.c	2009-03-16 16:47:28 UTC (rev 22091)
@@ -93,16 +93,18 @@
   This is the type of message-passing that will be tested
   ------------------------------------------------------------*/
 
-#define MESSAGETEST_ENCRYPT 0x1
-#define MESSAGETEST_SIGNED  0x2
-#define MESSAGETEST_WRAPPED 0x4
-#define MESSAGETEST_WRAPEX  0x8
-#define LAST_MESSAGETEST    MESSAGETEST_WRAPEX // update if more are added
+#define MESSAGETEST_ENCRYPT       0x01
+#define MESSAGETEST_SIGNED        0x02
+#define MESSAGETEST_WRAPPED       0x04
+#define MESSAGETEST_WRAPEX        0x08
+#define MESSAGETEST_WRAPEX_NOCONF 0x10
+#define LAST_MESSAGETEST    MESSAGETEST_WRAPEX_NOCONF // update if more are added
 
 ULONG iWhichMessages     = ( MESSAGETEST_ENCRYPT |
                              MESSAGETEST_WRAPPED |
                              MESSAGETEST_SIGNED |
-			     MESSAGETEST_WRAPEX );
+			     MESSAGETEST_WRAPEX |
+			     MESSAGETEST_WRAPEX_NOCONF );
 
 ////////////////////////////////////////////////////////////
 
@@ -119,8 +121,9 @@
   MSGTST( "Signed",  SIGNED,  "Exchanges messages with an unwrapped sig" ),
   MSGTST( "Wrapped", WRAPPED, "Exchanges clearsigned wrapped messages" ),
   MSGTST( "WrapEx",  WRAPEX,  "Exchanges encrypted messages with additional signed data" ),
+  MSGTST( "WrapExNoConf",  WRAPEX_NOCONF,  "Exchanges clearsigned messages with additional signed data" ),
 
-#if LAST_MESSAGETEST != MESSAGETEST_WRAPEX
+#if LAST_MESSAGETEST != MESSAGETEST_WRAPEX_NOCONF
 #error "New MessageTests?  Update this array or they won't be on the command line"
 #endif
 
@@ -715,7 +718,7 @@
     struct {
 
       LPSTR            Description;
-      ULONG            RequireAnyFlags;
+      ULONG            RequireAnyFlags, RequireAllFlags;
       ULONG            iMessageFlag;
       MESSAGEGLUE      Glue;
       
@@ -723,6 +726,7 @@
 
       { "Encrypt",
         GSMFLAG_CONFIDENTIALITY,
+	0,
         MESSAGETEST_ENCRYPT,
         GenericEncodeMessage,
         GenericDecodeMessage,
@@ -735,6 +739,7 @@
         GSMFLAG_REPLAY_DETECT |
         GSMFLAG_SEQUENCE_DETECT |
         GSMFLAG_CONFIDENTIALITY,
+	0,
         MESSAGETEST_WRAPPED,
         GenericEncodeMessage,
         GenericDecodeMessage,
@@ -747,6 +752,7 @@
         GSMFLAG_REPLAY_DETECT |
         GSMFLAG_SEQUENCE_DETECT |
         GSMFLAG_CONFIDENTIALITY,
+	0,
         MESSAGETEST_SIGNED,
         GenericEncodeMessage,
         ValidateSignedMessage,
@@ -755,16 +761,28 @@
       },
       { "WrapEx",
 	GSMFLAG_WRAPEX,
+	GSMFLAG_WRAPEX |
+	GSMFLAG_CONFIDENTIALITY,
         MESSAGETEST_WRAPEX,
         EncodeIOVMessage,
         DecodeIOVMessage,
-        "encrypting",
+        "encrypting-iov",
         (ENCODE_FN *) ServerWrapEx,
         (DECODE_FN *) ServerUnwrapEx
       },
+      { "WrapExNoConf",
+	GSMFLAG_WRAPEX,
+	0,
+        MESSAGETEST_WRAPEX,
+        EncodeIOVMessage,
+        DecodeIOVMessage,
+        "wrapping-iov",
+        (ENCODE_FN *) ServerWrapExNoConf,
+        (DECODE_FN *) ServerUnwrapEx
+      },
 
 
-#if LAST_MESSAGETEST != MESSAGETEST_WRAPEX
+#if LAST_MESSAGETEST != MESSAGETEST_WRAPEX_NOCONF
 #error "New Message Test type?  Update this array and #defines at top"
 #endif
       
@@ -870,8 +888,30 @@
         
         // if the context doesn't support this type of message, skip it...
 
-        if ( !( pContext->ContextFlags &
-                MessageTests[ iMessage ].RequireAnyFlags ) ) continue;
+	if ( ( pContext->ContextFlags &
+	       MessageTests[ iMessage ].RequireAllFlags ) !=
+	     MessageTests[ iMessage ].RequireAllFlags ||
+	     !( pContext->ContextFlags &
+                MessageTests[ iMessage ].RequireAnyFlags ) ) {
+#if 0
+	    printf("%s:%d: skipping test %s: ctx %lx req-all %lx req-any %lx\n",
+		   __FILE__, __LINE__,
+		   MessageTests[ iMessage ].Description,
+		   pContext->ContextFlags,
+		   MessageTests[ iMessage ].RequireAllFlags,
+		   MessageTests[ iMessage ].RequireAnyFlags);
+#endif
+	    continue;
+	} else {
+#if 0
+	    printf("%s:%d: running test %s: ctx %lx req-all %lx req-any %lx\n",
+		   __FILE__, __LINE__,
+		   MessageTests[ iMessage ].Description,
+		   pContext->ContextFlags,
+		   MessageTests[ iMessage ].RequireAllFlags,
+		   MessageTests[ iMessage ].RequireAnyFlags);
+#endif
+	}
 
         // if the user didn't request this type of messaging, skip it...
 




More information about the cvs-krb5 mailing list