You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2006/06/14 08:37:08 UTC
svn commit: r414113 - in /webservices/axis2/trunk/c/rampart:
include/rampart/ src/core/ src/handlers/ src/util/
Author: nandika
Date: Tue Jun 13 23:37:07 2006
New Revision: 414113
URL: http://svn.apache.org/viewvc?rev=414113&view=rev
Log:
fixed compilation problems on win32
Modified:
webservices/axis2/trunk/c/rampart/include/rampart/rampart_util.h
webservices/axis2/trunk/c/rampart/src/core/user_sec_param.c
webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c
webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c
webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
webservices/axis2/trunk/c/rampart/src/util/username_token.c
Modified: webservices/axis2/trunk/c/rampart/include/rampart/rampart_util.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart/rampart_util.h?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart/rampart_util.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart/rampart_util.h Tue Jun 13 23:37:07 2006
@@ -56,7 +56,7 @@
rampart_format_date_zulu_to_mili(const axis2_env_t *env, axis2_char_t *str);
-AXIS2_EXTERN axis2_status_t* AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
rampart_print_info(const axis2_env_t *env, axis2_char_t* info);
/* @} */
Modified: webservices/axis2/trunk/c/rampart/src/core/user_sec_param.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/core/user_sec_param.c?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/core/user_sec_param.c (original)
+++ webservices/axis2/trunk/c/rampart/src/core/user_sec_param.c Tue Jun 13 23:37:07 2006
@@ -16,6 +16,7 @@
#include <rampart/user_sec_param.h>
#include <axis2_env.h>
+#include <axis2_string.h>
#include <axis2_utils.h>
/********************************** Function prototypes *****************/
Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c Tue Jun 13 23:37:07 2006
@@ -27,6 +27,8 @@
#include <rampart/rampart_constants.h>
#include <rampart/username_token.h>
#include <rampart/rampart_handler_util.h>
+#include <rampart/timestamp_token.h>
+#include <rampart/rampart_util.h>
/*************************** Function headers *********************************/
@@ -83,6 +85,7 @@
soap_header = AXIOM_SOAP_ENVELOPE_GET_HEADER(soap_envelope, env);
if (soap_header)
{
+ axis2_char_t* item = NULL;
rampart_print_info(env,"soap header found");
/*Check InFlowSecurity parameters*/
@@ -131,14 +134,15 @@
return AXIS2_FAILURE;
}
- axis2_char_t* item = NULL;
+
item = strtok (items," ");
while (item != NULL)
{
if( 0 == AXIS2_STRCMP(RAMPART_ACTION_ITEMS_USERNAMETOKEN, AXIS2_STRTRIM(env, item, NULL)) )
{
+ axis2_status_t valid_user = AXIS2_FAILURE;
rampart_print_info(env,"Validate usernametoken ");
- axis2_status_t valid_user = rampart_validate_username_token(env, msg_ctx,soap_header, param_action);
+ valid_user = rampart_validate_username_token(env, msg_ctx,soap_header, param_action);
if(valid_user)
{
rampart_print_info(env,"I know this user ");
@@ -149,11 +153,13 @@
}
}else if (0 == AXIS2_STRCMP(RAMPART_ACTION_ITEMS_TIMESTAMP, AXIS2_STRTRIM(env, item, NULL))){
+ axis2_qname_t *qname = NULL;
+ axis2_status_t valid_ts = AXIS2_FAILURE;
rampart_print_info(env,"Validate timestamp ");
sec_node = rampart_get_security_token(env, msg_ctx, soap_header);
sec_ele = AXIOM_NODE_GET_DATA_ELEMENT(sec_node, env);
- axis2_qname_t *qname = NULL;
+
qname = axis2_qname_create(env,
RAMPART_SECURITY_TIMESTAMP,
RAMPART_WSU_XMLNS,
@@ -167,7 +173,7 @@
return AXIS2_FAILURE;
}
}
- axis2_status_t valid_ts = rampart_validate_timestamp(env, ts_node);
+ valid_ts = rampart_validate_timestamp(env, ts_node);
if(valid_ts)
{
rampart_print_info(env,"Timestamp is valid ");
Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c Tue Jun 13 23:37:07 2006
@@ -18,14 +18,14 @@
#include <axis2_handler_desc.h>
#include <axis2_qname.h>
#include <axis2_svc.h>
-#include <axiom_soap_header.h>
-#include <axiom_soap_body.h>
-#include <axiom_soap_header_block.h>
+#include <axiom_soap.h>
+#include <rampart/rampart_util.h>
#include <axis2_endpoint_ref.h>
#include <axis2_property.h>
#include <rampart/rampart_constants.h>
#include <rampart/username_token.h>
#include <rampart/rampart_handler_util.h>
+#include <rampart/timestamp_token.h>
/*********************** Function headers *********************************/
@@ -126,11 +126,12 @@
/*if the soap header is available then add the security header*/
if (soap_header)
{
+ axiom_soap_header_block_t *sec_header_block = NULL;
+ axiom_namespace_t *sec_ns_obj = NULL;
soap_header_node=AXIOM_SOAP_HEADER_GET_BASE_NODE(soap_header, env);
soap_header_ele = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT (soap_header_node, env);
- axiom_soap_header_block_t *sec_header_block = NULL;
- axiom_namespace_t *sec_ns_obj = NULL;
+
ctx = AXIS2_MSG_CTX_GET_BASE (msg_ctx, env);
param_out_flow_security = rampart_get_security_param( env,msg_ctx, RAMPART_OUTFLOW_SECURITY);
Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c Tue Jun 13 23:37:07 2006
@@ -30,7 +30,7 @@
AXIS2_EXTERN axis2_param_t* AXIS2_CALL
rampart_get_security_param( const axis2_env_t *env,
- const axis2_msg_ctx_t *msg_ctx,
+ axis2_msg_ctx_t *msg_ctx,
const axis2_char_t *parameter);
AXIS2_EXTERN axis2_array_list_t* AXIS2_CALL
@@ -59,7 +59,7 @@
axis2_param_t* AXIS2_CALL
rampart_get_security_param( const axis2_env_t *env,
- const axis2_msg_ctx_t *msg_ctx,
+ axis2_msg_ctx_t *msg_ctx,
const axis2_char_t *parameter)
{
@@ -90,6 +90,7 @@
const axis2_param_t *param_x_flow_security)
{
axis2_array_list_t *action_list = NULL;
+ int param_type;
if(!param_x_flow_security)
{
AXIS2_LOG_INFO(env->log,"param_in_flow_security is NULL");
@@ -97,7 +98,7 @@
}
/*ERROR HERE param returns TEXT even for DOM*/
- int param_type = AXIS2_PARAM_GET_PARAM_TYPE(param_x_flow_security, env);
+ param_type = AXIS2_PARAM_GET_PARAM_TYPE(param_x_flow_security, env);
action_list = AXIS2_PARAM_GET_VALUE_LIST(param_x_flow_security, env);
if(!action_list)
@@ -114,18 +115,19 @@
const axis2_param_t *param_action,
const axis2_char_t *key)
{
- axis2_char_t *value, *tmp_key = NULL;
+ axis2_char_t *value= NULL, *tmp_key = NULL;
axis2_array_list_t *param_list = NULL;
axis2_param_t *param = NULL;
-
+ int param_type;
+ axis2_char_t * param_name = NULL;
int i, size = 0;
if(!param_action)
{
printf("param_action is NULL");
}
- int param_type = AXIS2_PARAM_GET_PARAM_TYPE(param_action, env);
- axis2_char_t * param_name = AXIS2_PARAM_GET_NAME(param_action, env);
+ param_type = AXIS2_PARAM_GET_PARAM_TYPE(param_action, env);
+ param_name = AXIS2_PARAM_GET_NAME(param_action, env);
printf(" parameter Type =%d Name = %s", param_type, param_name);
param_list = AXIS2_PARAM_GET_VALUE_LIST(param_action, env);
Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_util.c?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_util.c Tue Jun 13 23:37:07 2006
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <rampart/rampart_util.h>
#include <axis2_util.h>
+#include <axis2_base64.h>
#include <time.h>
/*Calculate the hash of concatenated string of
@@ -34,12 +35,13 @@
{
int num;
char* rand_str = NULL;
+ axis2_char_t* encoded_str=NULL;
num=rand();
rand_str= AXIS2_MALLOC(env->allocator,16);
sprintf(rand_str, "%16d", num);
- axis2_char_t* encoded_str=NULL;
- encoded_str = AXIS2_MALLOC(env->allocator, axis2_base64_encode_len(SIZE_NONCE));
+
+ encoded_str = AXIS2_MALLOC(env->allocator, sizeof(SIZE_NONCE));
axis2_base64_encode(encoded_str,rand_str,AXIS2_STRLEN(rand_str));
AXIS2_FREE(env->allocator, rand_str);
return encoded_str;
@@ -71,8 +73,9 @@
return 1000000;/*TODO*/
}
-AXIS2_EXTERN axis2_status_t* AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
rampart_print_info(const axis2_env_t *env, axis2_char_t* info)
{
/*printf("[rampart]: %s\n", info);*/
+ return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/rampart/src/util/username_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/username_token.c?rev=414113&r1=414112&r2=414113&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/username_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/username_token.c Tue Jun 13 23:37:07 2006
@@ -253,7 +253,7 @@
axis2_char_t *username, *password, *nonce, *created, *password_type = NULL;
axis2_char_t *pw_callback_module, *password_from_svr , *password_to_compare = NULL;
axis2_ctx_t *ctx = NULL;
-
+ axis2_qname_t *qname = NULL;
sec_node = rampart_get_security_token(env, msg_ctx, soap_header);
if(!sec_node)
{
@@ -269,7 +269,7 @@
}
/*TODO Get sec_ele with QNAME*/
- axis2_qname_t *qname = NULL;
+
qname = axis2_qname_create(env,
RAMPART_SECURITY_USERNAMETOKEN,
RAMPART_WSSE_XMLNS,
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org