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 ma...@apache.org on 2007/05/25 13:39:00 UTC
svn commit: r541620 - in /webservices/axis2/scratch/c/neethi/rampart:
include/rampart_constants.h samples/client/sec_echo/policy.xml
samples/server/sec_echo/echo.c src/util/rampart_engine.c
src/util/rampart_sec_header_processor.c
Author: manjula
Date: Fri May 25 04:38:58 2007
New Revision: 541620
URL: http://svn.apache.org/viewvc?view=rev&rev=541620
Log:
Storing the policy in axis2_ctx.
Modified:
webservices/axis2/scratch/c/neethi/rampart/include/rampart_constants.h
webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/policy.xml
webservices/axis2/scratch/c/neethi/rampart/samples/server/sec_echo/echo.c
webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_engine.c
webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_sec_header_processor.c
Modified: webservices/axis2/scratch/c/neethi/rampart/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/rampart/include/rampart_constants.h?view=diff&rev=541620&r1=541619&r2=541620
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/include/rampart_constants.h (original)
+++ webservices/axis2/scratch/c/neethi/rampart/include/rampart_constants.h Fri May 25 04:38:58 2007
@@ -64,6 +64,8 @@
#define INFLOW_RAMPART_CONTEXT "InflowRampartContext"
#define OUTFLOW_RAMPART_CONTEXT "OutflowRampartContext"
+#define RAMPART_CONTEXT "RampartContext"
+
#define IN_MESSAGE_SECURITY "InMessageSecurity"
#define OUT_MESSAGE_SECURITY "OutMessageSEcurity"
#define RAMPART_PASSWORD_TEXT "plainText"
Modified: webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/policy.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/policy.xml?view=diff&rev=541620&r1=541619&r2=541620
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/policy.xml (original)
+++ webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/policy.xml Fri May 25 04:38:58 2007
@@ -59,10 +59,10 @@
<rampc:TimeToLive>360</rampc:TimeToLive>
<rampc:EncryptionUser>b</rampc:EncryptionUser>
<rampc:PasswordType>Digest</rampc:PasswordType>
- <rampc:PasswordCallbackClass>/home/manjula/neethi/neethi_backup/axis2c/deploy/bin/samples/rampart/callback/libpwcb.so</rampc:PasswordCallbackClass>
- <rampc:ReceiverCertificate>/home/manjula/neethi/neethi_backup/rampart/samples/keys/ahome/bob_cert.cert</rampc:ReceiverCertificate>
- <rampc:Certificate>/home/manjula/neethi/neethi_backup/rampart/samples/keys/ahome/alice_cert.cert</rampc:Certificate>
- <rampc:PrivateKey>/home/manjula/neethi/neethi_backup/rampart/samples/keys/ahome/alice_key.pem</rampc:PrivateKey>
+ <rampc:PasswordCallbackClass>/home/manjula/neethi/neethi/axis2c/deploy/bin/samples/rampart/callback/libpwcb.so</rampc:PasswordCallbackClass>
+ <rampc:ReceiverCertificate>/home/manjula/neethi/neethi/rampart/samples/keys/ahome/bob_cert.cert</rampc:ReceiverCertificate>
+ <rampc:Certificate>/home/manjula/neethi/neethi/rampart/samples/keys/ahome/alice_cert.cert</rampc:Certificate>
+ <rampc:PrivateKey>/home/manjula/neethi/neethi/rampart/samples/keys/ahome/alice_key.pem</rampc:PrivateKey>
</rampc:RampartConfig>
</wsp:All>
</wsp:ExactlyOne>
Modified: webservices/axis2/scratch/c/neethi/rampart/samples/server/sec_echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/rampart/samples/server/sec_echo/echo.c?view=diff&rev=541620&r1=541619&r2=541620
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/samples/server/sec_echo/echo.c (original)
+++ webservices/axis2/scratch/c/neethi/rampart/samples/server/sec_echo/echo.c Fri May 25 04:38:58 2007
@@ -49,7 +49,7 @@
echo_om_ele = axiom_element_create(env, NULL, "RecievedNode", ns1, &echo_om_node);
- /*text_om_ele = axiom_element_create(env, echo_om_node, "LocalName", NULL, &text_om_node);*/
+ text_om_ele = axiom_element_create(env, echo_om_node, "LocalName", NULL, &text_om_node);
axiom_element_set_text(echo_om_ele, env, text, echo_om_node);
Modified: webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_engine.c?view=diff&rev=541620&r1=541619&r2=541620
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_engine.c (original)
+++ webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_engine.c Fri May 25 04:38:58 2007
@@ -57,30 +57,34 @@
axis2_status_t status = AXIS2_SUCCESS;
axis2_op_t *op = NULL;
axis2_msg_t *msg = NULL;
- /*axis2_conf_t *conf = NULL;
- struct axis2_conf_ctx *conf_ctx = NULL;
- */
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_ctx_t *ctx = NULL;
+ axutil_property_t *property = NULL;
- /*
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx,env);
if(!conf_ctx)
{
- AXIS2_LOG_INFO(env->log, "[rampart][rhu] Conf context is NULL ");
+ AXIS2_LOG_INFO(env->log, "[rampart][engine] Conf context is NULL ");
return NULL;
}
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
- if(!conf)
+ ctx = axis2_conf_ctx_get_base(conf_ctx,env);
+ if(!ctx)
{
- AXIS2_LOG_INFO(env->log, "[rampart][rhu] Cannot get the axis2 conf from conf context. ");
+ AXIS2_LOG_INFO(env->log, "[rampart][engine] axis2 context is NULL ");
return NULL;
}
- */
-
+
svc = axis2_msg_ctx_get_svc(msg_ctx,env);
if(!svc)
{
- AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] Service is NULL.");
- return NULL;
+ property = axis2_ctx_get_property(ctx, env, RAMPART_CONTEXT);
+ if(property)
+ return (rampart_context_t *)axutil_property_get_value(property,env);
+ else
+ {
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_neethi] Service is NULL.");
+ return NULL;
+ }
}
op = axis2_msg_ctx_get_op(msg_ctx, env);
@@ -165,6 +169,12 @@
authn_provider = rampart_load_auth_module(env,authn_provider_name);
if(authn_provider)
rampart_context_set_authn_provider(rampart_context,env,authn_provider);
+ }
+ if(!axis2_msg_ctx_get_server_side(msg_ctx, env))
+ {
+ property = axutil_property_create_with_args(env, AXIS2_SCOPE_APPLICATION,
+ AXIS2_FALSE, (void *)rampart_context_free, rampart_context);
+ axis2_ctx_set_property(ctx, env, RAMPART_CONTEXT, property);
}
return rampart_context;
Modified: webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_sec_header_processor.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_sec_header_processor.c?view=diff&rev=541620&r1=541619&r2=541620
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_sec_header_processor.c (original)
+++ webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_sec_header_processor.c Fri May 25 04:38:58 2007
@@ -954,7 +954,7 @@
/*Is replayed*/
rd_fn = rampart_context_get_replay_detect_function(rampart_context, env);
if(rd_fn){
- status = (*rd_fn)(env, msg_ctx);
+ status = (*rd_fn)(env, msg_ctx, rampart_context);
if(status != AXIS2_SUCCESS){
/*Scream .. replayed*/
return AXIS2_FAILURE;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org