/**
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 - 2015 ForgeRock AS.
*/
#include "platform.h"
#include "version.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "am.h"
#ifdef __cplusplus
}
#endif
#include <httpserv.h>
return HRESULT_CODE(hr);
}
return ERROR_SUCCESS;
}
return ERROR_CAN_NOT_COMPLETE;
}
}
return ret;
}
if (out_len > 0) {
}
return tmp;
}
return NULL;
}
if (out_len > 0) {
}
return tmp;
}
return NULL;
}
public :
}
~OpenAMStoredConfig() {
}
}
}
void CleanupStoredContext() {
}
return enabled;
}
}
return aconf;
}
if (pMetadataContainer == NULL) {
return E_UNEXPECTED;
}
if (pModuleConfig != NULL) {
return S_OK;
}
if (pModuleConfig == NULL) {
return E_OUTOFMEMORY;
}
return E_UNEXPECTED;
}
return S_OK;
}
}
return hr;
}
do {
if (pAdminManager == NULL) {
hr = E_UNEXPECTED;
break;
}
break;
}
hr = E_UNEXPECTED;
break;
}
break;
}
hr = E_UNEXPECTED;
break;
}
break;
}
hr = E_UNEXPECTED;
break;
}
}
} while (FALSE);
return hr;
}
do {
hr = E_INVALIDARG;
break;
}
hr = E_UNEXPECTED;
break;
}
*pException = NULL;
if (*pException != NULL) {
hr = E_UNEXPECTED;
break;
}
} while (FALSE);
}
return hr;
}
do {
hr = E_INVALIDARG;
break;
}
hr = E_UNEXPECTED;
break;
}
*pException = NULL;
if (*pException != NULL) {
hr = E_UNEXPECTED;
break;
}
hr = E_OUTOFMEMORY;
break;
}
} while (FALSE);
}
return hr;
}
};
public :
return userName;
}
return userName;
}
return L"OpenAM";
}
}
return hToken;
}
}
return NULL;
}
}
if (InterlockedDecrement(&m_refs) <= 0) {
}
}
return FALSE;
}
return E_NOTIMPL;
}
return NULL;
}
m_refs = 1;
if (dologon) {
error = GetLastError();
if (status) {
}
} else {
}
} else {
}
}
return status;
}
return error;
}
virtual ~OpenAMHttpUser() {
}
};
"%s server variable %s is not available in HttpContext (error: %d)",
} else {
}
return val;
}
return status;
}
return status;
}
if (url_encoded == NULL) {
return AM_ENOMEM;
}
status = AM_SUCCESS;
}
}
if (status == AM_SUCCESS) {
/* remove the script name from path_info to get the real path info */
return status;
}
if (path_info_tmp != NULL) {
}
}
}
return status;
}
/* remove all instances of the header first */
}
value_data[value_sz] = 0;
return AM_ERROR;
}
} else {
return AM_ENOMEM;
}
}
return AM_SUCCESS;
}
const char *cookie;
char *header_data;
if (header_data != NULL) {
header_data[header_sz] = 0;
status = AM_SUCCESS;
} else {
AM_LOG_WARNING(rq->instance_id, "%s failed to set response header Set-Cookie value %s (%d)", thisfunc,
}
} else {
}
} else {
if (new_cookie != NULL) {
} else {
}
}
return status;
}
/*value is empty, sdk is setting a cookie in response*/
}
value_data[value_sz] = 0;
status = AM_SUCCESS;
} else {
}
} else {
}
return status;
}
switch (v) {
case AM_SUCCESS:
return RQ_NOTIFICATION_CONTINUE;
case AM_EAGAIN:
return RQ_NOTIFICATION_PENDING;
case AM_PDP_DONE:
case AM_DONE:
return RQ_NOTIFICATION_FINISH_REQUEST;
case AM_NOT_HANDLING:
return RQ_NOTIFICATION_CONTINUE;
case AM_NOT_FOUND:
return RQ_NOTIFICATION_FINISH_REQUEST;
case AM_REDIRECT:
return RQ_NOTIFICATION_FINISH_REQUEST;
case AM_FORBIDDEN:
return RQ_NOTIFICATION_FINISH_REQUEST;
case AM_BAD_REQUEST:
return RQ_NOTIFICATION_FINISH_REQUEST;
case AM_ERROR:
return RQ_NOTIFICATION_FINISH_REQUEST;
case AM_NOT_IMPLEMENTED:
return RQ_NOTIFICATION_FINISH_REQUEST;
default:
return RQ_NOTIFICATION_FINISH_REQUEST;
}
}
return AM_ERROR;
}
return AM_SUCCESS;
}
}
} else {
}
}
if (status != AM_SUCCESS) {
}
return status;
}
void *data;
if (r->GetRemainingEntityBytes() > 0) {
while (r->GetRemainingEntityBytes() != 0) {
return AM_ERROR;
}
}
return AM_ENOMEM;
} else {
}
read_bytes += rc;
out[read_bytes] = 0;
status = AM_SUCCESS;
}
}
if (status == AM_SUCCESS) {
r->DeleteHeader("CONTENT_LENGTH");
}
return status;
}
int i;
for (i = 0; i<sizeof (keyHeader); i++) {
}
for (i = 0; i<sizeof (keyLen); i++) {
}
for (i = 0; i < 8; i++) {
}
if (CryptImportKey(hCryptProv, (BYTE*) & bKey, sizeof (keyHeader) + sizeof (DWORD) + 8, 0, 0, &hKey)) {
status = AM_SUCCESS;
}
}
}
}
return status;
}
const char *cont_type) {
}
public :
userPassword = NULL;
userPasswordSize = 0;
}
if (clonedContext != NULL) {
}
return RQ_NOTIFICATION_CONTINUE;
}
IHttpEventProvider * prov) {
int rv;
am_request_t d;
/* agent module is not enabled for this
**/
return RQ_NOTIFICATION_CONTINUE;
}
/* WriteEventLog("%s GetConfig config is not enabled for site %d", thisfunc, site->GetSiteId()); */
return RQ_NOTIFICATION_CONTINUE;
}
/* register and update instance logger configuration (for already registered
* instances - update logging level only)
*/
} else {
return RQ_NOTIFICATION_FINISH_REQUEST;
}
return RQ_NOTIFICATION_FINISH_REQUEST;
}
/* set up request processor data structure */
memset(&d, 0, sizeof (am_request_t));
d.conf->client_ip_header);
}
unsigned long s = sizeof (ip);
if (b != NULL) *b = 0;
}
} else {
char *b;
if (ip[0] == '[') {
}
if (b != NULL) *b = 0;
}
}
}
}
}
d.am_set_user_f = set_user;
am_process_request(&d);
/* json handler for the rest of the unsuccessful exit statuses not processed by set_custom_response */
}
AM_LOG_DEBUG(site->GetSiteId(), "%s exit status: %s (%d)", thisfunc, am_strerror(d.status), d.status);
am_config_free(&d.conf);
am_request_free(&d);
return status;
}
if (currentUser == NULL) {
AM_LOG_ERROR(site->GetSiteId(), "OpenAMHttpModule(): failed (invalid Windows/AD user credentials). "
return RQ_NOTIFICATION_FINISH_REQUEST;
} else {
}
}
}
return RQ_NOTIFICATION_CONTINUE;
}
}
}
return RQ_NOTIFICATION_CONTINUE;
}
}
if (count > 0) {
if (formattedString != NULL) {
}
}
}
}
char *userName;
};
}
}
}
m->userPasswordCrypted = utf8_decode(r, rq->user_password, (size_t *) & m->userPasswordCryptedSize);
}
return AM_SUCCESS;
}
if (r == NULL) {
return AM_EINVAL;
}
switch (status) {
case AM_JSON_RESPONSE:
{
int payload_sz = 0;
case AM_PDP_DONE:
{
break;
}
case AM_REDIRECT:
case AM_INTERNAL_REDIRECT:
break;
default:
{
break;
}
}
break;
}
case AM_INTERNAL_REDIRECT:
case AM_REDIRECT:
{
break;
}
break;
}
case AM_PDP_DONE:
{
/* special handler for x-www-form-urlencoded POST data */
int form_sz;
break;
}
if (a == NULL) {
break;
}
if (eq) {
*eq++ = 0;
"%s<input type=\"hidden\" name=\"%s\" value=\"%s\"/>",
} else {
"%s<input type=\"hidden\" name=\"%s\" value=\"\"/>",
}
}
}
break;
}
break;
}
/* all other content types are replied in a sub-request */
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
default:
{
}
} else {
}
break;
}
}
return AM_SUCCESS;
}
public :
}
}
}
}
}
return S_OK;
}
}
};
do {
break;
}
break;
}
break;
}
break;
}
} while (FALSE);
}
return status;
}