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;
/**/
-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;
/* 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;
/* 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;
/* 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;
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;
#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>
/*
* 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 */
*/
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 */
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 */
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 */
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 */
gss_OID*, /* mech_type */
int*, /* ret_flags */
int* /* locally_initiated */
- );
+ ));
#endif /* _GSSAPI_H_ */
/** 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_ */
#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)) {
* $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;
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;
/* 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;
*/
#include "gssapiP_generic.h"
-#include <string.h>
-char *g_strdup(char *str)
+char *g_strdup(str)
+ char *str;
{
char *ret;
*/
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;
*/
-static int der_length_size(int length)
+static int der_length_size(length)
+ int length;
{
if (length < (1<<7))
return(1);
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;
/* 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;
/* 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;
/* 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);
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;
/* 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;
}