#ifndef WUCME_H #define WUCME_H /** https://github.com/ndilieto/uacme/ **/ #include #include #include #include #include #define IS_WUCME /* wuCME idiosyncracies */ /* logical names used */ #define WUCME_ACTIVE "WUCME_ACTIVE" #define WUCME_CA_BUNDLE "WUCME_CA_BUNDLE" #define WUCME_CHALLENGE "WUCME_CHALLENGE" #define WUCME_DAYS "WUCME_DAYS" #define WUCME_HERE "WUCME_HERE" #define WUCME_HOURLY "WUCME_HOURLY" #define WUCME_ISSUER "WUCME_ISSUER" #define WUCME_LOAD "WUCME_LOAD" #define WUCME_LOGS "WUCME_LOGS" #define WUCME_MAIL "WUCME_MAIL" #define WUCME_NO_DAILY "WUCME_NO_DAILY" #define WUCME_NO_HTTP01 "WUCME_NO_HTTP01" #define WUCME_OPCOM "WUCME_OPCOM" #define WUCME_POLL "WUCME_POLL" #define WUCME_SPOUT "WUCME_SPOUT" #define WUCME_SUBJECT "WUCME_SUBJECT" #define WUCME_TYPE "WUCME_TYPE" #define WUCME_VERBOSE "WUCME_VERBOSE" // #define WUCME_VERIFY "WUCME_VERIFY" obsoleted by v1.1.5 /* used when probing port 80 for http-01 challenge behaviour */ #define WUCME_PROBE_TOKEN "wuCME-probe" #define WUCME_PROBE_CHALLENGE "/.well-known/acme-challenge/" WUCME_PROBE_TOKEN #define USE_OPENSSL #define PRODUCTION_URL "https://acme-v02.api.letsencrypt.org/directory" #define STAGING_URL "https://acme-staging-v02.api.letsencrypt.org/directory" #define IS_CLI 1 #define IS_PROCTOR 2 #define IS_SCRIPT 3 #ifndef SIZE_MAX #define SIZE_MAX INT_MAX #endif #define EXIT_FI_LI(status) \ { printf ("Status:500\r\n\r\n[%s:%d]\r\n", FI_LI); exit(status); } int mainline (int, char*[]); void verboserer (int); /* wucme.c protoypes */ int wucme2Ods2 (char*); void wucmeArgcArgv (int, char*[]); void wucmeBegin (void); void wucmeChallenge80 (const char*); void wucmeCli (int argc, char *argv[]); char* wucmeChallenge (char*, char*); void wucmeCheckLog (void); char* wucmeDir (void); char* wucmeFindHeader (const char*, const char*); void wucmeGetSyi (void); char* wucmeLog (int); int wucmeProbe80 (const char*, int); int wucmeServerSoftware (void); int wucmeMode (int); /* wucme_https.c protoypes */ char* httpsGetContent (void); int httpsGetContentLength (void); char* httpsGetContentType (void); char* httpsGetError (void); char* httpsGetHeader (void); int httpsGetHeaderLength (void); int httpsGetRequest (char*, char*); int httpsGetResponseCode (void); char* httpsGetResponseFull (void); int httpsGetResponseLength (void); int httpsPostRequest (char*, char*, char*, int, char*); void httpsTest (char*); /* wuscript.c protoypes */ void ScriptAdmin (char*); void ScriptBegin (int, char*[]); void ScriptCallout (char*, ...); void ScriptChallenge (char*); void ScriptCheckChallenge (void); void ScriptRecordHeader (void); void ScriptStreamHeader (void); void ScriptZero2C (void); /* wuhttp01.c prototypes */ int Http01Begin (char*); void Http01CancelListen (int); void Http01CancelRequest (int); int Http01Request (int); void Http01Spawn (int); /* wutil.c protoypes */ void UtilAdjustPriv (void); int UtilCrePrcDetach (char*, char*, char*, char*, ulong*); void UtilSysCreLnm (char*, char*); char* UtilGetMsg (int); char* UtilImageName (void); int UtilHavePriv (ulong*); int UtilHaveSysPrv (void); char* UtilSetPrn (char*); void UtilAdjustPriv (void); char *UtilSysTrnLnm (char*); char *UtilTrnLnm (char*, char*, int); int UtilVmsName (char*, int); #define __attribute__(stuff) #include int asprintf (char**, const char*, ...); int vasprintf (char**, const char*, va_list); char* doasprintf (char*, ...); char* strndup (const char*, size_t); char* tstamp (ulong*); char* tstamp2 (ulong*); /* * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. */ int errx (int, const char*, ...); int verrx (int, const char*, va_list); void warn (const char*, ...); void warnx (const char*, ...); void vwarn (const char *fmt, va_list ap); void vwarnx (const char *fmt, va_list ap); void rk_warnerr (int, const char*, va_list); char* strcasestr(const char*, const char*); #endif