gss_header|trailerlen should be unsigned int
authorSam Hartman <hartmans@mit.edu>
Mon, 26 Jan 2009 20:02:54 +0000 (20:02 +0000)
committerSam Hartman <hartmans@mit.edu>
Mon, 26 Jan 2009 20:02:54 +0000 (20:02 +0000)
The krb5_c_crypto_length API returns unsigned int per its design.
so, use unsigned int not size_t for its output.

ticket: 6351

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21799 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/k5sealv3iov.c

index d8542760dda5b8fa2b1e079f79974ded95e8661c..98904b62d7bf48445025a496ae5c566e66d96d8b 100644 (file)
@@ -52,7 +52,7 @@ gss_krb5int_make_seal_token_v3_iov(krb5_context context,
     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 @@ gss_krb5int_make_seal_token_v3_iov(krb5_context context,
         }
 
         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 @@ gss_krb5int_make_seal_token_v3_iov(krb5_context context,
         }
 
         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 */