36 #ifndef HEADER_GRIDSITE_H
37 #define HEADER_GRIDSITE_H
40 #define GRST_VERSION 010500
47 #ifndef GRST_NO_OPENSSL
50 #include <openssl/ssl.h>
53 #ifndef HEADER_CRYPTO_H
54 #include <openssl/crypto.h>
82 #define GRST_RET_FAILED 1000
85 #define GRST_RET_CERT_NOT_FOUND 1001
88 #define GRST_RET_BAD_SIGNATURE 1002
91 #define GRST_RET_NO_SUCH_FILE 1003
95 #define GRSTerrorLog(GRSTerrorLevel, ...) ((GRSTerrorLogFunc != NULL) && ((GRSTerrorLogFunc)(__FILE__, __LINE__, GRSTerrorLevel, __VA_ARGS__)))
101 #define GRST_LOG_EMERG 0
102 #define GRST_LOG_ALERT 1
103 #define GRST_LOG_CRIT 2
104 #define GRST_LOG_ERR 3
105 #define GRST_LOG_WARNING 4
106 #define GRST_LOG_NOTICE 5
107 #define GRST_LOG_INFO 6
108 #define GRST_LOG_DEBUG 7
110 #define GRST_MAX_TIME_T INT32_MAX
121 typedef struct {
char *name;
137 #define GRST_PERM_NONE 0
138 #define GRST_PERM_READ 1
139 #define GRST_PERM_EXEC 2
140 #define GRST_PERM_LIST 4
141 #define GRST_PERM_WRITE 8
142 #define GRST_PERM_ADMIN 16
143 #define GRST_PERM_ALL 31
146 #define GRSTgaclPermIsNone(perm) ((perm) == 0)
148 #define GRSTgaclPermHasNone(perm) ((perm) == 0)
149 #define GRSTgaclPermHasRead(perm) (((perm) & GRST_PERM_READ ) != 0)
150 #define GRSTgaclPermHasExec(perm) (((perm) & GRST_PERM_EXEC ) != 0)
151 #define GRSTgaclPermHasList(perm) (((perm) & GRST_PERM_LIST ) != 0)
152 #define GRSTgaclPermHasWrite(perm) (((perm) & GRST_PERM_WRITE) != 0)
153 #define GRSTgaclPermHasAdmin(perm) (((perm) & GRST_PERM_ADMIN) != 0)
155 #define GRST_ACTION_ALLOW 0
156 #define GRST_ACTION_DENY 1
158 #define GRST_HIST_PREFIX ".grsthist"
159 #define GRST_ACL_FILE ".gacl"
160 #define GRST_DN_LISTS "/etc/grid-security/dn-lists"
161 #define GRST_RECURS_LIMIT 9
163 #define GRST_PROXYCERTINFO_OLD_OID "1.3.6.1.4.1.3536.1.222"
164 #define GRST_PROXYCERTINFO_OID "1.3.6.1.5.5.7.1.14"
165 #define GRST_VOMS_OID "1.3.6.1.4.1.8005.100.100.5"
166 #define GRST_VOMS_PK_CERT_LIST_OID "1.3.6.1.4.1.8005.100.100.10"
167 #define GRST_VOMS_DIR "/etc/grid-security/vomsdir"
168 #define GRST_KEYUSAGE_OID "2.5.29.15"
170 #define GRST_ASN1_MAXCOORDLEN 50
171 #define GRST_ASN1_MAXTAGS 500
179 #define GRST_X509_SERIAL_DIGITS 49
189 char serial[GRST_X509_SERIAL_DIGITS+1];
194 #define GRST_CERT_BAD_FORMAT 1
195 #define GRST_CERT_BAD_CHAIN 2
196 #define GRST_CERT_BAD_SIG 4
197 #define GRST_CERT_BAD_TIME 8
198 #define GRST_CERT_BAD_OCSP 16
200 #define GRST_CERT_TYPE_CA 1
201 #define GRST_CERT_TYPE_EEC 2
202 #define GRST_CERT_TYPE_PROXY 3
203 #define GRST_CERT_TYPE_VOMS 4
208 #ifndef GRST_NO_OPENSSL
214 #define GRST_HTTP_PORT 777
215 #define GRST_HTTPS_PORT 488
216 #define GRST_HTCP_PORT 777
217 #define GRST_GSIFTP_PORT 2811
219 #define GRSThtcpNOPop 0
220 #define GRSThtcpTSTop 1
226 #define GRSThtcpCountstrLen(string) (256*((string)->length_msb) + (string)->length_lsb)
234 unsigned int response : 4;
235 unsigned int opcode : 4;
238 unsigned int reserved : 6;
258 #define GRSTgaclCredGetAuri(cred) ((cred)->auri)
260 #define GRSTgaclCredSetNotBefore(cred, time) ((cred)->notbefore = (time))
261 #define GRSTgaclCredGetNotBefore(cred) ((cred)->notbefore)
263 #define GRSTgaclCredSetNotAfter(cred, time) ((cred)->notafter = (time))
264 #define GRSTgaclCredGetNotAfter(cred) ((cred)->notafter)
266 #define GRSTgaclCredSetDelegation(cred, level) ((cred)->delegation = (level))
267 #define GRSTgaclCredGetDelegation(cred) ((cred)->delegation)
269 #define GRSTgaclCredSetNistLoa(cred, level) ((cred)->nist_loa = (level))
270 #define GRSTgaclCredGetNistLoa(cred) ((cred)->nist_loa)
386 #ifndef GRST_NO_OPENSSL
414 #ifndef GRST_NO_OPENSSL
421 #define GRST_HEADFILE "gridsitehead.txt"
422 #define GRST_FOOTFILE "gridsitefoot.txt"
423 #define GRST_ADMIN_FILE "gridsite-admin.cgi"
443 #ifndef GRST_NO_OPENSSL
456 #ifndef GRST_PASSCODE_JS
458 #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>"
465 #endif // HEADER_GRIDSITE_H