You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by ka...@apache.org on 2007/09/13 13:38:54 UTC
svn commit: r575270 - in /webservices/rampart/trunk/c:
samples/secpolicy/scenario2/services.xml
src/util/rampart_sec_header_builder.c
src/util/rampart_sec_header_processor.c src/util/rampart_token_builder.c
src/util/rampart_username_token.c
Author: kaushalye
Date: Thu Sep 13 04:38:53 2007
New Revision: 575270
URL: http://svn.apache.org/viewvc?rev=575270&view=rev
Log:
More specific SOAP faults on failures
Username token sample scenario to use the authentication module in the server side
Modified:
webservices/rampart/trunk/c/samples/secpolicy/scenario2/services.xml
webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
webservices/rampart/trunk/c/src/util/rampart_token_builder.c
webservices/rampart/trunk/c/src/util/rampart_username_token.c
Modified: webservices/rampart/trunk/c/samples/secpolicy/scenario2/services.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/scenario2/services.xml?rev=575270&r1=575269&r2=575270&view=diff
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/scenario2/services.xml (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/scenario2/services.xml Thu Sep 13 04:38:53 2007
@@ -48,7 +48,8 @@
<rampc:RampartConfig xmlns:rampc="http://ws.apache.org/rampart/c/policy">
<rampc:User>Bob</rampc:User>
<rampc:PasswordType>Digest</rampc:PasswordType>
- <rampc:PasswordCallbackClass>AXIS2C_HOME/bin/samples/rampart/callback/libpwcb.so</rampc:PasswordCallbackClass>
+ <rampc:AuthnModuleName>/home/kau/axis2/c/deploy/bin/samples/rampart/authn_provider/libauthn.so</rampc:AuthnModuleName>
+ <!--rampc:PasswordCallbackClass>AXIS2C_HOME/bin/samples/rampart/callback/libpwcb.so</rampc:PasswordCallbackClass-->
</rampc:RampartConfig>
</wsp:All>
</wsp:ExactlyOne>
Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c?rev=575270&r1=575269&r2=575270&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c Thu Sep 13 04:38:53 2007
@@ -106,6 +106,7 @@
if((rampart_context_get_binding_type(rampart_context,env)) == RP_PROPERTY_ASYMMETRIC_BINDING)
{
/*Do Asymmetric Binding specific things*/
+ AXIS2_LOG_INFO(env->log, "[rampart][shb] Using asymmetric binding");
/*Timestamp Inclusion*/
if(rampart_context_is_include_timestamp(rampart_context,env))
@@ -159,10 +160,10 @@
{
is_encrypt_before_sign = AXIS2_TRUE;
+ /*If signature_protection=> <sp:EncryptSignature/> is ON*/
if(signature_protection)
{
/*First Encrypt the parts specified in encrypted parts*/
-
status = rampart_enc_encrypt_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
if(status != AXIS2_SUCCESS)
{
@@ -299,6 +300,7 @@
}
else if((rampart_context_get_binding_type(rampart_context,env)) == RP_PROPERTY_TRANSPORT_BINDING)
{
+ AXIS2_LOG_INFO(env->log, "[rampart][shb] Using transport binding");
/*Timestamp Inclusion*/
if(rampart_context_is_include_timestamp(rampart_context,env))
Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c?rev=575270&r1=575269&r2=575270&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c Thu Sep 13 04:38:53 2007
@@ -335,7 +335,7 @@
if(!enc_asym_algo_in_pol)
{
rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
- "Error in the policy.", RAMPART_FAULT_IN_POLICY, msg_ctx);
+ "Error in the policy. No asym algo", RAMPART_FAULT_IN_POLICY, msg_ctx);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"[rampart][shp] Assymetric enc algorithm not specified in policy.");
return AXIS2_FAILURE;
@@ -370,7 +370,7 @@
if(!prv_key_file)
{
rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
- "Error in the policy.", RAMPART_FAULT_IN_POLICY, msg_ctx);
+ "Error in the policy. No private key", RAMPART_FAULT_IN_POLICY, msg_ctx);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"[rampart][shp] Private Key is not specified.");
return AXIS2_FAILURE;
@@ -407,7 +407,7 @@
if(!password_callback)
{
rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
- "Error in the policy.", RAMPART_FAULT_IN_POLICY, msg_ctx);
+ "Error in the policy. No password callback", RAMPART_FAULT_IN_POLICY, msg_ctx);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"[rampart][shp] Password call back module is not specified.");
@@ -450,7 +450,7 @@
if(!enc_sym_algo_in_pol)
{
rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
- "Error in the policy.", RAMPART_FAULT_IN_POLICY, msg_ctx);
+ "Error in the policy. No summetric algo", RAMPART_FAULT_IN_POLICY, msg_ctx);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"[rampart][shp] Symetric enc algorithm not specified in policy.");
return AXIS2_FAILURE;
@@ -711,7 +711,7 @@
if(!sig_mtd_pol || !digest_mtd_pol)
{
rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
- "Error in the policy.", RAMPART_FAULT_IN_POLICY, msg_ctx);
+ "Error in the policy. No signature algo", RAMPART_FAULT_IN_POLICY, msg_ctx);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"[rampart][shp] Error in policy, Specifying signature algorithms.");
return AXIS2_FAILURE;
Modified: webservices/rampart/trunk/c/src/util/rampart_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_token_builder.c?rev=575270&r1=575269&r2=575270&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_token_builder.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_token_builder.c Thu Sep 13 04:38:53 2007
@@ -75,6 +75,7 @@
/*Get data from the certificate*/
data = oxs_x509_cert_get_data(cert, env);
if(!data){
+ oxs_error(env, ERROR_LOCATION, OXS_ERROR_ELEMENT_FAILED, "Cannot get data from the x509 certificate");
return AXIS2_FAILURE;
}
embedded_node = oxs_token_build_embedded_element(env, parent, "ID");
@@ -93,6 +94,7 @@
ki = oxs_x509_cert_get_key_identifier(cert, env);
if(!ki){
+ oxs_error(env, ERROR_LOCATION, OXS_ERROR_ELEMENT_FAILED, "Cannot get key identifier from the x509 certificate");
return AXIS2_FAILURE;
}
ki_node = oxs_token_build_key_identifier_element(env, parent, OXS_ENCODING_BASE64BINARY,
Modified: webservices/rampart/trunk/c/src/util/rampart_username_token.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_username_token.c?rev=575270&r1=575269&r2=575270&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_username_token.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_username_token.c Thu Sep 13 04:38:53 2007
@@ -523,6 +523,10 @@
"[rampart][rampart_usernametoken] Password authentication using CALLBACK MODULE ");
password_from_svr = rampart_callback_password(env, password_callback, username);
}
+ }else{
+
+ AXIS2_LOG_INFO(env->log,
+ "[rampart][rampart_usernametoken] Using the password is in the context");
}
if (!password_from_svr)