"downgrade" to classic C, tweak headers a bit
authorMark Eichin <eichin@mit.edu>
Fri, 10 Jun 1994 19:02:23 +0000 (19:02 +0000)
committerMark Eichin <eichin@mit.edu>
Fri, 10 Jun 1994 19:02:23 +0000 (19:02 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3715 dc483132-0cff-0310-8789-dd5450dbe970

12 files changed:
src/lib/gssapi/generic/display_com_err_status.c
src/lib/gssapi/generic/display_major_status.c
src/lib/gssapi/generic/gssapi.h
src/lib/gssapi/generic/gssapiP_generic.h
src/lib/gssapi/generic/release_buffer.c
src/lib/gssapi/generic/release_oid_set.c
src/lib/gssapi/generic/util_buffer.c
src/lib/gssapi/generic/util_canonhost.c
src/lib/gssapi/generic/util_dup.c
src/lib/gssapi/generic/util_oid.c
src/lib/gssapi/generic/util_token.c
src/lib/gssapi/generic/util_val_nohash.c

index 0a36f91b4cf682eefa9835cbc53f27a12025ad13..08ba6d4359d18f37645225b9914455a5feacc8c3 100644 (file)
@@ -44,10 +44,10 @@ static const char * const no_error = "No error";
    if status_type == GSS_C_MECH_CODE, return the output from error_message()
    */
 
-OM_uint32
-g_display_com_err_status(OM_uint32 *minor_status,
-                        OM_uint32 status_value,
-                        gss_buffer_t status_string)
+OM_uint32 g_display_com_err_status(minor_status, status_value, status_string)
+     OM_uint32 *minor_status;
+     OM_uint32 status_value;
+     gss_buffer_t status_string;
 {
    status_string->length = 0;
    status_string->value = NULL;
index 0216cf11668a8c2336134b209576df28c83730ac..19d8b335506113c044c99a05fa9f972aabb8a3d4 100644 (file)
@@ -102,8 +102,10 @@ static const char * const unknown_error = "Unknown %s (field = %d)";
 
 /**/
 
-int display_unknown(const char *kind, OM_uint32 value,
-               gss_buffer_t buffer)
+int display_unknown(kind, value, buffer)
+     const char *kind;
+     OM_uint32 value;
+     gss_buffer_t buffer;
 {
    int len;
    char *str;
@@ -122,10 +124,10 @@ int display_unknown(const char *kind, OM_uint32 value,
 
 /* code should be set to the calling error field */
 
-static OM_uint32
-   display_calling(OM_uint32 *minor_status,
-                  OM_uint32 code,
-                  gss_buffer_t status_string)
+static OM_uint32 display_calling(minor_status, code, status_string)
+     OM_uint32 *minor_status;
+     OM_uint32 code;
+     gss_buffer_t status_string;
 {
    const char *str;
 
@@ -147,10 +149,10 @@ static OM_uint32
 
 /* code should be set to the routine error field */
 
-static OM_uint32
-   display_routine(OM_uint32 *minor_status,
-                  OM_uint32 code,
-                  gss_buffer_t status_string)
+static OM_uint32 display_routine(minor_status, code, status_string)
+     OM_uint32 *minor_status;
+     OM_uint32 code;
+     gss_buffer_t status_string;
 {
    const char *str;
 
@@ -172,10 +174,10 @@ static OM_uint32
 
 /* code should be set to the bit offset (log_2) of a supplementary info bit */
 
-static OM_uint32
-   display_bit(OM_uint32 *minor_status,
-              OM_uint32 code,
-              gss_buffer_t status_string)
+static OM_uint32 display_bit(minor_status, code, status_string)
+     OM_uint32 *minor_status;
+     OM_uint32 code;
+     gss_buffer_t status_string;
 {
    const char *str;
 
@@ -203,11 +205,12 @@ static OM_uint32
      message_context > 2  : print supplementary info bit (message_context-2)
      */
 
-OM_uint32
-g_display_major_status(OM_uint32 *minor_status,
-                      OM_uint32 status_value,
-                      int *message_context,
-                      gss_buffer_t status_string)
+OM_uint32 g_display_major_status(minor_status, status_value, 
+                                message_context, status_string)
+     OM_uint32 *minor_status;
+     OM_uint32 status_value;
+     int *message_context;
+     gss_buffer_t status_string;
 {
    OM_uint32 ret, tmp;
    int bit;
index c2a9af05fc4e4beb2ef64253f608682a6adbcbcd..94600311607cd897eea3bbd52ff0e51a961f4690 100644 (file)
 #ifndef _GSSAPI_H_
 #define _GSSAPI_H_
 
+/* for general config: */
+#include <krb5/osconf.h>
+/* for prototype-related config: */
+#include <krb5/base-defs.h>
+#ifndef NO_STDLIB_H
 #include <stdlib.h>
+#endif
 #include <stdio.h>
 
 /*
@@ -145,7 +151,7 @@ typedef struct gss_channel_bindings_struct {
  * Expiration time of 2^32-1 seconds means infinite lifetime for a
  * credential or security context
  */
-#define GSS_C_INDEFINITE 0xffffffffu
+#define GSS_C_INDEFINITE 0xffffffff
 
 
 /* Major status codes */
@@ -230,7 +236,7 @@ typedef struct gss_channel_bindings_struct {
  */
 
 OM_uint32 gss_acquire_cred
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_name_t,       /* desired_name */
             OM_uint32,        /* time_req */
             gss_OID_set,      /* desired_mechs */
@@ -238,15 +244,15 @@ OM_uint32 gss_acquire_cred
             gss_cred_id_t*,   /* output_cred_handle */
             gss_OID_set*,     /* actual_mechs */
             OM_uint32*        /* time_rec */
-           );
+           ));
 
 OM_uint32 gss_release_cred
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_cred_id_t*    /* cred_handle */
-           );
+           ));
 
 OM_uint32 gss_init_sec_context
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_cred_id_t,    /* claimant_cred_handle */
             gss_ctx_id_t*,    /* context_handle */
             gss_name_t,       /* target_name */
@@ -260,10 +266,10 @@ OM_uint32 gss_init_sec_context
             gss_buffer_t,     /* output_token */
             int*,             /* ret_flags */
             OM_uint32*        /* time_rec */
-           );
+           ));
 
 OM_uint32 gss_accept_sec_context
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t*,    /* context_handle */
             gss_cred_id_t,    /* verifier_cred_handle */
             gss_buffer_t,     /* input_token_buffer */
@@ -275,122 +281,122 @@ OM_uint32 gss_accept_sec_context
             int*,             /* ret_flags */
             OM_uint32*,       /* time_rec */
             gss_cred_id_t*    /* delegated_cred_handle */
-           );
+           ));
 
 OM_uint32 gss_process_context_token
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t,     /* context_handle */
             gss_buffer_t      /* token_buffer */
-           );
+           ));
 
 OM_uint32 gss_delete_sec_context
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t*,    /* context_handle */
             gss_buffer_t      /* output_token */
-           );
+           ));
 
 OM_uint32 gss_context_time
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t,     /* context_handle */
             OM_uint32*        /* time_rec */
-           );
+           ));
 
 OM_uint32 gss_sign
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t,     /* context_handle */
             int,              /* qop_req */
             gss_buffer_t,     /* message_buffer */
             gss_buffer_t      /* message_token */
-           );
+           ));
 
 OM_uint32 gss_verify
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t,     /* context_handle */
             gss_buffer_t,     /* message_buffer */
             gss_buffer_t,     /* token_buffer */
             int*              /* qop_state */
-           );
+           ));
 
 OM_uint32 gss_seal
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t,     /* context_handle */
             int,              /* conf_req_flag */
             int,              /* qop_req */
             gss_buffer_t,     /* input_message_buffer */
             int*,             /* conf_state */
             gss_buffer_t      /* output_message_buffer */
-           );
+           ));
 
 OM_uint32 gss_unseal
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_ctx_id_t,     /* context_handle */
             gss_buffer_t,     /* input_message_buffer */
             gss_buffer_t,     /* output_message_buffer */
             int*,             /* conf_state */
             int*              /* qop_state */
-           );
+           ));
 
 OM_uint32 gss_display_status
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             OM_uint32,        /* status_value */
             int,              /* status_type */
             const_gss_OID,    /* mech_type */
             int*,             /* message_context */
             gss_buffer_t      /* status_string */
-           );
+           ));
 
 OM_uint32 gss_indicate_mechs
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_OID_set*      /* mech_set */
-           );
+           ));
 
 OM_uint32 gss_compare_name
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_name_t,       /* name1 */
             gss_name_t,       /* name2 */
             int*              /* name_equal */
-           );
+           ));
 
 OM_uint32 gss_display_name
-           (OM_uint32*,      /* minor_status */
+PROTOTYPE( (OM_uint32*,      /* minor_status */
             gss_name_t,      /* input_name */
             gss_buffer_t,     /* output_name_buffer */
             gss_OID*         /* output_name_type */
-           );
+           ));
 
 OM_uint32 gss_import_name
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_buffer_t,     /* input_name_buffer */
             const_gss_OID,    /* input_name_type */
             gss_name_t*       /* output_name */
-           );
+           ));
 
 OM_uint32 gss_release_name
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_name_t*       /* input_name */
-           );
+           ));
 
 OM_uint32 gss_release_buffer
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_buffer_t      /* buffer */
-           );
+           ));
 
 OM_uint32 gss_release_oid_set
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_OID_set*      /* set */
-           );
+           ));
 
 OM_uint32 gss_inquire_cred
-           (OM_uint32 *,      /* minor_status */
+PROTOTYPE( (OM_uint32 *,      /* minor_status */
             gss_cred_id_t,    /* cred_handle */
             gss_name_t *,     /* name */
             OM_uint32 *,      /* lifetime */
             int *,            /* cred_usage */
             gss_OID_set *     /* mechanisms */
-           );
+           ));
 
 OM_uint32 gss_inquire_context
-          (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
            gss_ctx_id_t,     /* context_handle */
            gss_name_t*,      /* initiator_name */
            gss_name_t*,      /* acceptor_name */
@@ -398,7 +404,7 @@ OM_uint32 gss_inquire_context
            gss_OID*,         /* mech_type */
            int*,             /* ret_flags */
            int*              /* locally_initiated */
-          );
+          ));
 
 
 #endif /* _GSSAPI_H_ */
index 7626ce411de58509f061f83a108a2d5c914c2086..6a640f3ce674fb530f4053881855530ea6e879db 100644 (file)
 
 /** helper functions **/
 
-int g_save_name(void **vdb, gss_name_t *name);
-int g_save_cred_id(void **vdb, gss_cred_id_t *cred);
-int g_save_ctx_id(void **vdb, gss_ctx_id_t *ctx);
+int g_save_name PROTOTYPE((void **vdb, gss_name_t *name));
+int g_save_cred_id PROTOTYPE((void **vdb, gss_cred_id_t *cred));
+int g_save_ctx_id PROTOTYPE((void **vdb, gss_ctx_id_t *ctx));
 
-int g_validate_name(void **vdb, gss_name_t *name);
-int g_validate_cred_id(void **vdb, gss_cred_id_t *cred);
-int g_validate_ctx_id(void **vdb, gss_ctx_id_t *ctx);
+int g_validate_name PROTOTYPE((void **vdb, gss_name_t *name));
+int g_validate_cred_id PROTOTYPE((void **vdb, gss_cred_id_t *cred));
+int g_validate_ctx_id PROTOTYPE((void **vdb, gss_ctx_id_t *ctx));
 
-int g_delete_name(void **vdb, gss_name_t *name);
-int g_delete_cred_id(void **vdb, gss_cred_id_t *cred);
-int g_delete_ctx_id(void **vdb, gss_ctx_id_t *ctx);
+int g_delete_name PROTOTYPE((void **vdb, gss_name_t *name));
+int g_delete_cred_id PROTOTYPE((void **vdb, gss_cred_id_t *cred));
+int g_delete_ctx_id PROTOTYPE((void **vdb, gss_ctx_id_t *ctx));
 
-int g_make_string_buffer(const char *str, gss_buffer_t buffer);
+int g_make_string_buffer PROTOTYPE((const char *str, gss_buffer_t buffer));
 
-int g_copy_OID_set(const gss_OID_set_desc * const in, gss_OID_set *out);
+int g_copy_OID_set PROTOTYPE((const gss_OID_set_desc * const in, gss_OID_set *out));
 
-int g_token_size(const_gss_OID mech, unsigned int body_size);
+int g_token_size PROTOTYPE((const_gss_OID mech, unsigned int body_size));
 
-void g_make_token_header(const_gss_OID mech, int body_size,
-                         unsigned char **buf, int tok_type);
+void g_make_token_header PROTOTYPE((const_gss_OID mech, int body_size,
+                         unsigned char **buf, int tok_type));
 
-int g_verify_token_header(const_gss_OID mech, int *body_size,
-                         unsigned char **buf, int tok_type, int toksize);
+int g_verify_token_header PROTOTYPE((const_gss_OID mech, int *body_size,
+                         unsigned char **buf, int tok_type, int toksize));
 
-OM_uint32 g_display_major_status(OM_uint32 *minor_status,
+OM_uint32 g_display_major_status PROTOTYPE((OM_uint32 *minor_status,
                                 OM_uint32 status_value,
                                 int *message_context,
-                                gss_buffer_t status_string);
+                                gss_buffer_t status_string));
 
-OM_uint32 g_display_com_err_status(OM_uint32 *minor_status,
+OM_uint32 g_display_com_err_status PROTOTYPE((OM_uint32 *minor_status,
                                   OM_uint32 status_value,
-                                  gss_buffer_t status_string);
+                                  gss_buffer_t status_string));
 
-char *g_canonicalize_host(char *hostname);
+char *g_canonicalize_host PROTOTYPE((char *hostname));
 
-char *g_strdup(char *str);
+char *g_strdup PROTOTYPE((char *str));
 
 /** declarations of internal name mechanism functions **/
 
 OM_uint32 generic_gss_release_buffer
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_buffer_t      /* buffer */
-           );
+           ));
 
 OM_uint32 generic_gss_release_oid_set
-           (OM_uint32*,       /* minor_status */
+PROTOTYPE( (OM_uint32*,       /* minor_status */
             gss_OID_set*      /* set */
-           );
+           ));
 
 #endif /* _GSSAPIP_GENERIC_H_ */
index ecb8eab082a21c4c6c01a87d8fab0b27ccc7ae2e..f3b5fa7944c1af8a71ba80624533671f6e1ddd78 100644 (file)
@@ -26,9 +26,9 @@
 
 #include "gssapiP_generic.h"
 
-OM_uint32
-generic_gss_release_buffer(OM_uint32 *minor_status,
-                          gss_buffer_t buffer)
+OM_uint32 generic_gss_release_buffer(minor_status, buffer)
+     OM_uint32 *minor_status;
+     gss_buffer_t buffer;
 {
    if ((buffer->length) &&
        (buffer->value)) {
index e821e6eec050e05d1573f6a5d65895f5fdbde358..7b7754530bd66a4deaed2bb191d5456c4583d07d 100644 (file)
@@ -26,9 +26,9 @@
  * $Id$
  */
 
-OM_uint32
-generic_gss_release_oid_set(OM_uint32 *minor_status,
-                           gss_OID_set *set)
+OM_uint32 generic_gss_release_oid_set(minor_status, set)
+     OM_uint32 *minor_status;
+     gss_OID_set *set;
 {
    *minor_status = 0;
 
index 63c10522e955d9c355061ee2e3f3e7ef78f40c07..e715834d9279fc56635532f0a4d0a58aacab8550 100644 (file)
@@ -31,7 +31,9 @@
    make sure that buffer is consistent (release'able) when this
    function exits, no matter what the exit value */
 
-int g_make_string_buffer(const char *str, gss_buffer_t buffer)
+int g_make_string_buffer(str, buffer)
+     const char *str;
+     gss_buffer_t buffer;
 {
    buffer->length = strlen(str)+1;
 
index 277c07836d37ce8e4b88ee41ee32c32c5ce3981a..34a7e48c577b6df8e6a12f6c65e54ba4b2bd5caa 100644 (file)
 
 /* This file could be OS specific */
 
+#include "gssapiP_generic.h"
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
-#include <string.h>
-
-#include "gssapiP_generic.h"
 
-char *g_canonicalize_host(char *hostname)
+char *g_canonicalize_host(hostname)
+     char *hostname;
 {
    struct hostent *hent;
    char *haddr;
index 4da654719346870421cc2ce9ee9917a1f258bdfc..f8a86b08b16e274d269a5c9ee144399bd373e353 100644 (file)
@@ -25,9 +25,9 @@
  */
 
 #include "gssapiP_generic.h"
-#include <string.h>
 
-char *g_strdup(char *str)
+char *g_strdup(str)
+     char *str;
 {
    char *ret;
 
index 40f730a3643480659bd2840947ab96043942ce32..961a6243f710558d4654b5dd4dfd775511bbda08 100644 (file)
@@ -27,7 +27,9 @@
  */
 
 int
-g_copy_OID_set(const gss_OID_set_desc * const in, gss_OID_set *out)
+g_copy_OID_set(in, out)
+     const gss_OID_set_desc * const in;
+     gss_OID_set *out;
 {
    gss_OID_set copy;
    int i;
index 3fad4b9e5192dce07c6aeb7cff55566a2e5ca703..c25b9413d0b2944be45835e92c741f1bb66d9ead 100644 (file)
@@ -51,7 +51,8 @@ first two inner bytes, which indicate the token type.  The token
 
 */
 
-static int der_length_size(int length)
+static int der_length_size(length)
+     int length;
 {
    if (length < (1<<7))
       return(1);
@@ -65,7 +66,9 @@ static int der_length_size(int length)
       return(5);
 }
 
-static void der_write_length(unsigned char **buf, int length)
+static void der_write_length(buf, length)
+     unsigned char **buf;
+     int length;
 {
    if (length < (1<<7)) {
       *(*buf)++ = (unsigned char) length;
@@ -84,7 +87,9 @@ static void der_write_length(unsigned char **buf, int length)
 /* returns decoded length, or < 0 on failure.  Advances buf and
    decrements bufsize */
 
-static int der_read_length(unsigned char **buf, int *bufsize)
+static int der_read_length(buf, bufsize)
+     unsigned char **buf;
+     int *bufsize;
 {
    unsigned char sf;
    int ret;
@@ -110,7 +115,9 @@ static int der_read_length(unsigned char **buf, int *bufsize)
 
 /* returns the length of a token, given the mech oid and the body size */
 
-int g_token_size(const_gss_OID mech, unsigned int body_size)
+int g_token_size(mech, body_size)
+     const_gss_OID mech;
+     unsigned int body_size;
 {
    /* set body_size to sequence contents size */
    body_size += 4 + mech->length;
@@ -120,8 +127,11 @@ int g_token_size(const_gss_OID mech, unsigned int body_size)
 /* fills in a buffer with the token header.  The buffer is assumed to
    be the right size.  buf is advanced past the token header */
 
-void g_make_token_header(const_gss_OID mech, int body_size,
-                         unsigned char **buf, int tok_type)
+void g_make_token_header(mech, body_size, buf, tok_type)
+     const_gss_OID mech;
+     int body_size;
+     unsigned char **buf;
+     int tok_type;
 {
    *(*buf)++ = 0x60;
    der_write_length(buf, 4 + mech->length + body_size);
@@ -136,8 +146,12 @@ void g_make_token_header(const_gss_OID mech, int body_size,
    leaving buf advanced past the token header, and setting body_size
    to the number of remaining bytes */
 
-int g_verify_token_header(const_gss_OID mech, int *body_size,
-                         unsigned char **buf, int tok_type, int toksize)
+int g_verify_token_header(mech, body_size, buf, tok_type, toksize)
+     const_gss_OID mech;
+     int *body_size;
+     unsigned char **buf;
+     int tok_type;
+     int toksize;
 {
    int seqsize;
    gss_OID_desc toid;
index 3a6ff7e45116c7faddcd77a4b09a2b845396ee3d..824d4e1eb251e18bca28ed140d9a5e94f1cecaf5 100644 (file)
 
 /* save */
 
-int g_save_name(void **vdb, gss_name_t *name)
+int g_save_name(vdb, name)
+     void **vdb;
+     gss_name_t *name;
 {
        return 1;
 }
-int g_save_cred_id(void **vdb, gss_cred_id_t *cred)
+int g_save_cred_id(vdb, cred)
+     void **vdb;
+     gss_cred_id_t *cred;
 {
        return 1;
 }
-int g_save_ctx_id(void **vdb, gss_ctx_id_t *ctx)
+int g_save_ctx_id(vdb, ctx)
+     void **vdb;
+     gss_ctx_id_t *ctx;
 {
        return 1;
 }
 
 /* validate */
 
-int g_validate_name(void **vdb, gss_name_t *name)
+int g_validate_name(vdb, name)
+     void **vdb;
+     gss_name_t *name;
 {
        return 1;
 }
-int g_validate_cred_id(void **vdb, gss_cred_id_t *cred)
+int g_validate_cred_id(vdb, cred)
+     void **vdb;
+     gss_cred_id_t *cred;
 {
        return 1;
 }
-int g_validate_ctx_id(void **vdb, gss_ctx_id_t *ctx)
+int g_validate_ctx_id(vdb, ctx)
+     void **vdb;
+     gss_ctx_id_t *ctx;
 {
        return 1;
 }
 
 /* delete */
 
-int g_delete_name(void **vdb, gss_name_t *name)
+int g_delete_name(vdb, name)
+     void **vdb;
+     gss_name_t *name;
 {
        return 1;
 }
-int g_delete_cred_id(void **vdb, gss_cred_id_t *cred)
+int g_delete_cred_id(vdb, cred)
+     void **vdb;
+     gss_cred_id_t *cred;
 {
        return 1;
 }
-int g_delete_ctx_id(void **vdb, gss_ctx_id_t *ctx)
+int g_delete_ctx_id(vdb, ctx)
+     void **vdb;
+     gss_ctx_id_t *ctx;
 {
        return 1;
 }