#include "config.h"#include "womalloc.h"#include "request.h"#include "response.h"#include "log.h"#include "transaction.h"#include "appcfg.h"#include "strtbl.h"#include "MoreURLCUtilities.h"#include "errors.h"#include "httperrors.h"#include "listing.h"#include "wastring.h"#include "prvr_ext.h"#include "httpext.h"#include <windows.h>#include <string.h>#include <stdio.h>#include <malloc.h>#include "iis_http_headers.h"

Classes | |
| struct | _regthing |
Defines | |
| #define | BUFSZ 2048 |
| #define | CGI_DOCUMENT_ROOT "DOCUMENT_ROOT" |
| #define | CGI_PATH_INFO "PATH_INFO" |
| #define | CGI_SCRIPT_NAME "SCRIPT_NAME" |
| #define | CGI_SERVER_PROTOCOL "SERVER_PROTOCOL" |
| #define | CRLF "\r\n" |
| #define | MAX_VAL_LENGTH 4096 |
Typedefs | |
| typedef struct _regthing | regthing |
Functions | |
| __declspec (dllexport) | |
| static void | copyHeaderForServerVariable (char *var, EXTENSION_CONTROL_BLOCK *p, HTTPRequest *req) |
| static void | copyHeaders (EXTENSION_CONTROL_BLOCK *p, HTTPRequest *req) |
| static void | copyHeadersAllRaw (EXTENSION_CONTROL_BLOCK *p, HTTPRequest *req) |
| static void | copyHeadersServerVariables (char *variables[], EXTENSION_CONTROL_BLOCK *p, HTTPRequest *req) |
| static DWORD | die (EXTENSION_CONTROL_BLOCK *p, const char *msg, int status) |
| static DWORD | die_resp (EXTENSION_CONTROL_BLOCK *p, HTTPResponse *resp) |
| MS_BOOL WINAPI | DllMain (HANDLE hinst, ULONG reason, LPVOID ptr) |
| static char * | getHeader (EXTENSION_CONTROL_BLOCK *p, const char *key) |
| static strtbl * | read_registry_config () |
| static void | sendResponse (EXTENSION_CONTROL_BLOCK *p, HTTPResponse *resp) |
Variables | |
| static int | adaptorEnabled |
| static const regthing | options [] |
| char * | WA_adaptorName = "IIS" |
| #define BUFSZ 2048 |
| #define CGI_DOCUMENT_ROOT "DOCUMENT_ROOT" |
| #define CGI_PATH_INFO "PATH_INFO" |
| #define CGI_SCRIPT_NAME "SCRIPT_NAME" |
client certificate support If you want to access the encoded bytes of the certificate, you'll need to get a newer version of httpext.h, and have wincrypt.h as well. You should then be able to uncomment lines surrounded by client certificate support comments, recompile with _WIN32_WINNT = 0x400 defined, and run. Warning before you get started. The certificate will be encoded in some format that will require you to do significant work on your end. All the decoded bits will already be in the headers. end client certificate support
| #define CGI_SERVER_PROTOCOL "SERVER_PROTOCOL" |
| #define CRLF "\r\n" |
client certificate support define MAX_CERT_SIZE 8192 client certificate support
| #define MAX_VAL_LENGTH 4096 |
| __declspec | ( | dllexport | ) |
| static void copyHeaderForServerVariable | ( | char * | var, | |
| EXTENSION_CONTROL_BLOCK * | p, | |||
| HTTPRequest * | req | |||
| ) | [static] |
| static void copyHeaders | ( | EXTENSION_CONTROL_BLOCK * | p, | |
| HTTPRequest * | req | |||
| ) | [static] |
| static void copyHeadersAllRaw | ( | EXTENSION_CONTROL_BLOCK * | p, | |
| HTTPRequest * | req | |||
| ) | [static] |
client certificate support static char* make_cert_one_line(BYTE* bytes, int len) { char *str = (char*)malloc(sizeof(char)*len + 1); int i; for(i = 0 ; i < len ; i++) { WOLog(WO_DBG, "Got byte %d", bytes[i]); if (bytes[i] == '
') { str[i] = ' '; } else { str[i] = bytes[i]; } } return str; } end client certificate support
client certificate support BYTE* CertificateBuf = (BYTE*)calloc(MAX_CERT_SIZE, sizeof(BYTE)); CERT_CONTEXT_EX ccex; ccex.cbAllocated = MAX_CERT_SIZE; ccex.CertContext.pbCertEncoded = CertificateBuf; end client certificate support
client certificate support
if (p->ServerSupportFunction(p->ConnID, HSE_REQ_GET_CERT_INFO_EX, (LPVOID)&ccex, 0, 0) == FALSE) { WOLog(WO_DBG, "Didn't get a certificate, oh well."); } else { ccex now contains valid client certificate information. DWORD clen = ccex.CertContext.cbCertEncoded; char* cstr = make_cert_one_line((BYTE*)CertificateBuf, clen); Don't bother copying the key or value req_addHeader(req, "SSL_CLIENT_CERT", cstr, 0); free(CertificateBuf); free(cstr); } end client certificate support
| static void copyHeadersServerVariables | ( | char * | variables[], | |
| EXTENSION_CONTROL_BLOCK * | p, | |||
| HTTPRequest * | req | |||
| ) | [static] |
| static DWORD die | ( | EXTENSION_CONTROL_BLOCK * | p, | |
| const char * | msg, | |||
| int | status | |||
| ) | [static] |
| static DWORD die_resp | ( | EXTENSION_CONTROL_BLOCK * | p, | |
| HTTPResponse * | resp | |||
| ) | [static] |
| MS_BOOL WINAPI DllMain | ( | HANDLE | hinst, | |
| ULONG | reason, | |||
| LPVOID | ptr | |||
| ) |
| static char* getHeader | ( | EXTENSION_CONTROL_BLOCK * | p, | |
| const char * | key | |||
| ) | [static] |
| static strtbl * read_registry_config | ( | ) | [static] |
| static void sendResponse | ( | EXTENSION_CONTROL_BLOCK * | p, | |
| HTTPResponse * | resp | |||
| ) | [static] |
int adaptorEnabled [static] |
Initial value:
{
{ "WOUSERNAME", WOUSERNAME },
{ "WOPASSWORD", WOPASSWORD },
{ "CONF_INTERVAL", WOCNFINTVL },
{ "CONF_URL", WOCONFIG },
{ "LOG_PATH", WOLOGPATH },
{ "WEBOBJECTS_OPTIONS", WOOPTIONS },
{ NULL, NULL }
}
| char* WA_adaptorName = "IIS" |
1.5.8