Grid Community Toolkit  6.2.1653033972 (tag: v6.2.20220524)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gssapi_test_utils.h
1 /*
2  * Copyright 1999-2015 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #include "gssapi.h"
19 #include "globus_common.h"
20 
21 gss_cred_id_t
22 globus_gsi_gssapi_test_acquire_credential();
23 
24 void
25 globus_gsi_gssapi_test_release_credential(
26  gss_cred_id_t * credential);
27 
28 int
29 test_establish_contexts(
30  gss_ctx_id_t *init_context,
31  gss_ctx_id_t *accept_context,
32  OM_uint32 flags,
33  OM_uint32 *major_status,
34  OM_uint32 *minor_status);
35 
36 int
37 test_establish_contexts_with_mechs(
38  gss_ctx_id_t *init_context,
39  gss_ctx_id_t *accept_context,
40  const gss_OID init_mec_type,
41  OM_uint32 flags,
42  OM_uint32 *major_status,
43  OM_uint32 *minor_status);
44 
46 globus_gsi_gssapi_test_authenticate(
47  int fd,
48  globus_bool_t server,
49  gss_cred_id_t credential,
50  gss_ctx_id_t * context_handle,
51  char ** user_id,
52  gss_cred_id_t * delegated_cred);
53 
54 void
55 globus_gsi_gssapi_test_cleanup(
56  gss_ctx_id_t * context_handle,
57  char * userid,
58  gss_cred_id_t * delegated_cred);
59 
61 globus_gsi_gssapi_test_export_context(
62  FILE * context_file,
63  gss_ctx_id_t * context);
64 
65 
67 globus_gsi_gssapi_test_import_context(
68  FILE * context_file,
69  gss_ctx_id_t * context);
70 
72 globus_gsi_gssapi_test_send_hello(
73  int fd,
74  gss_ctx_id_t context);
75 
77 globus_gsi_gssapi_test_receive_hello(
78  int fd,
79  gss_ctx_id_t context);
80 
82 globus_gsi_gssapi_test_dump_cert_chain(
83  char * filename,
84  gss_ctx_id_t context);
85 
86 void
87 globus_gsi_gssapi_test_print_error(
88  FILE * stream,
89  OM_uint32 major_status,
90  OM_uint32 minor_status);
91 
92 void
93 globus_gsi_gssapi_test_print_result(
94  FILE * stream,
95  globus_result_t result);
96 
97 
98 typedef int (*test_case)(void);
99 typedef struct
100 {
101  const char * name;
102  test_case func;
103 }
104 test_case_t;
105 
106 #define TEST_CASE(x) { #x, x }
107 #define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
108 
109 /* Stolen from oid_functions.c */
110 extern const gss_OID_desc * const globus_i_gss_mech_globus_gssapi_openssl;
111 extern const gss_OID_desc * const globus_i_gss_proxycertinfo_extension;
112 extern const gss_OID_desc * const globus_i_gss_ext_x509_cert_chain_oid;
113 extern const gss_OID_desc * const gss_ext_alpn_oid;
114 extern gss_OID_desc * globus_i_gss_nt_host_ip;
115 extern gss_OID_desc * globus_i_gss_nt_x509;
116 
117 
118 
119 #ifndef GLOBUS_GSS_C_NT_HOST_IP
120 #define GLOBUS_GSS_C_NT_HOST_IP globus_i_gss_nt_host_ip
121 #endif
122 #ifndef GLOBUS_GSS_C_NT_X509
123 #define GLOBUS_GSS_C_NT_X509 globus_i_gss_nt_x509
124 #endif
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99