| 1 |
/********************************************************************* |
| 2 |
* |
| 3 |
* Authors: Vincenzo Ciaschini - [email protected] |
| 4 |
* Valerio Venturi - [email protected] |
| 5 |
* |
| 6 |
* Copyright (c) Members of the EGEE Collaboration. 2004-2010. |
| 7 |
* See http://www.eu-egee.org/partners/ for details on the copyright holders. |
| 8 |
* |
| 9 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 |
* you may not use this file except in compliance with the License. |
| 11 |
* You may obtain a copy of the License at |
| 12 |
* |
| 13 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 14 |
* |
| 15 |
* Unless required by applicable law or agreed to in writing, software |
| 16 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 17 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 |
* See the License for the specific language governing permissions and |
| 19 |
* limitations under the License. |
| 20 |
* |
| 21 |
* Parts of this code may be based upon or even include verbatim pieces, |
| 22 |
* originally written by other people, in which case the original header |
| 23 |
* follows. |
| 24 |
* |
| 25 |
*********************************************************************/ |
| 26 |
#ifndef VOMS_PROXYCERTINFO_H |
| 27 |
#define VOMS_PROXYCERTINFO_H |
| 28 |
|
| 29 |
#include <openssl/x509.h> |
| 30 |
#include <openssl/x509v3.h> |
| 31 |
#include <string.h> |
| 32 |
|
| 33 |
/* predefined policy language */ |
| 34 |
#define IMPERSONATION_PROXY_OID "1.3.6.1.5.5.7.21.1" |
| 35 |
#define IMPERSONATION_PROXY_SN "IMPERSONATION_PROXY" |
| 36 |
#define IMPERSONATION_PROXY_LN "GSI impersonation proxy" |
| 37 |
|
| 38 |
#define INDEPENDENT_PROXY_OID "1.3.6.1.5.5.7.21.2" |
| 39 |
#define INDEPENDENT_PROXY_SN "INDEPENDENT_PROXY" |
| 40 |
#define INDEPENDENT_PROXY_LN "GSI independent proxy" |
| 41 |
|
| 42 |
/* generic policy language */ |
| 43 |
#define GLOBUS_GSI_PROXY_GENERIC_POLICY_OID "1.3.6.1.4.1.3536.1.1.1.8" |
| 44 |
|
| 45 |
#define LIMITED_PROXY_OID "1.3.6.1.4.1.3536.1.1.1.9" |
| 46 |
#define LIMITED_PROXY_SN "LIMITED_PROXY" |
| 47 |
#define LIMITED_PROXY_LN "GSI limited proxy" |
| 48 |
|
| 49 |
#define PROXYCERTINFO_V3 "1.3.6.1.4.1.3536.1.222" |
| 50 |
#define PROXYCERTINFO_V4 "1.3.6.1.5.5.7.1.14" |
| 51 |
|
| 52 |
/* error handling */ |
| 53 |
#define ASN1_F_PROXYPOLICY_NEW 450 |
| 54 |
#define ASN1_F_D2I_PROXYPOLICY 451 |
| 55 |
#define ASN1_F_PROXYCERTINFO_NEW 430 |
| 56 |
#define ASN1_F_D2I_PROXYCERTINFO 431 |
| 57 |
|
| 58 |
/* data structure */ |
| 59 |
|
| 60 |
typedef struct myPROXYPOLICY_st { |
| 61 |
|
| 62 |
ASN1_OBJECT * policy_language; |
| 63 |
ASN1_OCTET_STRING * policy; |
| 64 |
|
| 65 |
} myPROXYPOLICY; |
| 66 |
|
| 67 |
typedef struct myPROXYCERTINFO_st { |
| 68 |
|
| 69 |
ASN1_INTEGER * path_length; |
| 70 |
myPROXYPOLICY * proxypolicy; |
| 71 |
int version; |
| 72 |
} myPROXYCERTINFO; |
| 73 |
|
| 74 |
|
| 75 |
/* myPROXYPOLICY function */ |
| 76 |
|
| 77 |
/* allocating and free memory */ |
| 78 |
extern myPROXYPOLICY * myPROXYPOLICY_new(); |
| 79 |
extern void myPROXYPOLICY_free(myPROXYPOLICY * proxypolicy); |
| 80 |
|
| 81 |
/* duplicate */ |
| 82 |
extern myPROXYPOLICY * myPROXYPOLICY_dup(myPROXYPOLICY * policy); |
| 83 |
|
| 84 |
/* set policy language */ |
| 85 |
extern int myPROXYPOLICY_set_policy_language(myPROXYPOLICY * policy, ASN1_OBJECT * policy_language); |
| 86 |
|
| 87 |
/* get policy language */ |
| 88 |
extern ASN1_OBJECT * myPROXYPOLICY_get_policy_language(myPROXYPOLICY * policy); |
| 89 |
|
| 90 |
/* set policy contents */ |
| 91 |
extern int myPROXYPOLICY_set_policy(myPROXYPOLICY * proxypolicy, unsigned char * policy, int length); |
| 92 |
|
| 93 |
/* get policy contents */ |
| 94 |
extern unsigned char * myPROXYPOLICY_get_policy(myPROXYPOLICY * policy, int * length); |
| 95 |
|
| 96 |
/* internal to der conversion */ |
| 97 |
extern int i2d_myPROXYPOLICY(myPROXYPOLICY * policy, unsigned char ** pp); |
| 98 |
|
| 99 |
/* der to internal conversion */ |
| 100 |
extern myPROXYPOLICY * d2i_myPROXYPOLICY(myPROXYPOLICY ** policy, unsigned char ** pp, long length); |
| 101 |
|
| 102 |
/*myPROXYCERTINFO function */ |
| 103 |
|
| 104 |
/* allocating and free memory */ |
| 105 |
extern myPROXYCERTINFO * myPROXYCERTINFO_new(); |
| 106 |
extern void myPROXYCERTINFO_free(myPROXYCERTINFO * proxycertinfo); |
| 107 |
|
| 108 |
/* set path_length */ |
| 109 |
extern int myPROXYCERTINFO_set_path_length(myPROXYCERTINFO * proxycertinfo, long path_length); |
| 110 |
|
| 111 |
/* get ptah length */ |
| 112 |
extern long myPROXYCERTINFO_get_path_length(myPROXYCERTINFO * proxycertinfo); |
| 113 |
|
| 114 |
/* set proxypolicy */ |
| 115 |
extern int myPROXYCERTINFO_set_proxypolicy(myPROXYCERTINFO * proxycertinfo, myPROXYPOLICY * proxypolicy); |
| 116 |
|
| 117 |
/* get proxypolicy */ |
| 118 |
extern myPROXYPOLICY * myPROXYCERTINFO_get_proxypolicy(myPROXYCERTINFO * proxycertinfo); |
| 119 |
|
| 120 |
/* internal to der conversion */ |
| 121 |
extern int i2d_myPROXYCERTINFO(myPROXYCERTINFO * proxycertinfo, unsigned char ** pp); |
| 122 |
|
| 123 |
/* der to internal conversion */ |
| 124 |
extern myPROXYCERTINFO * d2i_myPROXYCERTINFO(myPROXYCERTINFO ** cert_info, unsigned char ** a, long length); |
| 125 |
|
| 126 |
extern int myPROXYCERTINFO_set_version(myPROXYCERTINFO *cert_info, int version); |
| 127 |
|
| 128 |
extern int proxynative(void); |
| 129 |
extern void InitProxyCertInfoExtension(int full); |
| 130 |
|
| 131 |
#endif |