Author: dumindu
Date: Thu Feb 14 11:07:05 2008
New Revision: 13772
Log:
fixed module interface for validators.
Modified:
trunk/solutions/identity/modules/mod-cspace/cspace_validator.c
trunk/solutions/identity/modules/mod-cspace/mod_cspace.c
Modified: trunk/solutions/identity/modules/mod-cspace/cspace_validator.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/cspace_validator.c
(original)
+++ trunk/solutions/identity/modules/mod-cspace/cspace_validator.c Thu Feb
14 11:07:05 2008
@@ -32,6 +32,10 @@
const char *ppid, const char *cert,
const void *user_data);
+static val_type valstr2type(const char *validator);
+
+static X509 *x509_create_with_buffer(unsigned char *input, int length);
+
static X509 *x509_create_with_buffer(unsigned char *input, int length)
{
BIO *b64, *bmem;
@@ -60,20 +64,10 @@
const char *w_list)
{
FILE *fp = NULL;
- SSL_CTX *ctx = NULL;
X509 *needle = NULL;
X509 *(haystack[MAXARR]); /* TODO: this list should be made static */
int i = 0, j = 0;
- /*if((fp = fopen (cert, "r"))) {
- if(!(needle = d2i_X509_fp(fp, NULL))) {
- fseek(fp, 0, SEEK_SET);
- needle = PEM_read_X509( fp, NULL, NULL, NULL );
- }
- } else {
- return FAIL;
- }*/
-
needle = x509_create_with_buffer((void *)cert, strlen(cert));
/*ideally we would do this file read only once per server init*/
@@ -158,6 +152,7 @@
const char *ppid, const char *cert,
const void *user_data)
{
+
return SUCC;
}
Modified: trunk/solutions/identity/modules/mod-cspace/mod_cspace.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/mod_cspace.c (original)
+++ trunk/solutions/identity/modules/mod-cspace/mod_cspace.c Thu Feb 14
11:07:05 2008
@@ -621,15 +621,17 @@
CARDSPACE_HEADER_CERTIFICATE);
if (!svr_cfg->validator) {
- /* if the validator is not present assume cert by
default*/
+ /* if the validator is not present assume cert by
default*/
svr_cfg->validator = "cert";
}
- allowed_flag = validate_with_op_mode(svr_cfg->validator,
- r->uri,
- "TODO:ISSUER",
- ppid,
- cert, NULL);
+ allowed_flag =
+ validate_with_op_mode(svr_cfg->validator,
+ r->uri,
+ "TODO:ISSUER",
+ ppid,
+ cert,
+ svr_cfg->validator_data);
if (allowed_flag) {
return OK;
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev