| 1 |
/********************************************************************* |
| 2 |
* |
| 3 |
* Authors: Vincenzo Ciaschini - [email protected] |
| 4 |
* |
| 5 |
* Copyright (c) Members of the EGEE Collaboration. 2004-2010. |
| 6 |
* See http://www.eu-egee.org/partners/ for details on the copyright holders. |
| 7 |
* |
| 8 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 |
* you may not use this file except in compliance with the License. |
| 10 |
* You may obtain a copy of the License at |
| 11 |
* |
| 12 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 13 |
* |
| 14 |
* Unless required by applicable law or agreed to in writing, software |
| 15 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 16 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 |
* See the License for the specific language governing permissions and |
| 18 |
* limitations under the License. |
| 19 |
* |
| 20 |
* Parts of this code may be based upon or even include verbatim pieces, |
| 21 |
* originally written by other people, in which case the original header |
| 22 |
* follows. |
| 23 |
* |
| 24 |
*********************************************************************/ |
| 25 |
|
| 26 |
#ifndef VOMS_PROXY_H |
| 27 |
#define VOMS_PROXY_H |
| 28 |
|
| 29 |
#ifdef __cplusplus |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
#include <openssl/x509.h> |
| 34 |
#include <openssl/stack.h> |
| 35 |
#include <openssl/evp.h> |
| 36 |
|
| 37 |
#include "newformat.h" |
| 38 |
|
| 39 |
struct VOMSProxyArguments { |
| 40 |
X509_REQ *proxyrequest; |
| 41 |
char *proxyfilename; |
| 42 |
char *filename; |
| 43 |
AC **aclist; |
| 44 |
int proxyversion; |
| 45 |
char *data; |
| 46 |
int datalen; |
| 47 |
char *newsubject; |
| 48 |
int newsubjectlen; |
| 49 |
X509 *cert; |
| 50 |
EVP_PKEY *key; |
| 51 |
int bits; |
| 52 |
char *policyfile; |
| 53 |
char *policylang; |
| 54 |
char *policytext; |
| 55 |
int pathlength; |
| 56 |
int hours; |
| 57 |
int minutes; |
| 58 |
int limited; |
| 59 |
char *voID; |
| 60 |
int (*callback)(); |
| 61 |
STACK_OF(X509_EXTENSION) *extensions; |
| 62 |
STACK_OF(X509) *chain; |
| 63 |
int pastproxy; |
| 64 |
char *keyusage; |
| 65 |
char *netscape; |
| 66 |
char *exkusage; |
| 67 |
char *newissuer; |
| 68 |
char *newserial; |
| 69 |
int selfsigned; |
| 70 |
}; |
| 71 |
|
| 72 |
struct VOMSProxy { |
| 73 |
X509 *cert; |
| 74 |
STACK_OF(X509) *chain; |
| 75 |
EVP_PKEY *key; |
| 76 |
}; |
| 77 |
|
| 78 |
struct VOMSProxyArguments *VOMS_MakeProxyArguments(); |
| 79 |
void VOMS_FreeProxyArguments(struct VOMSProxyArguments *args); |
| 80 |
void VOMS_FreeProxy(struct VOMSProxy *proxy); |
| 81 |
struct VOMSProxy *VOMS_AllocProxy(); |
| 82 |
int VOMS_WriteProxy(const char *filename, struct VOMSProxy *proxy); |
| 83 |
struct VOMSProxy *VOMS_MakeProxy(struct VOMSProxyArguments *args, int *warning, void **additional); |
| 84 |
X509_EXTENSION *CreateProxyExtension(char * name, char *data, int datalen, int crit); |
| 85 |
char *ProxyCreationError(int error, void *additional); |
| 86 |
|
| 87 |
#define PROXY_ERROR_IS_WARNING(error) (error >= 1000) |
| 88 |
|
| 89 |
#define PROXY_NO_ERROR 0 |
| 90 |
#define PROXY_ERROR_OPEN_FILE 1 |
| 91 |
#define PROXY_ERROR_STAT_FILE 2 |
| 92 |
#define PROXY_ERROR_OUT_OF_MEMORY 3 |
| 93 |
#define PROXY_ERROR_FILE_READ 4 |
| 94 |
#define PROXY_ERROR_UNKNOWN_BIT 5 |
| 95 |
#define PROXY_ERROR_UNKNOWN_EXTENDED_BIT 6 |
| 96 |
#define PROXY_WARNING_GSI_ASSUMED 1000 |
| 97 |
#define PROXY_WARNING_GENERIC_LANGUAGE_ASSUMED 1001 |
| 98 |
|
| 99 |
#ifdef __cplusplus |
| 100 |
} |
| 101 |
#endif |
| 102 |
|
| 103 |
#endif |