gridsite.h
Go to the documentation of this file.
/*
Copyright (c) 2002-10, Andrew McNab, University of Manchester
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
o Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
o Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*---------------------------------------------------------------*
* For more about GridSite: http://www.gridsite.org/ *
*---------------------------------------------------------------*/
#ifndef HEADER_GRIDSITE_H
#define HEADER_GRIDSITE_H
#ifndef GRST_VERSION
#define GRST_VERSION 010500
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GRST_NO_OPENSSL
#ifndef HEADER_SSL_H
#include <openssl/ssl.h>
#endif
#ifndef HEADER_CRYPTO_H
#include <openssl/crypto.h>
#endif
#endif
#ifndef _TIME_H
#include <time.h>
#endif
#ifndef _STDIO_H
#include <stdio.h>
#endif
#ifndef _STDINT_H
#include <stdint.h>
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
// Everything ok (= OpenSSL X509_V_OK)
#define GRST_RET_OK 0
// Failed for unspecified reason
#define GRST_RET_FAILED 1000
// Failed to find certificate in some cert store / directory
#define GRST_RET_CERT_NOT_FOUND 1001
// Bad signature
#define GRST_RET_BAD_SIGNATURE 1002
// No such file or directory
#define GRST_RET_NO_SUCH_FILE 1003
/* We use && now rather than if so this macro can be used inside if...else
but that means the function must return an int rather than be void */
#define GRSTerrorLog(GRSTerrorLevel, ...) ((GRSTerrorLogFunc != NULL) && ((GRSTerrorLogFunc)(__FILE__, __LINE__, GRSTerrorLevel, __VA_ARGS__)))
extern int (*GRSTerrorLogFunc)(char *, int, int, char *, ...);
/* these levels are the same as Unix syslog() and Apache ap_log_error() */
#define GRST_LOG_EMERG 0
#define GRST_LOG_ALERT 1
#define GRST_LOG_CRIT 2
#define GRST_LOG_ERR 3
#define GRST_LOG_WARNING 4
#define GRST_LOG_NOTICE 5
#define GRST_LOG_INFO 6
#define GRST_LOG_DEBUG 7
#define GRST_MAX_TIME_T INT32_MAX
typedef struct { char *auri;
int delegation;
int nist_loa;
time_t notbefore;
time_t notafter;
void *next; } GRSTgaclCred;
/* used by pre-AURI GRSTgaclCred structs */
__attribute__ ((deprecated))
typedef struct { char *name;
char *value;
void *next; } GRSTgaclNamevalue;
typedef int GRSTgaclAction;
typedef unsigned int GRSTgaclPerm;
typedef struct { GRSTgaclCred *firstcred;
GRSTgaclPerm allowed;
GRSTgaclPerm denied;
void *next; } GRSTgaclEntry;
typedef struct { GRSTgaclEntry *firstentry; } GRSTgaclAcl;
typedef struct { GRSTgaclCred *firstcred; char *dnlists; } GRSTgaclUser;
#define GRST_PERM_NONE 0
#define GRST_PERM_READ 1
#define GRST_PERM_EXEC 2
#define GRST_PERM_LIST 4
#define GRST_PERM_WRITE 8
#define GRST_PERM_ADMIN 16
#define GRST_PERM_ALL 31
/* DO NOT USE PermIsNone!! */
#define GRSTgaclPermIsNone(perm) ((perm) == 0)
#define GRSTgaclPermHasNone(perm) ((perm) == 0)
#define GRSTgaclPermHasRead(perm) (((perm) & GRST_PERM_READ ) != 0)
#define GRSTgaclPermHasExec(perm) (((perm) & GRST_PERM_EXEC ) != 0)
#define GRSTgaclPermHasList(perm) (((perm) & GRST_PERM_LIST ) != 0)
#define GRSTgaclPermHasWrite(perm) (((perm) & GRST_PERM_WRITE) != 0)
#define GRSTgaclPermHasAdmin(perm) (((perm) & GRST_PERM_ADMIN) != 0)
#define GRST_ACTION_ALLOW 0
#define GRST_ACTION_DENY 1
#define GRST_HIST_PREFIX ".grsthist"
#define GRST_ACL_FILE ".gacl"
#define GRST_DN_LISTS "/etc/grid-security/dn-lists"
#define GRST_RECURS_LIMIT 9
#define GRST_PROXYCERTINFO_OLD_OID "1.3.6.1.4.1.3536.1.222"
#define GRST_PROXYCERTINFO_OID "1.3.6.1.5.5.7.1.14"
#define GRST_VOMS_OID "1.3.6.1.4.1.8005.100.100.5"
#define GRST_VOMS_PK_CERT_LIST_OID "1.3.6.1.4.1.8005.100.100.10"
#define GRST_VOMS_DIR "/etc/grid-security/vomsdir"
#define GRST_KEYUSAGE_OID "2.5.29.15"
#define GRST_ASN1_MAXCOORDLEN 50
#define GRST_ASN1_MAXTAGS 500
struct GRSTasn1TagList { char treecoords[GRST_ASN1_MAXCOORDLEN+1];
int start;
int headerlength;
int length;
int tag; } ;
#define GRST_X509_SERIAL_DIGITS 49
typedef struct { int type; /* CA, user, proxy, VOMS, ... */
int errors; /* unchecked, bad sig, bad time */
char *issuer; /* Cert CA DN, EEC of PC, or VOMS DN */
char *dn; /* Cert DN, or VOMS AC holder DN */
char *value; /* VOMS FQAN or NULL */
time_t notbefore;
time_t notafter;
int delegation; /* relative to END of any chain */
char serial[GRST_X509_SERIAL_DIGITS+1];
char *ocsp; /* accessLocation field */
void *raw; /* X509 or VOMS Extension object */
void *next; } GRSTx509Cert;
#define GRST_CERT_BAD_FORMAT 1
#define GRST_CERT_BAD_CHAIN 2
#define GRST_CERT_BAD_SIG 4
#define GRST_CERT_BAD_TIME 8
#define GRST_CERT_BAD_OCSP 16
#define GRST_CERT_TYPE_CA 1
#define GRST_CERT_TYPE_EEC 2
#define GRST_CERT_TYPE_PROXY 3
#define GRST_CERT_TYPE_VOMS 4
#define GRST_CERT_TYPE_ROBOT 5
/* a chain of certs, starting from the first CA */
typedef struct { GRSTx509Cert *firstcert; } GRSTx509Chain;
#ifndef GRST_NO_OPENSSL
int GRSTx509CertLoad(GRSTx509Cert *, X509 *);
int GRSTx509ChainLoad(GRSTx509Chain **chain,
STACK_OF(X509) *certstack, X509 *lastcert,
char *capath, char *vomsdir);
int GRSTx509ChainLoadCheck(GRSTx509Chain **, STACK_OF(X509) *, X509 *, char *, char *);
#endif
int GRSTx509ChainFree(GRSTx509Chain *);
#define GRST_HTTP_PORT 777
#define GRST_HTTPS_PORT 488
#define GRST_HTCP_PORT 777
#define GRST_GSIFTP_PORT 2811
#define GRSThtcpNOPop 0
#define GRSThtcpTSTop 1
typedef struct { unsigned char length_msb;
unsigned char length_lsb;
char text[1]; } GRSThtcpCountstr;
#define GRSThtcpCountstrLen(string) (256*((string)->length_msb) + (string)->length_lsb)
typedef struct { unsigned char total_length_msb;
unsigned char total_length_lsb;
unsigned char version_msb;
unsigned char version_lsb;
unsigned char data_length_msb;
unsigned char data_length_lsb;
unsigned int response : 4;
unsigned int opcode : 4;
unsigned int rr : 1;
unsigned int f1 : 1;
unsigned int reserved : 6;
unsigned int trans_id; /* must be 4 bytes */
GRSThtcpCountstr *method;
GRSThtcpCountstr *uri;
GRSThtcpCountstr *version;
GRSThtcpCountstr *req_hdrs;
GRSThtcpCountstr *resp_hdrs;
GRSThtcpCountstr *entity_hdrs;
GRSThtcpCountstr *cache_hdrs; } GRSThtcpMessage;
int GRSTgaclInit(void);
__attribute__ ((deprecated))
GRSTgaclCred *GRSTgaclCredNew(char *);
GRSTgaclCred *GRSTgaclCredCreate(char *, char *);
__attribute__ ((deprecated))
int GRSTgaclCredAddValue(GRSTgaclCred *, char *, char *);
#define GRSTgaclCredGetAuri(cred) ((cred)->auri)
#define GRSTgaclCredSetNotBefore(cred, time) ((cred)->notbefore = (time))
#define GRSTgaclCredGetNotBefore(cred) ((cred)->notbefore)
#define GRSTgaclCredSetNotAfter(cred, time) ((cred)->notafter = (time))
#define GRSTgaclCredGetNotAfter(cred) ((cred)->notafter)
#define GRSTgaclCredSetDelegation(cred, level) ((cred)->delegation = (level))
#define GRSTgaclCredGetDelegation(cred) ((cred)->delegation)
#define GRSTgaclCredSetNistLoa(cred, level) ((cred)->nist_loa = (level))
#define GRSTgaclCredGetNistLoa(cred) ((cred)->nist_loa)
/* #define GACLfreeCred(x) GRSTgaclCredFree((x)) */
int GRSTgaclCredFree(GRSTgaclCred *);
/* #define GACLaddCred(x,y) GRSTgaclEntryAddCred((x),(y)) */
int GRSTgaclEntryAddCred(GRSTgaclEntry *, GRSTgaclCred *);
/* #define GACLdelCred(x,y) GRSTgaclEntryDelCred((x),(y)) */
int GRSTgaclEntryDelCred(GRSTgaclEntry *, GRSTgaclCred *);
/* #define GACLprintCred(x,y) GRSTgaclCredPrint((x),(y)) */
int GRSTgaclCredCredPrint(GRSTgaclCred *, FILE *);
int GRSTgaclCredCmpAuri(GRSTgaclCred *, GRSTgaclCred *);
/* #define GACLnewEntry(x) GRSTgaclEntryNew((x)) */
GRSTgaclEntry *GRSTgaclEntryNew(void);
/* #define GACLfreeEntry(x) GRSTgaclEntryFree((x)) */
int GRSTgaclEntryFree(GRSTgaclEntry *);
/* #define GACLaddEntry(x,y) GRSTgaclAclAddEntry((x),(y)) */
int GRSTgaclAclAddEntry(GRSTgaclAcl *, GRSTgaclEntry *);
/* #define GACLprintEntry(x,y) GRSTgaclEntryPrint((x),(y)) */
int GRSTgaclEntryPrint(GRSTgaclEntry *, FILE *);
/* #define GACLprintPerm(x,y) GRSTgaclPermPrint((x),(y)) */
int GRSTgaclPermPrint(GRSTgaclPerm, FILE *);
/* #define GACLallowPerm(x,y) GRSTgaclEntryAllowPerm((x),(y)) */
int GRSTgaclEntryAllowPerm(GRSTgaclEntry *, GRSTgaclPerm);
/* #define GACLunallowPerm(x,y) GRSTgaclEntryUnallowPerm((x),(y)) */
int GRSTgaclEntryUnallowPerm(GRSTgaclEntry *, GRSTgaclPerm);
/* #define GACLdenyPerm(x,y) GRSTgaclEntryDenyPerm((x),(y)) */
int GRSTgaclEntryDenyPerm(GRSTgaclEntry *, GRSTgaclPerm);
/* #define GACLundenyPerm(x,y) GRSTgaclEntryUndenyPerm((x),(y)) */
int GRSTgaclEntryUndenyPerm(GRSTgaclEntry *, GRSTgaclPerm);
/* #define GACLpermToChar(x) GRSTgaclPermToChar((x)) */
char *GRSTgaclPermToChar(GRSTgaclPerm);
/* #define GACLcharToPerm(x) GRSTgaclPermFromChar((x)) */
GRSTgaclPerm GRSTgaclPermFromChar(char *);
/* #define GACLnewAcl(x) GRSTgaclAclNew((x)) */
GRSTgaclAcl *GRSTgaclAclNew(void);
/* #define GACLfreeAcl(x) GRSTgaclAclFree((x)) */
int GRSTgaclAclFree(GRSTgaclAcl *);
/* #define GACLprintAcl(x,y) GRSTgaclAclPrint((x),(y)) */
int GRSTgaclAclPrint(GRSTgaclAcl *, FILE *);
/* #define GACLsaveAcl(x,y) GRSTgaclAclSave((y),(x)) */
int GRSTgaclAclSave(GRSTgaclAcl *, char *);
/* #define GACLloadAcl(x) GRSTgaclFileLoadAcl((x)) */
GRSTgaclAcl *GRSTgaclAclLoadFile(char *);
/* #define GACLfindAclForFile(x) GRSTgaclFileFindAclname((x)) */
char *GRSTgaclFileFindAclname(char *);
/* #define GACLloadAclForFile(x) GRSTgaclFileLoadAcl((x)) */
GRSTgaclAcl *GRSTgaclAclLoadforFile(char *);
/* #define GACLisAclFile(x) GRSTgaclFileIsAcl((x)) */
int GRSTgaclFileIsAcl(char *);
/* #define GACLnewUser(x) GRSTgaclUserNew((x)) */
GRSTgaclUser *GRSTgaclUserNew(GRSTgaclCred *);
/* #define GACLfreeUser(x) GRSTgaclUserFree((x)) */
int GRSTgaclUserFree(GRSTgaclUser *);
/* #define GACLuserAddCred(x,y) GRSTgaclUserAddCred((x),(y)) */
int GRSTgaclUserAddCred(GRSTgaclUser *, GRSTgaclCred *);
/* #define GACLuserHasCred(x,y) GRSTgaclUserHasCred((x),(y)) */
int GRSTgaclUserHasCred(GRSTgaclUser *, GRSTgaclCred *);
__attribute__ ((deprecated))
int GRSTgaclUserSetDNlists(GRSTgaclUser *, char *);
int GRSTgaclUserLoadDNlists(GRSTgaclUser *, char *);
/* #define GACLuserFindCredType(x,y) GRSTgaclUserFindCredtype((x),(y)) */
GRSTgaclCred *GRSTgaclUserFindCredtype(GRSTgaclUser *, char *);
__attribute__ ((deprecated))
int GRSTgaclDNlistHasUser(char *, GRSTgaclUser *);
int GRSTgaclUserHasAURI(GRSTgaclUser *, char *);
/* #define GACLtestUserAcl(x,y) GRSTgaclAclTestUser((x),(y)) */
GRSTgaclPerm GRSTgaclAclTestUser(GRSTgaclAcl *, GRSTgaclUser *);
/* #define GACLtestExclAcl(x,y) GRSTgaclAclTestexclUser((x),(y)) */
GRSTgaclPerm GRSTgaclAclTestexclUser(GRSTgaclAcl *, GRSTgaclUser *);
char *GRSThttpUrlDecode(char *);
/* #define GACLurlEncode(x) GRSThttpUrlEncode((x)) */
char *GRSThttpUrlEncode(char *);
/* #define GACLmildUrlEncode(x) GRSThttpMildUrlEncode((x)) */
char *GRSThttpUrlMildencode(char *);
int GRSTx509NameCmp(char *, char *);
#ifndef GRST_NO_OPENSSL
int GRSTx509KnownCriticalExts(X509 *);
int GRSTx509IsCA(X509 *);
int GRSTx509CheckChain(int *, X509_STORE_CTX *);
int GRSTx509VerifyCallback(int, X509_STORE_CTX *);
__attribute__ ((deprecated))
int GRSTx509GetVomsCreds(int *, int, size_t, char *, X509 *, STACK_OF(X509) *, char *);
__attribute__ ((deprecated))
GRSTgaclCred *GRSTx509CompactToCred(char *);
__attribute__ ((deprecated))
int GRSTx509CompactCreds(int *, int, size_t, char *, STACK_OF(X509) *, char *, X509 *);
#endif
char *GRSTx509CachedProxyFind(char *, char *, char *);
char *GRSTx509FindProxyFileName(void);
int GRSTx509MakeProxyCert(char **, FILE *, char *, char *, char *, int);
#ifndef GRST_NO_OPENSSL
char *GRSTx509CachedProxyKeyFind(char *, char *, char *, STACK_OF(X509) *);
#endif
int GRSTx509ProxyDestroy(char *, char *, char *);
int GRSTx509ProxyGetTimes(char *, char *, char *, time_t *, time_t *);
/*use GRSTx509CreateProxyRequestKS instead*/
int GRSTx509CreateProxyRequest(char **, char **, char *);
int GRSTx509CreateProxyRequestKS(char **reqtxt, char **keytxt, char *ocspurl, int keysize);
/*use GRSTx509MakeProxyRequestKS istead*/
int GRSTx509MakeProxyRequest(char **, char *, char *, char *);
int GRSTx509MakeProxyRequestKS(char **reqtxt, char *proxydir,
char *delegation_id, char *user_dn, int keysize);
char *GRSTx509MakeDelegationID(void);
#ifndef GRST_NO_OPENSSL
int GRSTx509StringToChain(STACK_OF(X509) **, char *);
char *GRSTx509MakeProxyFileName(char *, STACK_OF(X509) *);
#endif
int GRSTx509CacheProxy(char *, char *, char *, char *);
int GRST_is_id_safe(const char *);
#define GRST_HEADFILE "gridsitehead.txt"
#define GRST_FOOTFILE "gridsitefoot.txt"
#define GRST_ADMIN_FILE "gridsite-admin.cgi"
typedef struct { char *text;
void *next; } GRSThttpCharsList;
typedef struct { size_t size;
GRSThttpCharsList *first;
GRSThttpCharsList *last; } GRSThttpBody;
void GRSThttpBodyInit(GRSThttpBody *);
void GRSThttpPrintf(GRSThttpBody *, char *, ...);
int GRSThttpCopy(GRSThttpBody *, char *);
void GRSThttpWriteOut(GRSThttpBody *);
int GRSThttpPrintHeaderFooter(GRSThttpBody *, char *, char *);
int GRSThttpPrintHeader(GRSThttpBody *, char *);
int GRSThttpPrintFooter(GRSThttpBody *, char *);
char *GRSThttpGetCGI(char *);
time_t GRSTasn1TimeToTimeT(char *, size_t);
int GRSTasn1SearchTaglist(struct GRSTasn1TagList taglist[], int, char *);
#ifndef GRST_NO_OPENSSL
int GRSTasn1ParseDump(BIO *, unsigned char *, long,
struct GRSTasn1TagList taglist[], int, int *);
#endif
int GRSTasn1GetX509Name(char *, int, char *, char *,
struct GRSTasn1TagList taglist[], int);
int GRSThtcpNOPrequestMake(char **, int *, unsigned int);
int GRSThtcpNOPresponseMake(char **, int *, unsigned int);
int GRSThtcpTSTrequestMake(char **, int *, unsigned int, char *, char *, char *);
int GRSThtcpTSTresponseMake(char **, int *, unsigned int, char *, char *, char *);
int GRSThtcpMessageParse(GRSThtcpMessage *, char *, int);
#ifndef GRST_PASSCODE_JS
//#define __GRST_PASSCODE_JS__
#define GRST_PASSCODE_JS "<script type=\"text/javascript\" language=\"Javascript\"><!--\nfunction changeValue(formName){ if( document.forms[formName].passcode.value==\"\" ) document.forms[formName].passcode.value=getCookie(\"GRIDHTTP_PASSCODE\"); return true; } \nfunction getCookie(c_name){ if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + \"=\"); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(\";\",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); }} return \"\"; } \n -->\n</script>"
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif // HEADER_GRIDSITE_H
GRSTgaclPermFromChar
GRSTgaclPerm GRSTgaclPermFromChar(char *)
Definition: grst_gacl.c:546
GRSTgaclPermToChar
char * GRSTgaclPermToChar(GRSTgaclPerm)
Definition: grst_gacl.c:531
GRSTx509CachedProxyKeyFind
char * GRSTx509CachedProxyKeyFind(char *, char *, char *, STACK_OF(X509) *)
Find a temporary proxy private key file in the proxy cache.
Definition: grst_canl_x509.c:2091
GRSThttpUrlEncode
char * GRSThttpUrlEncode(char *)
Definition: grst_http.c:369
GRSTgaclUserAddCred
int GRSTgaclUserAddCred(GRSTgaclUser *, GRSTgaclCred *)
Definition: grst_gacl.c:959
GRSTx509CheckChain
int GRSTx509CheckChain(int *, X509_STORE_CTX *)
Definition: grst_canl_x509.c:1355
GRSTx509MakeProxyRequestKS
int GRSTx509MakeProxyRequestKS(char **reqtxt, char *proxydir, char *delegation_id, char *user_dn, int keysize)
Definition: grst_canl_x509.c:2338
GRSThttpGetCGI
char * GRSThttpGetCGI(char *)
Definition: grst_http.c:237
GRSTgaclEntryNew
GRSTgaclEntry * GRSTgaclEntryNew(void)
Definition: grst_gacl.c:367
GRSTx509MakeProxyRequest
int GRSTx509MakeProxyRequest(char **, char *, char *, char *)
Create a X.509 request for a GSI proxy and its private key.
Definition: grst_canl_x509.c:2352
GRSThtcpCountstr::length_msb
unsigned char length_msb
Definition: gridsite.h:226
GRSThttpCharsList::next
void * next
Definition: gridsite.h:438
GRSTx509Cert::next
void * next
Definition: gridsite.h:192
GRSTx509Chain
Definition: gridsite.h:207
GRSTgaclCred::next
void * next
Definition: gridsite.h:117
GRSThttpWriteOut
void GRSThttpWriteOut(GRSThttpBody *)
Definition: grst_http.c:150
GRSTx509Cert
Definition: gridsite.h:181
GRSTgaclPermPrint
int GRSTgaclPermPrint(GRSTgaclPerm, FILE *)
Definition: grst_gacl.c:489
GRSTgaclEntryAllowPerm
int GRSTgaclEntryAllowPerm(GRSTgaclEntry *, GRSTgaclPerm)
Definition: grst_gacl.c:503
GRSTgaclCred
Definition: gridsite.h:112
GRSTgaclDNlistHasUser
int GRSTgaclDNlistHasUser(char *listurl, GRSTgaclUser *user)
Definition: grst_gacl.c:1279
GRSTx509CachedProxyFind
char char X509 *char * GRSTx509CachedProxyFind(char *, char *, char *)
Find a proxy file in the proxy cache.
Definition: grst_canl_x509.c:2056
GRSTasn1GetX509Name
int GRSTasn1GetX509Name(char *, int, char *, char *, struct GRSTasn1TagList taglist[], int)
Definition: grst_asn1.c:497
GRSTgaclCredNew
GRSTgaclCred * GRSTgaclCredNew(char *type)
Definition: grst_gacl.c:137
GRSTgaclUserFindCredtype
GRSTgaclCred * GRSTgaclUserFindCredtype(GRSTgaclUser *, char *)
Definition: grst_gacl.c:1046
GRSTgaclUserNew
GRSTgaclUser * GRSTgaclUserNew(GRSTgaclCred *)
Definition: grst_gacl.c:929
GRSTgaclCred::notafter
time_t notafter
Definition: gridsite.h:116
GRSThtcpMessage::total_length_lsb
unsigned char total_length_lsb
Definition: gridsite.h:233
GRSTx509CreateProxyRequest
int GRSTx509CreateProxyRequest(char **, char **, char *)
Create a X.509 request for a GSI proxy and its private key.
Definition: grst_canl_x509.c:2236
GRSTgaclCred::delegation
int delegation
Definition: gridsite.h:113
GRSTx509StringToChain
int GRSTx509StringToChain(STACK_OF(X509) **, char *)
Create a stack of X509 certificate from a PEM-encoded string.
Definition: grst_canl_x509.c:2593
GRSTgaclEntry::allowed
GRSTgaclPerm allowed
Definition: gridsite.h:129
GRSTgaclAcl
Definition: gridsite.h:133
GRSTasn1TagList::start
int start
Definition: gridsite.h:174
GRSTgaclCredCmpAuri
int GRSTgaclCredCmpAuri(GRSTgaclCred *, GRSTgaclCred *)
Definition: grst_gacl.c:342
GRSTx509CreateProxyRequestKS
int GRSTx509CreateProxyRequestKS(char **reqtxt, char **keytxt, char *ocspurl, int keysize)
Definition: grst_canl_x509.c:2225
GRSTasn1TagList::headerlength
int headerlength
Definition: gridsite.h:175
GRSThtcpMessage::data_length_msb
unsigned char data_length_msb
Definition: gridsite.h:236
GRSTgaclEntry::next
void * next
Definition: gridsite.h:131
GRSTgaclUserHasAURI
GRSTgaclUser *int GRSTgaclUserHasAURI(GRSTgaclUser *, char *)
Definition: grst_gacl.c:1284
GRSTgaclCred::auri
char * auri
Definition: gridsite.h:112
GRSThtcpTSTrequestMake
int GRSThtcpTSTrequestMake(char **, int *, unsigned int, char *, char *, char *)
Definition: grst_htcp.c:116
GRSThtcpMessage::version_lsb
unsigned char version_lsb
Definition: gridsite.h:235
GRSTgaclEntryPrint
int GRSTgaclEntryPrint(GRSTgaclEntry *, FILE *)
Definition: grst_gacl.c:449
GRSTgaclEntryUndenyPerm
int GRSTgaclEntryUndenyPerm(GRSTgaclEntry *, GRSTgaclPerm)
Definition: grst_gacl.c:524
GRSTgaclFileIsAcl
int GRSTgaclFileIsAcl(char *)
Definition: grst_gacl.c:835
GRSTgaclEntry
Definition: gridsite.h:128
GRSTgaclUser::firstcred
GRSTgaclCred * firstcred
Definition: gridsite.h:135
GRSTgaclUserHasCred
int GRSTgaclUserHasCred(GRSTgaclUser *, GRSTgaclCred *)
Definition: grst_gacl.c:982
GRSTx509FindProxyFileName
char * GRSTx509FindProxyFileName(void)
Find proxy file name of the current user.
Definition: grst_canl_x509.c:1740
GRSTasn1TimeToTimeT
time_t GRSTasn1TimeToTimeT(char *, size_t)
ASN1 time string (in a char *) to time_t.
Definition: grst_asn1.c:24
GRSTx509Cert::issuer
char * issuer
Definition: gridsite.h:183
GRSTgaclAction
int GRSTgaclAction
Definition: gridsite.h:125
GRSTgaclEntryDenyPerm
int GRSTgaclEntryDenyPerm(GRSTgaclEntry *, GRSTgaclPerm)
Definition: grst_gacl.c:517
GRSThtcpMessage::f1
unsigned int f1
Definition: gridsite.h:241
GRSTasn1ParseDump
int GRSTasn1ParseDump(BIO *, unsigned char *, long, struct GRSTasn1TagList taglist[], int, int *)
Definition: grst_asn1.c:457
GRSTgaclCredCreate
GRSTgaclCred * GRSTgaclCredCreate(char *, char *)
Definition: grst_gacl.c:97
GRSTgaclEntryAddCred
int GRSTgaclEntryAddCred(GRSTgaclEntry *, GRSTgaclCred *)
Definition: grst_gacl.c:267
GRSTgaclCredAddValue
int GRSTgaclCredAddValue(GRSTgaclCred *cred, char *name, char *rawvalue)
Definition: grst_gacl.c:160
GRSThtcpMessage::opcode
unsigned int opcode
Definition: gridsite.h:239
GRSThttpBodyInit
void GRSThttpBodyInit(GRSThttpBody *)
Definition: grst_http.c:53
GRSThtcpMessage
Definition: gridsite.h:232
GRSThttpBody
Definition: gridsite.h:440
GRSTx509ChainLoadCheck
int GRSTx509ChainLoadCheck(GRSTx509Chain **, STACK_OF(X509) *, X509 *, char *, char *)
Check certificate chain for GSI proxy acceptability.
Definition: grst_canl_x509.c:1323
GRSTx509ProxyGetTimes
int GRSTx509ProxyGetTimes(char *, char *, char *, time_t *, time_t *)
Get start and finish validity times of stored GSI proxy file.
Definition: grst_canl_x509.c:2551
GRSTx509Cert::type
int type
Definition: gridsite.h:181
GRSThtcpMessage::total_length_msb
unsigned char total_length_msb
Definition: gridsite.h:232
GRSTx509Cert::notafter
time_t notafter
Definition: gridsite.h:187
GRSThtcpMessage::response
unsigned int response
Definition: gridsite.h:238
GRSTx509IsCA
int GRSTx509IsCA(X509 *)
Check if certificate can be used as a CA to sign standard X509 certs.
Definition: grst_canl_x509.c:299
GRSThtcpMessage::uri
GRSThtcpCountstr * uri
Definition: gridsite.h:245
GRSThttpUrlMildencode
char * GRSThttpUrlMildencode(char *)
Definition: grst_http.c:402
GRSTgaclUser
Definition: gridsite.h:135
GRSTx509Cert::notbefore
time_t notbefore
Definition: gridsite.h:186
GRSThttpUrlDecode
char * GRSThttpUrlDecode(char *)
Definition: grst_http.c:330
GRSTx509MakeProxyFileName
char * GRSTx509MakeProxyFileName(char *, STACK_OF(X509) *)
Return the short file name for the given delegation_id and user_dn.
Definition: grst_canl_x509.c:2692
GRSTx509MakeProxyCert
int GRSTx509MakeProxyCert(char **, FILE *, char *, char *, char *, int)
Make a GSI Proxy chain from a request, certificate and private key.
Definition: grst_canl_x509.c:1768
GRSTx509KnownCriticalExts
int GRSTx509KnownCriticalExts(X509 *)
Check critical extensions.
Definition: grst_canl_x509.c:262
GRSTx509ProxyDestroy
int GRSTx509ProxyDestroy(char *, char *, char *)
Destroy stored GSI proxy files.
Definition: grst_canl_x509.c:2503
GRSTx509GetVomsCreds
int GRSTx509GetVomsCreds(int *lastcred, int maxcreds, size_t credlen, char *creds, X509 *usercert, STACK_OF(X509) *certstack, char *vomsdir)
Get the VOMS attributes in the extensions to the given cert stack.
Definition: grst_canl_x509.c:1538
GRSTgaclPerm
unsigned int GRSTgaclPerm
Definition: gridsite.h:126
GRSTx509ChainFree
int GRSTx509ChainFree(GRSTx509Chain *)
Definition: grst_canl_x509.c:314
GRSTgaclUserLoadDNlists
char *int GRSTgaclUserLoadDNlists(GRSTgaclUser *, char *)
Definition: grst_gacl.c:1185
GRSThtcpMessage::entity_hdrs
GRSThtcpCountstr * entity_hdrs
Definition: gridsite.h:249
GRSThtcpMessage::rr
unsigned int rr
Definition: gridsite.h:240
GRSTgaclFileFindAclname
char * GRSTgaclFileFindAclname(char *)
Definition: grst_gacl.c:848
GRSThttpBody::last
GRSThttpCharsList * last
Definition: gridsite.h:442
GRSTgaclEntry::firstcred
GRSTgaclCred * firstcred
Definition: gridsite.h:128
GRSTgaclNamevalue
GRSTgaclNamevalue
Definition: gridsite.h:123
GRSTgaclAclSave
int GRSTgaclAclSave(GRSTgaclAcl *, char *)
Definition: grst_gacl.c:605
GRSThtcpMessage::version_msb
unsigned char version_msb
Definition: gridsite.h:234
GRSThtcpMessage::resp_hdrs
GRSThtcpCountstr * resp_hdrs
Definition: gridsite.h:248
GRSTgaclCredCredPrint
int GRSTgaclCredCredPrint(GRSTgaclCred *, FILE *)
STACK_OF
char X509 STACK_OF(X509) *
GRSTx509Chain::firstcert
GRSTx509Cert * firstcert
Definition: gridsite.h:207
GRSTgaclUserSetDNlists
int GRSTgaclUserSetDNlists(GRSTgaclUser *user, char *dnlists)
Definition: grst_gacl.c:1076
GRSTgaclEntryDelCred
int GRSTgaclEntryDelCred(GRSTgaclEntry *, GRSTgaclCred *)
Definition: grst_gacl.c:296
GRSTerrorLogFunc
int(* GRSTerrorLogFunc)(char *, int, int, char *,...)
Definition: grst_err.c:40
GRSTgaclEntryFree
int GRSTgaclEntryFree(GRSTgaclEntry *)
Definition: grst_gacl.c:386
GRSTx509CertLoad
int GRSTx509CertLoad(GRSTx509Cert *, X509 *)
GRSThtcpMessage::data_length_lsb
unsigned char data_length_lsb
Definition: gridsite.h:237
GRSThttpBody::first
GRSThttpCharsList * first
Definition: gridsite.h:441
GRSTx509CacheProxy
int GRSTx509CacheProxy(char *, char *, char *, char *)
Store a GSI proxy chain in the proxy cache, along with the private key.
Definition: grst_canl_x509.c:2779
GRSThttpCharsList
Definition: gridsite.h:437
GRSTgaclEntryUnallowPerm
int GRSTgaclEntryUnallowPerm(GRSTgaclEntry *, GRSTgaclPerm)
Definition: grst_gacl.c:510
GRSThtcpNOPresponseMake
int GRSThtcpNOPresponseMake(char **, int *, unsigned int)
Definition: grst_htcp.c:81
GRSTasn1SearchTaglist
int GRSTasn1SearchTaglist(struct GRSTasn1TagList taglist[], int, char *)
Definition: grst_asn1.c:119
GRSThttpPrintHeader
int GRSThttpPrintHeader(GRSThttpBody *, char *)
Definition: grst_http.c:205
GRSTasn1TagList::tag
int tag
Definition: gridsite.h:177
GRSTasn1TagList::length
int length
Definition: gridsite.h:176
GRSTgaclAclTestexclUser
GRSTgaclPerm GRSTgaclAclTestexclUser(GRSTgaclAcl *, GRSTgaclUser *)
Definition: grst_gacl.c:1343
GRSTgaclAclNew
GRSTgaclAcl * GRSTgaclAclNew(void)
Definition: grst_gacl.c:563
GRSTx509Cert::dn
char * dn
Definition: gridsite.h:184
GRSThtcpCountstr::length_lsb
unsigned char length_lsb
Definition: gridsite.h:227
GRSTgaclAclLoadFile
GRSTgaclAcl * GRSTgaclAclLoadFile(char *)
Definition: grst_gacl.c:758
GRSTasn1TagList
Definition: gridsite.h:173
GRSTx509VerifyCallback
int GRSTx509VerifyCallback(int, X509_STORE_CTX *)
Example VerifyCallback routine.
Definition: grst_canl_x509.c:1381
GRSThttpPrintf
void GRSThttpPrintf(GRSThttpBody *, char *,...)
Definition: grst_http.c:58
GRSTx509Cert::value
char * value
Definition: gridsite.h:185
GRSTgaclCredFree
int GRSTgaclCredFree(GRSTgaclCred *)
Definition: grst_gacl.c:223
__attribute__
__attribute__((deprecated)) typedef struct
Definition: gridsite.h:120
GRSTx509CompactToCred
GRSTgaclCred * GRSTx509CompactToCred(char *grst_cred)
Turn a Compact Cred line into a GRSTgaclCred object.
Definition: grst_canl_x509.c:1596
GRSTx509NameCmp
int GRSTx509NameCmp(char *, char *)
Compare X509 Distinguished Name strings.
Definition: grst_canl_x509.c:223
GRSThtcpMessage::version
GRSThtcpCountstr * version
Definition: gridsite.h:246
GRSThtcpMessage::cache_hdrs
GRSThtcpCountstr * cache_hdrs
Definition: gridsite.h:250
GRSThtcpMessage::req_hdrs
GRSThtcpCountstr * req_hdrs
Definition: gridsite.h:247
GRSTgaclInit
int GRSTgaclInit(void)
Definition: grst_gacl.c:77
GRSThttpCopy
int GRSThttpCopy(GRSThttpBody *, char *)
Definition: grst_http.c:95
GRSThttpCharsList::text
char * text
Definition: gridsite.h:437
GRSThtcpMessageParse
int GRSThtcpMessageParse(GRSThtcpMessage *, char *, int)
Definition: grst_htcp.c:233
GRSTgaclAclTestUser
GRSTgaclPerm GRSTgaclAclTestUser(GRSTgaclAcl *, GRSTgaclUser *)
Definition: grst_gacl.c:1298
GRSTgaclAcl::firstentry
GRSTgaclEntry * firstentry
Definition: gridsite.h:133
GRSThtcpCountstr
Definition: gridsite.h:226
GRSTgaclAclPrint
int GRSTgaclAclPrint(GRSTgaclAcl *, FILE *)
Definition: grst_gacl.c:591
GRSTgaclEntry::denied
GRSTgaclPerm denied
Definition: gridsite.h:130
GRSThttpPrintFooter
int GRSThttpPrintFooter(GRSThttpBody *, char *)
Definition: grst_http.c:221
GRSThtcpTSTresponseMake
int GRSThtcpTSTresponseMake(char **, int *, unsigned int, char *, char *, char *)
Definition: grst_htcp.c:165
GRSThtcpMessage::reserved
unsigned int reserved
Definition: gridsite.h:242
GRSTgaclAclAddEntry
int GRSTgaclAclAddEntry(GRSTgaclAcl *, GRSTgaclEntry *)
Definition: grst_gacl.c:433
GRSTx509CompactCreds
int GRSTx509CompactCreds(int *lastcred, int maxcreds, size_t credlen, char *creds, STACK_OF(X509) *certstack, char *vomsdir, X509 *peercert)
Get the credentials in an X509 cert/GSI proxy, including any VOMS.
Definition: grst_canl_x509.c:1657
GRSTasn1TagList::treecoords
char treecoords[GRST_ASN1_MAXCOORDLEN+1]
Definition: gridsite.h:173
GRSThtcpMessage::trans_id
unsigned int trans_id
Definition: gridsite.h:243
GRSTgaclUserFree
int GRSTgaclUserFree(GRSTgaclUser *)
Definition: grst_gacl.c:946
GRSTgaclCred::nist_loa
int nist_loa
Definition: gridsite.h:114
GRSTx509Cert::raw
void * raw
Definition: gridsite.h:191
GRSThttpBody::size
size_t size
Definition: gridsite.h:440
GRSTgaclAclFree
int GRSTgaclAclFree(GRSTgaclAcl *)
Definition: grst_gacl.c:579
GRSThttpPrintHeaderFooter
int GRSThttpPrintHeaderFooter(GRSThttpBody *, char *, char *)
Definition: grst_http.c:168
GRSThtcpNOPrequestMake
int GRSThtcpNOPrequestMake(char **, int *, unsigned int)
Definition: grst_htcp.c:47
GRSTx509ChainLoad
int GRSTx509ChainLoad(GRSTx509Chain **chain, STACK_OF(X509) *certstack, X509 *lastcert, char *capath, char *vomsdir)
Definition: grst_canl_x509.c:1015
GRSThtcpMessage::method
GRSThtcpCountstr * method
Definition: gridsite.h:244
GRSTx509Cert::errors
int errors
Definition: gridsite.h:182
GRSTgaclCred::notbefore
time_t notbefore
Definition: gridsite.h:115
GRSTgaclAclLoadforFile
GRSTgaclAcl * GRSTgaclAclLoadforFile(char *)
Definition: grst_gacl.c:906
GRSTx509MakeDelegationID
char * GRSTx509MakeDelegationID(void)
Returns a Delegation ID based on hash of GRST_CRED_0, ...
Definition: grst_canl_x509.c:2643
GRSTx509Cert::ocsp
char * ocsp
Definition: gridsite.h:190
GRST_is_id_safe
int GRST_is_id_safe(const char *)
Definition: grst_canl_x509.c:2876
int
int
Definition: gridsite.h:398
GRSTx509Cert::delegation
int delegation
Definition: gridsite.h:188