summaryrefslogtreecommitdiffstats
path: root/src/lib/gssapi/generic/gssapi.h
diff options
context:
space:
mode:
authorPaul Park <pjpark@mit.edu>1995-08-31 17:33:55 +0000
committerPaul Park <pjpark@mit.edu>1995-08-31 17:33:55 +0000
commita631ed069736a1dce90636b63a46dca6763d59b1 (patch)
tree34e438b382afbe8e27df9757b90a1cbd76d6538a /src/lib/gssapi/generic/gssapi.h
parentb94bd9276cc146246550181b7f0ebb2be8b992b2 (diff)
downloadkrb5-a631ed069736a1dce90636b63a46dca6763d59b1.tar.gz
krb5-a631ed069736a1dce90636b63a46dca6763d59b1.tar.xz
krb5-a631ed069736a1dce90636b63a46dca6763d59b1.zip
Update to GSSAPI-V2
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6638 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi/generic/gssapi.h')
-rw-r--r--src/lib/gssapi/generic/gssapi.h620
1 files changed, 418 insertions, 202 deletions
diff --git a/src/lib/gssapi/generic/gssapi.h b/src/lib/gssapi/generic/gssapi.h
index 7d41744448..7f79ca1bb4 100644
--- a/src/lib/gssapi/generic/gssapi.h
+++ b/src/lib/gssapi/generic/gssapi.h
@@ -23,21 +23,40 @@
#ifndef _GSSAPI_H_
#define _GSSAPI_H_
-/* for general config: */
-#ifndef NO_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-
/*
- * First, define the platform-dependent types.
+ * Determine platform-dependent configuration.
+ */
+#ifdef USE_AUTOCONF_H
+/*
+ * Use autoconf generated header.
+ */
+#include "autoconf.h"
+#define GSS_SIZEOF_INT SIZEOF_INT
+#define GSS_SIZEOF_LONG SIZEOF_LONG
+#define GSS_SIZEOF_SHORT SIZEOF_SHORT
+#else /* USE_AUTOCONF_H */
+/*
+ * Do it brute force.
*/
-
#ifdef _MSDOS
#define GSS_SIZEOF_INT 2
#define GSS_SIZEOF_SHORT 2
#define GSS_SIZEOF_LONG 4
+/* #define HAVE_STDDEF_H 1 */
+/* #define HAVE_XOM_H 1 */
+#else /* _MSDOS */
+#define GSS_SIZEOF_INT 4
+#define GSS_SIZEOF_LONG 4
+#define GSS_SIZEOF_SHORT 2
+/* #define HAVE_STDDEF_H 1 */
+/* #define HAVE_XOM_H 1 */
+#endif /* _MSDOS */
+#endif /* USE_AUTOCONF_H */
+/*
+ * Define INTERFACE, INTERFACE_C and FAR.
+ */
+#ifdef _MSDOS
#ifndef INTERFACE
#define INTERFACE __far __export __pascal
#define INTERFACE_C __far __export __cdecl
@@ -47,53 +66,80 @@
#define FAR _far
#endif /* FAR */
#else /* _MSDOS */
-/*
- * XXX we need to fix this to be modified by autoconf...
- */
-#define GSS_SIZEOF_INT 4
-#define GSS_SIZEOF_LONG 4
-#define GSS_SIZEOF_SHORT 2
#ifndef FAR
#define FAR
#define INTERFACE
#endif /* FAR */
#endif
-#if (GSS_SIZEOF_INT == 4)
-typedef unsigned int OM_uint32;
-#elif (GSS_SIZEOF_LONG == 4)
-typedef unsigned long OM_uint32;
-#elif (GSS_SIZEOF_SHORT == 4)
-typedef unsigned short OM_uint32;
+/*
+ * Make sure we have a definition for PROTOTYPE.
+ */
+#if !defined(PROTOTYPE)
+#if defined(__STDC__) || defined(_WINDOWS)
+#define PROTOTYPE(x) x
+#else
+#define PROTOTYPE(x) ()
#endif
+#endif
+
+/*
+ * First, include stddef.h to get size_t defined.
+ */
+#if HAVE_STDDEF_H
+#include <stddef.h>
+#endif /* HAVE_STDDEF_H */
+
+/*
+ * If the platform supports the xom.h header file, it should be included here.
+ */
+#if HAVE_XOM_H
+#include <xom.h>
+#endif /* HAVE_XOM_H */
+/*
+ * First, define the three platform-dependent pointer types.
+ */
typedef void FAR * gss_name_t;
typedef void FAR * gss_cred_id_t;
typedef void FAR * gss_ctx_id_t;
-#if !defined(PROTOTYPE)
-#if defined(__STDC__) || defined(_WINDOWS)
-#define PROTOTYPE(x) x
-#else
-#define PROTOTYPE(x) ()
+/*
+ * The following type must be defined as the smallest natural unsigned integer
+ * supported by the platform that has at least 32 bits of precision.
+ */
+#if (GSS_SIZEOF_SHORT == 4)
+typedef unsigned short gss_uint32;
+#elif (GSS_SIZEOF_INT == 4)
+typedef unsigned int gss_uint32;
+#elif (GSS_SIZEOF_LONG == 4)
+typedef unsigned long gss_uint32;
#endif
+
+#ifdef OM_STRING
+/*
+ * We have included the xom.h header file. Verify that OM_uint32 is defined
+ * correctly.
+ */
+#if sizeof(gss_uint32) != sizeof(OM_uint32)
+#error Incompatible definition of OM_uint32 from xom.h
#endif
+typedef OM_object_identifier gss_OID_desc, *gss_OID;
+#else /* OM_STRING */
/*
- * Note that a platform supporting the xom.h X/Open header file
- * may make use of that header for the definitions of OM_uint32
- * and the structure to which gss_OID_desc equates.
+ * We can't use X/Open definitions, so roll our own.
*/
+typedef gss_uint32 OM_uint32;
typedef struct gss_OID_desc_struct {
OM_uint32 length;
void FAR *elements;
} gss_OID_desc, FAR *gss_OID;
-
-typedef const gss_OID_desc FAR * const const_gss_OID;
+#endif /* OM_STRING */
typedef struct gss_OID_set_desc_struct {
- int count;
+ size_t count;
gss_OID elements;
} gss_OID_set_desc, FAR *gss_OID_set;
@@ -110,10 +156,15 @@ typedef struct gss_channel_bindings_struct {
gss_buffer_desc application_data;
} FAR *gss_channel_bindings_t;
+/*
+ * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
+ * discussions).
+ */
+typedef OM_uint32 gss_qop_t;
+typedef int gss_cred_usage_t;
/*
- * Six independent flags each of which indicates that a context
- * supports a specific service option.
+ * Flag bits for context-level services.
*/
#define GSS_C_DELEG_FLAG 1
#define GSS_C_MUTUAL_FLAG 2
@@ -121,7 +172,7 @@ typedef struct gss_channel_bindings_struct {
#define GSS_C_SEQUENCE_FLAG 8
#define GSS_C_CONF_FLAG 16
#define GSS_C_INTEG_FLAG 32
-
+#define GSS_C_ANON_FLAG 64
/*
* Credential usage options
@@ -163,22 +214,31 @@ typedef struct gss_channel_bindings_struct {
#define GSS_C_AF_NULLADDR 255
+/*
+ * Various Null values.
+ */
#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
-#define GSS_C_NULL_OID ((gss_OID) 0)
-#define GSS_C_NULL_OID_SET ((gss_OID_set) 0)
-#define GSS_C_NO_NAME ((gss_name_t) 0)
+#define GSS_C_NO_OID ((gss_OID) 0)
+#define GSS_C_NO_OID_SET ((gss_OID_set) 0)
#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
#define GSS_C_EMPTY_BUFFER {0, NULL}
/*
- * Define the default Quality of Protection for per-message
- * services. Note that an implementation that offers multiple
- * levels of QOP may either reserve a value (for example zero,
- * as assumed here) to mean "default protection", or alternatively
- * may simply equate GSS_C_QOP_DEFAULT to a specific explicit QOP
- * value.
+ * Some alternate names for a couple of the above values. These are defined
+ * for V1 compatibility.
+ */
+#define GSS_C_NULL_OID GSS_C_NO_OID
+#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
+
+/*
+ * Define the default Quality of Protection for per-message services. Note
+ * that an implementation that offers multiple levels of QOP may either reserve
+ * a value (for example zero, as assumed here) to mean "default protection", or
+ * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
+ * QOP value. However a value of 0 should always be interpreted by a GSSAPI
+ * implementation as a request for the default protection level.
*/
#define GSS_C_QOP_DEFAULT 0
@@ -186,7 +246,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 0xffffffff
+#define GSS_C_INDEFINITE 0xfffffffful
/* Major status codes */
@@ -199,12 +259,14 @@ typedef struct gss_channel_bindings_struct {
#define GSS_C_CALLING_ERROR_OFFSET 24
#define GSS_C_ROUTINE_ERROR_OFFSET 16
#define GSS_C_SUPPLEMENTARY_OFFSET 0
-#define GSS_C_CALLING_ERROR_MASK 0377
-#define GSS_C_ROUTINE_ERROR_MASK 0377
-#define GSS_C_SUPPLEMENTARY_MASK 0177777
+#define GSS_C_CALLING_ERROR_MASK 0377ul
+#define GSS_C_ROUTINE_ERROR_MASK 0377ul
+#define GSS_C_SUPPLEMENTARY_MASK 0177777ul
/*
- * The macros that test status codes for error conditions
+ * The macros that test status codes for error conditions. Note that the
+ * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
+ * evaluates its argument only once.
*/
#define GSS_CALLING_ERROR(x) \
((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
@@ -213,16 +275,8 @@ typedef struct gss_channel_bindings_struct {
#define GSS_SUPPLEMENTARY_INFO(x) \
((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
#define GSS_ERROR(x) \
- ((GSS_CALLING_ERROR(x) != 0) || (GSS_ROUTINE_ERROR(x) != 0))
-
-/* XXXX these are not part of the GSSAPI C bindings! (but should be) */
-
-#define GSS_CALLING_ERROR_FIELD(x) \
- (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
-#define GSS_ROUTINE_ERROR_FIELD(x) \
- (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
-#define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
- (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
+ ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
+ (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
/*
* Now the actual status code definitions
@@ -232,38 +286,39 @@ typedef struct gss_channel_bindings_struct {
* Calling errors:
*/
#define GSS_S_CALL_INACCESSIBLE_READ \
- (1 << GSS_C_CALLING_ERROR_OFFSET)
+ (1ul << GSS_C_CALLING_ERROR_OFFSET)
#define GSS_S_CALL_INACCESSIBLE_WRITE \
- (2 << GSS_C_CALLING_ERROR_OFFSET)
+ (2ul << GSS_C_CALLING_ERROR_OFFSET)
#define GSS_S_CALL_BAD_STRUCTURE \
- (3 << GSS_C_CALLING_ERROR_OFFSET)
+ (3ul << GSS_C_CALLING_ERROR_OFFSET)
/*
* Routine errors:
*/
-#define GSS_S_BAD_MECH (1 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_BAD_NAME (2 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_BAD_NAMETYPE (3 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_BAD_BINDINGS (4 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_BAD_STATUS (5 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_BAD_SIG (6 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_NO_CRED (7 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_NO_CONTEXT (8 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_DEFECTIVE_TOKEN (9 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_DEFECTIVE_CREDENTIAL (10 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_CREDENTIALS_EXPIRED (11 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_CONTEXT_EXPIRED (12 << GSS_C_ROUTINE_ERROR_OFFSET)
-#define GSS_S_FAILURE (13 << GSS_C_ROUTINE_ERROR_OFFSET)
-/* XXXX This is a necessary evil until the spec is fixed */
-#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
+#define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
/*
* Supplementary info bits:
*/
-#define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
-#define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
-#define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
-#define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
+#define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
+#define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
+#define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
+#define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
/*
@@ -271,185 +326,346 @@ typedef struct gss_channel_bindings_struct {
*/
OM_uint32 INTERFACE gss_acquire_cred
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_name_t, /* desired_name */
- OM_uint32, /* time_req */
- gss_OID_set, /* desired_mechs */
- int, /* cred_usage */
- gss_cred_id_t FAR *,/* output_cred_handle */
- gss_OID_set FAR *, /* actual_mechs */
- OM_uint32 FAR * /* time_rec */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_name_t, /* desired_name */
+ OM_uint32, /* time_req */
+ gss_OID_set, /* desired_mechs */
+ gss_cred_usage_t, /* cred_usage */
+ gss_cred_id_t FAR *, /* output_cred_handle */
+ gss_OID_set FAR *, /* actual_mechs */
+ OM_uint32 FAR * /* time_rec */
));
OM_uint32 INTERFACE gss_release_cred
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_cred_id_t FAR * /* cred_handle */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_cred_id_t FAR * /* cred_handle */
));
OM_uint32 INTERFACE gss_init_sec_context
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_cred_id_t, /* claimant_cred_handle */
- gss_ctx_id_t FAR *, /* context_handle */
- gss_name_t, /* target_name */
- const_gss_OID, /* mech_type */
- int, /* req_flags */
- OM_uint32, /* time_req */
- gss_channel_bindings_t,
- /* input_chan_bindings */
- gss_buffer_t, /* input_token */
- gss_OID FAR *, /* actual_mech_type */
- gss_buffer_t, /* output_token */
- int FAR *, /* ret_flags */
- OM_uint32 FAR * /* time_rec */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_cred_id_t, /* claimant_cred_handle */
+ gss_ctx_id_t FAR *, /* context_handle */
+ gss_name_t, /* target_name */
+ gss_OID, /* mech_type (used to be const) */
+ OM_uint32, /* req_flags */
+ OM_uint32, /* time_req */
+ gss_channel_bindings_t, /* input_chan_bindings */
+ gss_buffer_t, /* input_token */
+ gss_OID FAR *, /* actual_mech_type */
+ gss_buffer_t, /* output_token */
+ OM_uint32 FAR *, /* ret_flags */
+ OM_uint32 FAR * /* time_rec */
));
OM_uint32 INTERFACE gss_accept_sec_context
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t FAR *, /* context_handle */
- gss_cred_id_t, /* verifier_cred_handle */
- gss_buffer_t, /* input_token_buffer */
- gss_channel_bindings_t,
- /* input_chan_bindings */
- gss_name_t FAR *, /* src_name */
- gss_OID FAR *, /* mech_type */
- gss_buffer_t, /* output_token */
- int FAR *, /* ret_flags */
- OM_uint32 FAR *, /* time_rec */
- gss_cred_id_t FAR * /* delegated_cred_handle */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t FAR *, /* context_handle */
+ gss_cred_id_t, /* acceptor_cred_handle */
+ gss_buffer_t, /* input_token_buffer */
+ gss_channel_bindings_t, /* input_chan_bindings */
+ gss_name_t FAR *, /* src_name */
+ gss_OID FAR *, /* mech_type */
+ gss_buffer_t, /* output_token */
+ OM_uint32 FAR *, /* ret_flags */
+ OM_uint32 FAR *, /* time_rec */
+ gss_cred_id_t FAR * /* delegated_cred_handle */
));
OM_uint32 INTERFACE gss_process_context_token
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- gss_buffer_t /* token_buffer */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t /* token_buffer */
));
OM_uint32 INTERFACE gss_delete_sec_context
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t FAR *, /* context_handle */
- gss_buffer_t /* output_token */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t FAR *, /* context_handle */
+ gss_buffer_t /* output_token */
));
OM_uint32 INTERFACE gss_context_time
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- OM_uint32 FAR * /* time_rec */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ OM_uint32 FAR * /* time_rec */
));
-OM_uint32 INTERFACE gss_sign
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- int, /* qop_req */
- gss_buffer_t, /* message_buffer */
- gss_buffer_t /* message_token */
- ));
+/* New for V2 */
+OM_uint32 INTERFACE gss_get_mic
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_qop_t, /* qop_req */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t /* message_token */
+ ));
-OM_uint32 INTERFACE gss_verify
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- gss_buffer_t, /* message_buffer */
- gss_buffer_t, /* token_buffer */
- int FAR * /* qop_state */
- ));
+/* New for V2 */
+OM_uint32 INTERFACE gss_verify_mic
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t, /* message_token */
+ gss_qop_t * /* qop_state */
+ ));
-OM_uint32 INTERFACE gss_seal
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- int, /* conf_req_flag */
- int, /* qop_req */
- gss_buffer_t, /* input_message_buffer */
- int FAR *, /* conf_state */
- gss_buffer_t /* output_message_buffer */
- ));
+/* New for V2 */
+OM_uint32 INTERFACE gss_wrap
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* conf_req_flag */
+ gss_qop_t, /* qop_req */
+ gss_buffer_t, /* input_message_buffer */
+ int FAR *, /* conf_state */
+ gss_buffer_t /* output_message_buffer */
+ ));
-OM_uint32 INTERFACE gss_unseal
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- gss_buffer_t, /* input_message_buffer */
- gss_buffer_t, /* output_message_buffer */
- int FAR *, /* conf_state */
- int FAR * /* qop_state */
- ));
+/* New for V2 */
+OM_uint32 INTERFACE gss_unwrap
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* input_message_buffer */
+ gss_buffer_t, /* output_message_buffer */
+ int FAR *, /* conf_state */
+ gss_qop_t FAR * /* qop_state */
+ ));
OM_uint32 INTERFACE gss_display_status
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- OM_uint32, /* status_value */
- int, /* status_type */
- const_gss_OID, /* mech_type */
- int FAR *, /* message_context */
- gss_buffer_t /* status_string */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ OM_uint32, /* status_value */
+ int, /* status_type */
+ gss_OID, /* mech_type (used to be const) */
+ OM_uint32 FAR *, /* message_context */
+ gss_buffer_t /* status_string */
));
OM_uint32 INTERFACE gss_indicate_mechs
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_OID_set FAR * /* mech_set */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID_set FAR * /* mech_set */
));
OM_uint32 INTERFACE gss_compare_name
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_name_t, /* name1 */
- gss_name_t, /* name2 */
- int FAR * /* name_equal */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_name_t, /* name1 */
+ gss_name_t, /* name2 */
+ int FAR * /* name_equal */
));
OM_uint32 INTERFACE gss_display_name
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_name_t, /* input_name */
- gss_buffer_t, /* output_name_buffer */
- gss_OID FAR * /* output_name_type */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_name_t, /* input_name */
+ gss_buffer_t, /* output_name_buffer */
+ gss_OID FAR * /* output_name_type */
));
OM_uint32 INTERFACE gss_import_name
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_buffer_t, /* input_name_buffer */
- const_gss_OID, /* input_name_type */
- gss_name_t FAR * /* output_name */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_buffer_t, /* input_name_buffer */
+ gss_OID, /* input_name_type(used to be const) */
+ gss_name_t FAR * /* output_name */
));
OM_uint32 INTERFACE gss_release_name
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_name_t FAR * /* input_name */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_name_t FAR * /* input_name */
));
OM_uint32 INTERFACE gss_release_buffer
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_buffer_t /* buffer */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_buffer_t /* buffer */
));
OM_uint32 INTERFACE gss_release_oid_set
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_OID_set FAR * /* set */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID_set FAR * /* set */
));
OM_uint32 INTERFACE gss_inquire_cred
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_cred_id_t, /* cred_handle */
- gss_name_t FAR *, /* name */
- OM_uint32 FAR *, /* lifetime */
- int FAR *, /* cred_usage */
- gss_OID_set FAR * /* mechanisms */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_cred_id_t, /* cred_handle */
+ gss_name_t FAR *, /* name */
+ OM_uint32 FAR *, /* lifetime */
+ gss_cred_usage_t FAR *, /* cred_usage */
+ gss_OID_set FAR * /* mechanisms */
));
+/* Last argument new for V2 */
OM_uint32 INTERFACE gss_inquire_context
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t, /* context_handle */
- gss_name_t FAR *, /* initiator_name */
- gss_name_t FAR *, /* acceptor_name */
- OM_uint32 FAR *, /* lifetime_rec */
- gss_OID FAR *, /* mech_type */
- int FAR *, /* ret_flags */
- int FAR * /* locally_initiated */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_name_t FAR *, /* src_name */
+ gss_name_t FAR *, /* targ_name */
+ OM_uint32 FAR *, /* lifetime_rec */
+ gss_OID FAR *, /* mech_type */
+ OM_uint32 FAR *, /* ctx_flags */
+ int FAR *, /* locally_initiated */
+ int FAR * /* open */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_wrap_size_limit
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* conf_req_flag */
+ gss_qop_t, /* qop_req */
+ OM_uint32, /* req_output_size */
+ OM_uint32 * /* max_input_size */
));
+/* New for V2 */
+OM_uint32 INTERFACE gss_import_name_object
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ void FAR *, /* input_name */
+ gss_OID, /* input_name_type */
+ gss_name_t FAR * /* output_name */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_export_name_object
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_name_t, /* input_name */
+ gss_OID, /* desired_name_type */
+ void FAR * FAR * /* output_name */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_add_cred
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_cred_id_t, /* input_cred_handle */
+ gss_name_t, /* desired_name */
+ gss_OID, /* desired_mech */
+ gss_cred_usage_t, /* cred_usage */
+ OM_uint32, /* initiator_time_req */
+ OM_uint32, /* acceptor_time_req */
+ gss_cred_id_t FAR *, /* output_cred_handle */
+ gss_OID_set FAR *, /* actual_mechs */
+ OM_uint32 FAR *, /* initiator_time_rec */
+ OM_uint32 FAR * /* acceptor_time_rec */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_inquire_cred_by_mech
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_cred_id_t, /* cred_handle */
+ gss_OID, /* mech_type */
+ gss_name_t FAR *, /* name */
+ OM_uint32 FAR *, /* initiator_lifetime */
+ OM_uint32 FAR *, /* acceptor_lifetime */
+ gss_cred_usage_t FAR * /* cred_usage */
+ ));
+
+/* New for V2 */
OM_uint32 INTERFACE gss_export_sec_context
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_ctx_id_t FAR *, /* context_handle */
- gss_buffer_t /* interprocess_token */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t FAR *, /* context_handle */
+ gss_buffer_t /* interprocess_token */
));
+/* New for V2 */
OM_uint32 INTERFACE gss_import_sec_context
-PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
- gss_buffer_t, /* interprocess_token */
- gss_ctx_id_t FAR * /* context_handle */
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_buffer_t, /* interprocess_token */
+ gss_ctx_id_t FAR * /* context_handle */
));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_release_oid
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID FAR * /* oid */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_create_empty_oid_set
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID_set FAR * /* oid_set */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_add_oid_set_member
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID, /* member_oid */
+ gss_OID_set FAR * /* oid_set */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_test_oid_set_member
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID, /* member */
+ gss_OID_set, /* set */
+ int FAR * /* present */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_str_to_oid
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_buffer_t, /* oid_str */
+ gss_OID FAR * /* oid */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_oid_to_str
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID, /* oid */
+ gss_buffer_t /* oid_str */
+ ));
+
+/* New for V2 */
+OM_uint32 INTERFACE gss_inquire_names_for_mech
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_OID, /* mechanism */
+ gss_OID_set FAR * /* name_types */
+ ));
+
+/*
+ * The following routines are obsolete variants of gss_get_mic, gss_wrap,
+ * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2
+ * implementations for backwards compatibility with V1 applications. Distinct
+ * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
+ * V1 applications to link against GSSAPI V2 implementations.
+ */
+OM_uint32 INTERFACE gss_sign
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* qop_req */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t /* message_token */
+ ));
+
+OM_uint32 INTERFACE gss_verify
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t, /* token_buffer */
+ int FAR * /* qop_state */
+ ));
+
+OM_uint32 INTERFACE gss_seal
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* conf_req_flag */
+ int, /* qop_req */
+ gss_buffer_t, /* input_message_buffer */
+ int FAR *, /* conf_state */
+ gss_buffer_t /* output_message_buffer */
+ ));
+
+OM_uint32 INTERFACE gss_unseal
+PROTOTYPE( (OM_uint32 FAR *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* input_message_buffer */
+ gss_buffer_t, /* output_message_buffer */
+ int FAR *, /* conf_state */
+ int FAR * /* qop_state */
+ ));
+
+/* XXXX these are not part of the GSSAPI C bindings! (but should be) */
+
+#define GSS_CALLING_ERROR_FIELD(x) \
+ (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
+#define GSS_ROUTINE_ERROR_FIELD(x) \
+ (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
+#define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
+ (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
+
+/* XXXX This is a necessary evil until the spec is fixed */
+#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
+
#endif /* _GSSAPI_H_ */