src/java.security.jgss/share/native/libj2gss/gssapi.h
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 49682 2918e1146106
child 58679 9c3209ff7550
--- a/src/java.security.jgss/share/native/libj2gss/gssapi.h	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/java.security.jgss/share/native/libj2gss/gssapi.h	Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC)
 #    pragma pack(push,2)
 #endif
 
@@ -57,9 +57,17 @@
  */
 #include <sys/types.h>
 
-typedef void * gss_name_t;
-typedef void * gss_cred_id_t;
-typedef void * gss_ctx_id_t;
+struct gss_name_struct;
+typedef struct gss_name_struct * gss_name_t;
+typedef const struct gss_name_struct *gss_const_name_t;
+
+struct gss_cred_id_struct;
+typedef struct gss_cred_id_struct * gss_cred_id_t;
+typedef const struct gss_cred_id_struct *gss_const_cred_id_t;
+
+struct gss_ctx_id_struct;
+typedef struct gss_ctx_id_struct * gss_ctx_id_t;
+typedef const struct gss_ctx_id_struct *gss_const_ctx_id_t;
 
 /*
  * The following type must be defined as the smallest natural unsigned integer
@@ -82,16 +90,19 @@
       OM_uint32 length;
       void *elements;
 } gss_OID_desc, *gss_OID;
+typedef const gss_OID_desc * gss_const_OID;
 
 typedef struct gss_OID_set_desc_struct  {
       size_t  count;
       gss_OID elements;
 } gss_OID_set_desc, *gss_OID_set;
+typedef const gss_OID_set_desc * gss_const_OID_set;
 
 typedef struct gss_buffer_desc_struct {
       size_t length;
       void *value;
 } gss_buffer_desc, *gss_buffer_t;
+typedef const gss_buffer_desc * gss_const_buffer_t;
 
 typedef struct gss_channel_bindings_struct {
       OM_uint32 initiator_addrtype;
@@ -100,6 +111,7 @@
       gss_buffer_desc acceptor_address;
       gss_buffer_desc application_data;
 } *gss_channel_bindings_t;
+typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t;
 
 /*
  * For now, define a QOP-type as an OM_uint32
@@ -119,6 +131,7 @@
 #define GSS_C_ANON_FLAG 64
 #define GSS_C_PROT_READY_FLAG 128
 #define GSS_C_TRANS_FLAG 256
+#define GSS_C_DELEG_POLICY_FLAG 32768
 
 /*
  * Credential usage options
@@ -389,9 +402,9 @@
 
 GSS_DLLIMP OM_uint32 gss_acquire_cred(
         OM_uint32 *,            /* minor_status */
-        gss_name_t,             /* desired_name */
+        gss_const_name_t,       /* desired_name */
         OM_uint32,              /* time_req */
-        gss_OID_set,            /* desired_mechs */
+        gss_const_OID_set,      /* desired_mechs */
         gss_cred_usage_t,       /* cred_usage */
         gss_cred_id_t *,        /* output_cred_handle */
         gss_OID_set *,          /* actual_mechs */
@@ -405,14 +418,14 @@
 
 GSS_DLLIMP OM_uint32 gss_init_sec_context(
         OM_uint32 *,            /* minor_status */
-        gss_cred_id_t,          /* claimant_cred_handle */
+        gss_const_cred_id_t,    /* claimant_cred_handle */
         gss_ctx_id_t *,         /* context_handle */
-        gss_name_t,             /* target_name */
-        gss_OID,                /* mech_type (used to be const) */
+        gss_const_name_t,       /* target_name */
+        gss_const_OID,          /* mech_type */
         OM_uint32,              /* req_flags */
         OM_uint32,              /* time_req */
-        gss_channel_bindings_t, /* input_chan_bindings */
-        gss_buffer_t,           /* input_token */
+        gss_const_channel_bindings_t, /* input_chan_bindings */
+        gss_const_buffer_t,     /* input_token */
         gss_OID *,              /* actual_mech_type */
         gss_buffer_t,           /* output_token */
         OM_uint32 *,            /* ret_flags */
@@ -422,9 +435,9 @@
 GSS_DLLIMP OM_uint32 gss_accept_sec_context(
         OM_uint32 *,            /* minor_status */
         gss_ctx_id_t *,         /* context_handle */
-        gss_cred_id_t,          /* acceptor_cred_handle */
-        gss_buffer_t,           /* input_token_buffer */
-        gss_channel_bindings_t, /* input_chan_bindings */
+        gss_const_cred_id_t,    /* acceptor_cred_handle */
+        gss_const_buffer_t,     /* input_token_buffer */
+        gss_const_channel_bindings_t, /* input_chan_bindings */
         gss_name_t *,           /* src_name */
         gss_OID *,              /* mech_type */
         gss_buffer_t,           /* output_token */
@@ -435,8 +448,8 @@
 
 GSS_DLLIMP OM_uint32 gss_process_context_token(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
-        gss_buffer_t            /* token_buffer */
+        gss_const_ctx_id_t,     /* context_handle */
+        gss_const_buffer_t      /* token_buffer */
 );
 
 GSS_DLLIMP OM_uint32 gss_delete_sec_context(
@@ -447,35 +460,35 @@
 
 GSS_DLLIMP OM_uint32 gss_context_time(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
+        gss_const_ctx_id_t,     /* context_handle */
         OM_uint32 *             /* time_rec */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_get_mic(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
+        gss_const_ctx_id_t,     /* context_handle */
         gss_qop_t,              /* qop_req */
-        gss_buffer_t,           /* message_buffer */
+        gss_const_buffer_t,     /* message_buffer */
         gss_buffer_t            /* message_token */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_verify_mic(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
-        gss_buffer_t,           /* message_buffer */
-        gss_buffer_t,           /* message_token */
+        gss_const_ctx_id_t,     /* context_handle */
+        gss_const_buffer_t,     /* message_buffer */
+        gss_const_buffer_t,     /* message_token */
         gss_qop_t *             /* qop_state */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_wrap(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
+        gss_const_ctx_id_t,     /* context_handle */
         int,                    /* conf_req_flag */
         gss_qop_t,              /* qop_req */
-        gss_buffer_t,           /* input_message_buffer */
+        gss_const_buffer_t,     /* input_message_buffer */
         int *,                  /* conf_state */
         gss_buffer_t            /* output_message_buffer */
 );
@@ -483,8 +496,8 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_unwrap(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
-        gss_buffer_t,           /* input_message_buffer */
+        gss_const_ctx_id_t,     /* context_handle */
+        gss_const_buffer_t,     /* input_message_buffer */
         gss_buffer_t,           /* output_message_buffer */
         int *,                  /* conf_state */
         gss_qop_t *             /* qop_state */
@@ -494,7 +507,7 @@
         OM_uint32 *,            /* minor_status */
         OM_uint32,              /* status_value */
         int,                    /* status_type */
-        gss_OID,                /* mech_type (used to be const) */
+        gss_const_OID,          /* mech_type (used to be const) */
         OM_uint32 *,            /* message_context */
         gss_buffer_t            /* status_string */
 );
@@ -506,22 +519,22 @@
 
 GSS_DLLIMP OM_uint32 gss_compare_name(
         OM_uint32 *,            /* minor_status */
-        gss_name_t,             /* name1 */
-        gss_name_t,             /* name2 */
+        gss_const_name_t,       /* name1 */
+        gss_const_name_t,       /* name2 */
         int *                   /* name_equal */
 );
 
 GSS_DLLIMP OM_uint32 gss_display_name(
         OM_uint32 *,            /* minor_status */
-        gss_name_t,             /* input_name */
+        gss_const_name_t,       /* input_name */
         gss_buffer_t,           /* output_name_buffer */
         gss_OID *               /* output_name_type */
 );
 
 GSS_DLLIMP OM_uint32 gss_import_name(
         OM_uint32 *,            /* minor_status */
-        gss_buffer_t,           /* input_name_buffer */
-        gss_OID,                /* input_name_type(used to be const) */
+        gss_const_buffer_t,     /* input_name_buffer */
+        gss_const_OID,          /* input_name_type(used to be const) */
         gss_name_t *            /* output_name */
 );
 
@@ -542,7 +555,7 @@
 
 GSS_DLLIMP OM_uint32 gss_inquire_cred(
         OM_uint32 *,            /* minor_status */
-        gss_cred_id_t,          /* cred_handle */
+        gss_const_cred_id_t,    /* cred_handle */
         gss_name_t *,           /* name */
         OM_uint32 *,            /* lifetime */
         gss_cred_usage_t *,     /* cred_usage */
@@ -552,7 +565,7 @@
 /* Last argument new for V2 */
 GSS_DLLIMP OM_uint32 gss_inquire_context(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
+        gss_const_ctx_id_t,     /* context_handle */
         gss_name_t *,           /* src_name */
         gss_name_t *,           /* targ_name */
         OM_uint32 *,            /* lifetime_rec */
@@ -565,7 +578,7 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_wrap_size_limit(
         OM_uint32 *,            /* minor_status */
-        gss_ctx_id_t,           /* context_handle */
+        gss_const_ctx_id_t,     /* context_handle */
         int,                    /* conf_req_flag */
         gss_qop_t,              /* qop_req */
         OM_uint32,              /* req_output_size */
@@ -575,9 +588,9 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_add_cred(
         OM_uint32 *,            /* minor_status */
-        gss_cred_id_t,          /* input_cred_handle */
-        gss_name_t,             /* desired_name */
-        gss_OID,                /* desired_mech */
+        gss_const_cred_id_t,    /* input_cred_handle */
+        gss_const_name_t,       /* desired_name */
+        gss_const_OID,          /* desired_mech */
         gss_cred_usage_t,       /* cred_usage */
         OM_uint32,              /* initiator_time_req */
         OM_uint32,              /* acceptor_time_req */
@@ -590,8 +603,8 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_inquire_cred_by_mech(
         OM_uint32 *,            /* minor_status */
-        gss_cred_id_t,          /* cred_handle */
-        gss_OID,                /* mech_type */
+        gss_const_cred_id_t,    /* cred_handle */
+        gss_const_OID,          /* mech_type */
         gss_name_t *,           /* name */
         OM_uint32 *,            /* initiator_lifetime */
         OM_uint32 *,            /* acceptor_lifetime */
@@ -608,7 +621,7 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_import_sec_context(
         OM_uint32 *,            /* minor_status */
-        gss_buffer_t,           /* interprocess_token */
+        gss_const_buffer_t,     /* interprocess_token */
         gss_ctx_id_t *          /* context_handle */
 );
 
@@ -627,22 +640,22 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_add_oid_set_member(
         OM_uint32 *,            /* minor_status */
-        gss_OID,                /* member_oid */
+        gss_const_OID,          /* member_oid */
         gss_OID_set *           /* oid_set */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_test_oid_set_member(
         OM_uint32 *,            /* minor_status */
-        gss_OID,                /* member */
-        gss_OID_set,            /* set */
+        gss_const_OID,          /* member */
+        gss_const_OID_set,      /* set */
         int *                   /* present */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_str_to_oid(
         OM_uint32 *,            /* minor_status */
-        gss_buffer_t,           /* oid_str */
+        gss_const_buffer_t,     /* oid_str */
         gss_OID *               /* oid */
 );
 
@@ -656,33 +669,33 @@
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_inquire_names_for_mech(
         OM_uint32 *,            /* minor_status */
-        gss_OID,                /* mechanism */
+        gss_const_OID,          /* mechanism */
         gss_OID_set *           /* name_types */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_export_name(
         OM_uint32  *,           /* minor_status */
-        const gss_name_t,       /* input_name */
+        gss_const_name_t,       /* input_name */
         gss_buffer_t            /* exported_name */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_duplicate_name(
         OM_uint32  *,           /* minor_status */
-        const gss_name_t,       /* input_name */
+        gss_const_name_t,       /* input_name */
         gss_name_t *            /* dest_name */
 );
 
 /* New for V2 */
 GSS_DLLIMP OM_uint32 gss_canonicalize_name(
         OM_uint32  *,           /* minor_status */
-        const gss_name_t,       /* input_name */
-        const gss_OID,          /* mech_type */
+        gss_const_name_t,       /* input_name */
+        gss_const_OID,          /* mech_type */
         gss_name_t *            /* output_name */
 );
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC)
 #    pragma pack(pop)
 #endif