svn rev #21799: trunk/src/lib/gssapi/krb5/

hartmans@MIT.EDU hartmans at MIT.EDU
Mon Jan 26 15:02:57 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21799
Commit By: hartmans
Log Message:
ticket: 6351
Subject: gss_header|trailerlen should be unsigned int

The krb5_c_crypto_length API returns unsigned int per its design.
so, use unsigned int not size_t for its output.


Changed Files:
U   trunk/src/lib/gssapi/krb5/k5sealv3iov.c
Modified: trunk/src/lib/gssapi/krb5/k5sealv3iov.c
===================================================================
--- trunk/src/lib/gssapi/krb5/k5sealv3iov.c	2009-01-26 19:47:57 UTC (rev 21798)
+++ trunk/src/lib/gssapi/krb5/k5sealv3iov.c	2009-01-26 20:02:54 UTC (rev 21799)
@@ -52,7 +52,7 @@
     unsigned char *tbuf = NULL;
     int key_usage;
     size_t rrc = 0;
-    size_t gss_headerlen, gss_trailerlen;
+    unsigned int  gss_headerlen, gss_trailerlen;
     krb5_keyblock *key;
     krb5_cksumtype cksumtype;
     size_t data_length, assoc_data_length;
@@ -130,21 +130,21 @@
         }
 
         if (header->type & GSS_IOV_BUFFER_FLAG_ALLOCATE)
-            code = kg_allocate_iov(header, gss_headerlen);
+            code = kg_allocate_iov(header, (size_t) gss_headerlen);
         else if (header->buffer.length < gss_headerlen)
             code = KRB5_BAD_MSIZE;
         if (code != 0)
             goto cleanup;
-        header->buffer.length = gss_headerlen;
+        header->buffer.length = (size_t) gss_headerlen;
 
         if (trailer != NULL) {
             if (trailer->type & GSS_IOV_BUFFER_FLAG_ALLOCATE)
-                code = kg_allocate_iov(trailer, gss_trailerlen);
+                code = kg_allocate_iov(trailer, (size_t) gss_trailerlen);
             else if (trailer->buffer.length < gss_trailerlen)
                 code = KRB5_BAD_MSIZE;
             if (code != 0)
                 goto cleanup;
-            trailer->buffer.length = gss_trailerlen;
+            trailer->buffer.length = (size_t) gss_trailerlen;
         }
 
         /* TOK_ID */
@@ -199,21 +199,21 @@
         }
 
         if (header->type & GSS_IOV_BUFFER_FLAG_ALLOCATE)
-            code = kg_allocate_iov(header, gss_headerlen);
+            code = kg_allocate_iov(header, (size_t) gss_headerlen);
         else if (header->buffer.length < gss_headerlen)
             code = KRB5_BAD_MSIZE;
         if (code != 0)
             goto cleanup;
-        header->buffer.length = gss_headerlen;
+        header->buffer.length = (size_t) gss_headerlen;
 
         if (trailer != NULL) {
             if (trailer->type & GSS_IOV_BUFFER_FLAG_ALLOCATE)
-                code = kg_allocate_iov(trailer, gss_trailerlen);
+                code = kg_allocate_iov(trailer, (size_t) gss_trailerlen);
             else if (trailer->buffer.length < gss_trailerlen)
                 code = KRB5_BAD_MSIZE;
             if (code != 0)
                 goto cleanup;
-            trailer->buffer.length = gss_trailerlen;
+            trailer->buffer.length = (size_t) gss_trailerlen;
         }
 
         /* TOK_ID */




More information about the cvs-krb5 mailing list