globus_gsi_proxy_core
9.9
Toggle main menu visibility
Loading...
Searching...
No Matches
globus_i_gsi_proxy.h
1
/*
2
* Copyright 1999-2006 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
#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
18
24
25
#include "
globus_gsi_proxy.h
"
26
#include "proxycertinfo.h"
27
#include "globus_common.h"
28
29
#ifndef GLOBUS_I_GSI_PROXY_H
30
#define GLOBUS_I_GSI_PROXY_H
31
32
#ifdef __cplusplus
33
extern
"C"
{
34
#endif
35
36
/* DEBUG MACROS */
37
38
#ifdef BUILD_DEBUG
39
40
extern
int
globus_i_gsi_proxy_debug_level;
41
extern
FILE * globus_i_gsi_proxy_debug_fstream;
42
43
#define GLOBUS_I_GSI_PROXY_DEBUG(_LEVEL_) \
44
(globus_i_gsi_proxy_debug_level >= (_LEVEL_))
45
46
#define GLOBUS_I_GSI_PROXY_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) \
47
{ \
48
if (GLOBUS_I_GSI_PROXY_DEBUG(_LEVEL_)) \
49
{ \
50
globus_libc_fprintf _MESSAGE_; \
51
} \
52
}
53
54
#define GLOBUS_I_GSI_PROXY_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) \
55
{ \
56
if (GLOBUS_I_GSI_PROXY_DEBUG(_LEVEL_)) \
57
{ \
58
char * _tmp_str_ = \
59
globus_common_create_nstring _MESSAGE_; \
60
globus_libc_fprintf(globus_i_gsi_proxy_debug_fstream, \
61
_tmp_str_); \
62
globus_libc_free(_tmp_str_); \
63
} \
64
}
65
66
#define GLOBUS_I_GSI_PROXY_DEBUG_PRINT(_LEVEL_, _MESSAGE_) \
67
{ \
68
if (GLOBUS_I_GSI_PROXY_DEBUG(_LEVEL_)) \
69
{ \
70
globus_libc_fprintf(globus_i_gsi_proxy_debug_fstream, _MESSAGE_); \
71
} \
72
}
73
74
#define GLOBUS_I_GSI_PROXY_DEBUG_PRINT_OBJECT(_LEVEL_, _OBJ_NAME_, _OBJ_) \
75
{ \
76
if (GLOBUS_I_GSI_PROXY_DEBUG(_LEVEL_)) \
77
{ \
78
_OBJ_NAME_##_print_fp(globus_i_gsi_proxy_debug_fstream, _OBJ_); \
79
} \
80
}
81
82
#define GLOBUS_I_GSI_PROXY_DEBUG_PRINT_PCI(_LEVEL_, _OBJ_) \
83
{ \
84
if (GLOBUS_I_GSI_PROXY_DEBUG(_LEVEL_)) \
85
{ \
86
BIO *b = BIO_new_fp(globus_i_gsi_proxy_debug_fstream, BIO_NOCLOSE); \
87
const X509V3_EXT_METHOD *meth = X509V3_EXT_get_nid(NID_proxyCertInfo); \
88
meth->i2r(meth, (_OBJ_), b, 4); \
89
BIO_flush(b); \
90
BIO_free(b); \
91
} \
92
}
93
#else
94
95
#define GLOBUS_I_GSI_PROXY_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) {}
96
#define GLOBUS_I_GSI_PROXY_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) {}
97
#define GLOBUS_I_GSI_PROXY_DEBUG_PRINT(_LEVEL_, _MESSAGE_) {}
98
#define GLOBUS_I_GSI_PROXY_DEBUG_PRINT_OBJECT(_LEVEL_, _OBJ_NAME_, _OBJ_) {}
99
#define GLOBUS_I_GSI_PROXY_DEBUG_PRINT_PCI(_LEVEL_, _OBJ_) {}
100
101
#endif
102
103
#define GLOBUS_I_GSI_PROXY_DEBUG_ENTER \
104
GLOBUS_I_GSI_PROXY_DEBUG_FPRINTF( \
105
1, (globus_i_gsi_proxy_debug_fstream, \
106
"%s entering\n", __func__))
107
108
#define GLOBUS_I_GSI_PROXY_DEBUG_EXIT \
109
GLOBUS_I_GSI_PROXY_DEBUG_FPRINTF( \
110
1, (globus_i_gsi_proxy_debug_fstream, \
111
"%s exiting\n", __func__))
112
113
/* ERROR MACROS */
114
115
#define GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(_RESULT_, \
116
_ERRORTYPE_, _ERRORSTR_) \
117
char * _tmp_string_ = \
118
globus_common_create_string _ERRORSTR_; \
119
_RESULT_ = globus_i_gsi_proxy_openssl_error_result( \
120
_ERRORTYPE_, \
121
__FILE__, \
122
__func__, \
123
__LINE__, \
124
_tmp_string_, \
125
NULL); \
126
globus_libc_free(_tmp_string_)
127
128
#define GLOBUS_GSI_PROXY_ERROR_RESULT(_RESULT_, \
129
_ERRORTYPE_, _ERRORSTR_) \
130
char * _tmp_string_ = \
131
globus_common_create_string _ERRORSTR_; \
132
_RESULT_ = globus_i_gsi_proxy_error_result( \
133
_ERRORTYPE_, \
134
__FILE__, \
135
__func__, \
136
__LINE__, \
137
_tmp_string_, \
138
NULL); \
139
globus_libc_free(_tmp_string_)
140
141
#define GLOBUS_GSI_PROXY_ERROR_CHAIN_RESULT(_RESULT_, \
142
_ERRORTYPE_) \
143
_RESULT_ = globus_i_gsi_proxy_error_chain_result( \
144
(_RESULT_), \
145
(_ERRORTYPE_), \
146
__FILE__, \
147
__func__, \
148
__LINE__, \
149
NULL, \
150
NULL)
151
152
#define GLOBUS_GSI_PROXY_OPENSSL_LONG_ERROR_RESULT(_RESULT_, \
153
_ERRORTYPE_, \
154
_ERRORSTR_, \
155
_LONG_DESC_) \
156
char * _tmp_string_ = \
157
globus_common_create_string _ERRORSTR_; \
158
_RESULT_ = globus_i_gsi_proxy_openssl_error_result( \
159
_ERRORTYPE_, \
160
__FILE__, \
161
__func__, \
162
__LINE__, \
163
_tmp_string_, \
164
_LONG_DESC_); \
165
globus_libc_free(_tmp_string_)
166
167
#define GLOBUS_GSI_PROXY_LONG_ERROR_RESULT(_RESULT_, \
168
_ERRORTYPE_, \
169
_ERRORSTR_, \
170
_LONG_DESC_) \
171
char * _tmp_string_ = \
172
globus_common_create_string _ERRORSTR_; \
173
_RESULT_ = globus_i_gsi_proxy_error_result( \
174
_ERRORTYPE_, \
175
__FILE__, \
176
__func__, \
177
__LINE__, \
178
_tmp_string_, \
179
NULL, \
180
_LONG_DESC_); \
181
globus_libc_free(_tmp_string_)
182
183
#define GLOBUS_GSI_PROXY_LONG_ERROR_CHAIN_RESULT(_RESULT_, \
184
_ERRORTYPE_, \
185
_LONG_DESC_) \
186
_RESULT_ = globus_i_gsi_proxy_error_chain_result( \
187
_RESULT_, \
188
_ERRORTYPE_, \
189
__FILE__, \
190
__func__, \
191
__LINE__, \
192
NULL, \
193
_LONG_DESC_)
194
195
#include "
globus_gsi_proxy_constants.h
"
196
201
210
typedef
struct
globus_l_gsi_proxy_handle_attrs_s
211
{
216
int
key_bits;
221
int
init_prime;
226
const
EVP_MD * signing_algorithm;
232
int
clock_skew;
237
void (*key_gen_callback)(int, int,
void
*);
238
239
} globus_i_gsi_proxy_handle_attrs_t;
240
251
252
typedef
struct
globus_l_gsi_proxy_handle_s
253
{
255
X509_REQ * req;
257
EVP_PKEY * proxy_key;
259
globus_gsi_proxy_handle_attrs_t
attrs;
261
PROXY_CERT_INFO_EXTENSION * proxy_cert_info;
263
int
time_valid;
265
globus_gsi_cert_utils_cert_type_t type;
267
char
* common_name;
269
STACK_OF(X509_EXTENSION)* extensions;
270
} globus_i_gsi_proxy_handle_t;
271
272
273
/* used for printing the status of a private key generating algorithm */
274
void
275
globus_i_gsi_proxy_create_private_key_cb(
276
int
num1,
277
int
num2,
278
BIO * output);
279
280
globus_result_t
281
globus_i_gsi_proxy_set_pc_times(
282
X509 * new_pc,
283
X509 * issuer_cert,
284
int
clock_skew,
285
int
time_valid);
286
287
globus_result_t
288
globus_i_gsi_proxy_set_subject(
289
X509 * new_pc,
290
X509 * issuer_cert,
291
char
* common_name);
292
293
globus_result_t
294
globus_i_gsi_proxy_openssl_error_result(
295
int
error_type,
296
const
char
* filename,
297
const
char
* function_name,
298
int
line_number,
299
const
char
* short_desc,
300
const
char
* long_desc);
301
302
globus_result_t
303
globus_i_gsi_proxy_error_result(
304
int
error_type,
305
const
char
* filename,
306
const
char
* function_name,
307
int
line_number,
308
const
char
* short_desc,
309
const
char
* long_desc);
310
311
globus_result_t
312
globus_i_gsi_proxy_error_chain_result(
313
globus_result_t chain_result,
314
int
error_type,
315
const
char
* filename,
316
const
char
* function_name,
317
int
line_number,
318
const
char
* short_desc,
319
const
char
* long_desc);
320
321
#ifdef __cplusplus
322
}
323
#endif
324
325
#endif
/* GLOBUS_I_GSI_PROXY_H */
326
327
#endif
/* GLOBUS_DONT_DOCUMENT_INTERNAL */
globus_gsi_proxy.h
Globus GSI Proxy API.
globus_gsi_proxy_constants.h
GSI Proxy Constants.
globus_gsi_proxy_handle_attrs_t
struct globus_l_gsi_proxy_handle_attrs_s * globus_gsi_proxy_handle_attrs_t
Handle Attributes.
Definition
globus_gsi_proxy.h:153
globus_i_gsi_proxy.h
Generated by
1.17.0