Made explicit the signed to unsigned conversions in the gssapi/krb5
authorKeith Vetter <keithv@fusion.com>
Wed, 8 Mar 1995 05:09:18 +0000 (05:09 +0000)
committerKeith Vetter <keithv@fusion.com>
Wed, 8 Mar 1995 05:09:18 +0000 (05:09 +0000)
directory.

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

22 files changed:
src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/accept_sec_context.c
src/lib/gssapi/krb5/acquire_cred.c
src/lib/gssapi/krb5/compare_name.c
src/lib/gssapi/krb5/context_time.c
src/lib/gssapi/krb5/delete_sec_context.c
src/lib/gssapi/krb5/disp_name.c
src/lib/gssapi/krb5/disp_status.c
src/lib/gssapi/krb5/get_tkt_flags.c
src/lib/gssapi/krb5/gssapiP_krb5.h
src/lib/gssapi/krb5/init_sec_context.c
src/lib/gssapi/krb5/inq_context.c
src/lib/gssapi/krb5/inq_cred.c
src/lib/gssapi/krb5/k5seal.c
src/lib/gssapi/krb5/k5unseal.c
src/lib/gssapi/krb5/krb5_gss_glue.c
src/lib/gssapi/krb5/process_context_token.c
src/lib/gssapi/krb5/rel_cred.c
src/lib/gssapi/krb5/rel_name.c
src/lib/gssapi/krb5/util_cksum.c
src/lib/gssapi/krb5/util_crypt.c
src/lib/gssapi/krb5/util_seqnum.c

index 5bffc52fb867e978c53c6dde82e769a74b4e6029..291cdd7186a148600d327ee0188a747f82ed05a3 100644 (file)
@@ -1,3 +1,13 @@
+Tue Mar 7 20:48:03 1995 Keith Vetter (keithv@fusion.com)
+
+       * accept_s.c, acqire_s.c, compare_.c, context_.c, delete_s.c,
+          disp_nam.c, disp_sta.c, get_tkt_.c, init_sec.c, inq_cont.c, 
+          inq_cred.c, k5seal.c, k5unseal.c, process_.c, rel_cred.c, 
+          rel_name.c, util_cks.c, util_cry.c: added casts on signed ->
+            unsigned assignments.
+        * util_seq.c: added casts on bit extraction code.
+        * gssapip_.h: pulls in los-proto.h for prototypes.
+
 Tue Feb 28 00:27:44 1995  John Gilmore  (gnu at toad.com)
 
        * gssapi_krb5.h, gssapiP_krb5.h: Avoid <krb5/...> includes.
index e394458990625b43271eb1e881f950d9566bf131..231a3628fbab7e2c2e18f9310519bf432fb83e2f 100644 (file)
@@ -173,7 +173,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle,
       return(GSS_S_NO_CRED);
    } else {
       if (! kg_validate_cred_id(verifier_cred_handle)) {
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_DEFECTIVE_CREDENTIAL);
       }
    }
@@ -439,7 +439,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle,
            xfree(token.value);
         (void)krb5_gss_delete_sec_context(context, minor_status,
                                           (gss_ctx_id_t *) &ctx, NULL);
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_FAILURE);
       }
 
@@ -454,7 +454,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle,
         xfree(token.value);
       (void)krb5_gss_delete_sec_context(context, minor_status, 
                                        (gss_ctx_id_t *) &ctx, NULL);
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_FAILURE);
    }
 
index 19025b51b94e340d79abe2b902de8ec8b4099d4a..419643b90cf14def01ef9d6ea068e6ea0d00df81 100644 (file)
  */
 
 #include "gssapiP_krb5.h"
+#ifdef USE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
 
 /* get credentials corresponding to a key in the krb5 keytab.
    If the default name is requested, return the name in output_princ.
@@ -265,7 +270,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req,
    /*SUPPRESS 29*/
    if ((desired_name != GSS_C_NO_NAME) &&
        (! kg_validate_name(desired_name))) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
@@ -300,7 +305,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req,
        (cred_usage != GSS_C_ACCEPT) &&
        (cred_usage != GSS_C_BOTH)) {
       xfree(cred);
-      *minor_status = G_BAD_USAGE;
+      *minor_status = (OM_uint32) G_BAD_USAGE;
       return(GSS_S_FAILURE);
    }
 
@@ -407,7 +412,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req,
       if (cred->princ)
         krb5_free_principal(context, cred->princ);
       xfree(cred);
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_FAILURE);
    }
 
index c81c6c71de0b009446172a731661399d239e0d25..e73797a62e910c19b24655afbbd38c5d97da87e6 100644 (file)
@@ -31,12 +31,12 @@ krb5_gss_compare_name(context, minor_status, name1, name2, name_equal)
      int *name_equal;
 { 
    if (! kg_validate_name(name1)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
    if (! kg_validate_name(name2)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
index aa76b4f82d47f7bdf356133679c94acc49ce9710..05276c305f955735417f00d3099939f165916e21 100644 (file)
@@ -36,7 +36,7 @@ krb5_gss_context_time(context, minor_status, context_handle, time_rec)
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index cf3ce419350b91da0736fd0baab4a3611698819e..e7ccdfa332b5304e73842ba3d5735b2aa0a55e23 100644 (file)
@@ -45,7 +45,7 @@ krb5_gss_delete_sec_context(context, minor_status, context_handle, output_token)
    /*SUPPRESS 29*/
    /* validate the context handle */
    if (! kg_validate_ctx_id(*context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index e6047c96e1c5e24efd04a9421cf32c1b9f1b28bc..f59d7aef8a67b7ee9bb34608793812dc7444278c 100644 (file)
@@ -38,7 +38,7 @@ krb5_gss_display_name(context, minor_status, input_name, output_name_buffer,
    output_name_buffer->value = NULL;
 
    if (! kg_validate_name(input_name)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
@@ -50,7 +50,7 @@ krb5_gss_display_name(context, minor_status, input_name, output_name_buffer,
    if (! g_make_string_buffer(str, output_name_buffer)) {
       xfree(str);
 
-      *minor_status = G_BUFFER_ALLOC;
+      *minor_status = (OM_uint32) G_BUFFER_ALLOC;
       return(GSS_S_FAILURE);
    }
 
index 38734f69fab990d2a07f75d832427db9274b0354..e1df99803f3cd1fc14acdb06ccab2262133027e4 100644 (file)
@@ -62,7 +62,7 @@ krb5_gss_display_status(context, minor_status, status_value, status_type,
       }
 
       if (*message_context) {
-        *minor_status = G_BAD_MSG_CTX;
+        *minor_status = (OM_uint32) G_BAD_MSG_CTX;
         return(GSS_S_FAILURE);
       }
 
index 91360a8af467c83e51cf7f9083a58a1d616dfb71..1708e564e0b33063995eac172826ceae44845f91 100644 (file)
@@ -32,7 +32,7 @@ gss_krb5_get_tkt_flags(minor_status, context_handle, ticket_flags)
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index 453c86b5e00e252ea13deb7bb62c0f57102b648d..f1576ec751d122aedcd885a8823b4bd7ce11250c 100644 (file)
@@ -24,6 +24,7 @@
 #define _GSSAPIP_KRB5_H_
 
 #include "krb5.h"
+#include "los-proto.h"
 #include <memory.h>
 
 /* work around sunos braindamage */
index e65e6d0d0cd14c98246e61adcd105b9e505ffc52..21ca4977db3372f1761ea5c48cf3a24f55225056 100644 (file)
@@ -42,7 +42,6 @@ make_ap_req(context, cred, server, endtime, chan_bindings, do_mutual,
     krb5_creds in_creds, * out_creds;
     krb5_authenticator authent;
     krb5_data ap_req;
-    long tmp;
     unsigned char *ptr;
     unsigned char ckbuf[24];           /* see the token formats doc */
     unsigned char *t;
@@ -193,7 +192,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle,
       }
    } else {
       if (! kg_validate_cred_id(claimant_cred_handle)) {
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_DEFECTIVE_CREDENTIAL);
       }
    }
@@ -203,7 +202,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle,
    /* verify that the target_name is valid and usable */
 
    if (! kg_validate_name(target_name)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
@@ -307,7 +306,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle,
         krb5_free_principal(context, ctx->there);
         xfree(ctx);
 
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_FAILURE);
       }
 
@@ -354,7 +353,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle,
       /* validate the context handle */
       /*SUPPRESS 29*/
       if (! kg_validate_ctx_id(*context_handle)) {
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_NO_CONTEXT);
       }
 
index b7a8507ccf33ebd9a2b9fe3b5374ff786559b270..927483396a4e3c9e5b7e78ba72f4d4dcd109c51c 100644 (file)
@@ -49,7 +49,7 @@ krb5_gss_inquire_context(context, minor_status, context_handle, initiator_name,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -80,7 +80,7 @@ krb5_gss_inquire_context(context, minor_status, context_handle, initiator_name,
       }
       if (! kg_save_name((gss_name_t) init)) {
         krb5_free_principal(context, init);
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_FAILURE);
       }
    }
@@ -99,7 +99,7 @@ krb5_gss_inquire_context(context, minor_status, context_handle, initiator_name,
            kg_delete_name((gss_name_t) accept);
            krb5_free_principal(context, init);
         }
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_FAILURE);
       }
    }
index 7aee2632ccc434abf633bd6f823b1370fb44e0da..fb5346281de31c1efd01f7485a2e0467d7ea96f5 100644 (file)
@@ -54,7 +54,7 @@ krb5_gss_inquire_cred(context, minor_status, cred_handle, name, lifetime_ret,
       }
    } else {
       if (! kg_validate_cred_id(cred_handle)) {
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_NO_CRED);
       }
    }
@@ -87,7 +87,7 @@ krb5_gss_inquire_cred(context, minor_status, cred_handle, name, lifetime_ret,
       if (! kg_save_name((gss_name_t) ret_name)) {
         (void)gss_release_oid_set(minor_status, &mechs);
         krb5_free_principal(context, ret_name);
-        *minor_status = G_VALIDATE_FAILED;
+        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
         return(GSS_S_FAILURE);
       }
       *name = (gss_name_t) ret_name;
index d475b010ad469b6ef51e42ee1bcc9991fa8ee7b2..0958a8736c1de74f8981669485ab0047f2e8ad8a 100644 (file)
@@ -200,13 +200,13 @@ kg_seal(minor_status, context_handle, conf_req_flag, qop_req,
 
    /* only default qop is allowed */
    if (qop_req != GSS_C_QOP_DEFAULT) {
-      *minor_status = G_UNKNOWN_QOP;
+      *minor_status = (OM_uint32) G_UNKNOWN_QOP;
       return(GSS_S_FAILURE);
    }
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index ce0bde5242b91dc87156a9beb0df8f0ae1dd9351..1e9e2580a9b0df85541355e8697883689b00a1b8 100644 (file)
@@ -61,7 +61,7 @@ kg_unseal(minor_status, context_handle, input_token_buffer, message_buffer,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index a449b79d8e69b3c20cef572bedc54fb5ffab8dba..58489314366b01c361d6b71a8cbe7988d7455233 100644 (file)
@@ -42,7 +42,7 @@ gss_accept_sec_context(minor_status, context_handle, verifier_cred_handle,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -113,7 +113,7 @@ gss_context_time(minor_status, context_handle, time_rec)
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -133,7 +133,7 @@ gss_delete_sec_context(minor_status, context_handle, output_token)
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -247,7 +247,7 @@ gss_inquire_context(minor_status, context_handle, initiator_name, acceptor_name,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -285,7 +285,7 @@ gss_process_context_token(minor_status, context_handle, token_buffer)
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -349,7 +349,7 @@ gss_seal(minor_status, context_handle, conf_req_flag, qop_req,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -372,7 +372,7 @@ gss_sign(minor_status, context_handle, qop_req, message_buffer, message_token)
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -396,7 +396,7 @@ gss_unseal(minor_status, context_handle, input_message_buffer,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
@@ -420,7 +420,7 @@ gss_verify(minor_status, context_handle, message_buffer,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index 3a6d404f0d518f20c3373050a6a3561144a5d8ca..1bea1a5f7307a168d72acc98fd7c4f757f1003fc 100644 (file)
@@ -35,7 +35,7 @@ krb5_gss_process_context_token(context, minor_status, context_handle,
 
    /* validate the context handle */
    if (! kg_validate_ctx_id(context_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_NO_CONTEXT);
    }
 
index 28f1ff7b46f5b3f296772bc2945fe350ca1957ac..e976d0a22e87f189516e80ea6ce3688a6fee4d3c 100644 (file)
@@ -35,7 +35,7 @@ krb5_gss_release_cred(context, minor_status, cred_handle)
       return(kg_release_defcred(minor_status));
 
    if (! kg_delete_cred_id(*cred_handle)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_NO_CRED);
    }
 
index fd0a88ebc40af349009ed13986606983fad7d4b7..872746304e7c756154ae264dcdacaec3cf572d2f 100644 (file)
@@ -29,7 +29,7 @@ krb5_gss_release_name(context, minor_status, input_name)
      gss_name_t *input_name;
 {
    if (! kg_validate_name(*input_name)) {
-      *minor_status = G_VALIDATE_FAILED;
+      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
index c17d2f5bbc4a9c4a42926a96d6913b4d83ca3bf0..d5c12aab2cbd2582348075fbe43ec8f60d01616c 100644 (file)
@@ -31,7 +31,6 @@ kg_checksum_channel_bindings(cb, cksum, bigend)
 {
    int len;
    char *buf, *ptr;
-   long tmp;
    krb5_error_code code;
 
    if (!kg_context && (code=kg_get_context()))
@@ -53,7 +52,7 @@ kg_checksum_channel_bindings(cb, cksum, bigend)
 
    /* create the buffer to checksum into */
 
-   len = (sizeof(tmp)*5+
+   len = (sizeof(long)*5+
          cb->initiator_address.length+
          cb->acceptor_address.length+
          cb->application_data.length);
index fcb4306ad4c068614fcfe63f0905bc2a5c502225..a53b7c2ce996acf3ca1cef9d7ee37a5c3578ce39 100644 (file)
@@ -39,8 +39,6 @@ kg_make_confounder(ed, buf)
      krb5_gss_enc_desc *ed;
      unsigned char *buf;
 {
-   krb5_error_code code;
-
    return(krb5_random_confounder( ed->eblock.crypto_entry->block_length, buf));
 }
 
index a6d6ed597e54470f18aec34b5de3f8b55810c26e..7a9d31b5a9a265f4a85c7e70e8e28f0b4d4b2424 100644 (file)
@@ -32,10 +32,10 @@ kg_make_seq_num(ed, direction, seqnum, cksum, buf)
 {
    unsigned char plain[8];
 
-   plain[0] = seqnum&0xff;
-   plain[1] = (seqnum>>8)&0xff;
-   plain[2] = (seqnum>>16)&0xff;
-   plain[3] = (seqnum>>24)&0xff;
+   plain[0] = (unsigned char) (seqnum&0xff);
+   plain[1] = (unsigned char) ((seqnum>>8)&0xff);
+   plain[2] = (unsigned char) ((seqnum>>16)&0xff);
+   plain[3] = (unsigned char) ((seqnum>>24)&0xff);
 
    plain[4] = direction;
    plain[5] = direction;