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 mi...@apache.org on 2008/01/24 04:21:16 UTC

svn commit: r614783 - in /webservices/rampart/scratch/c/trust/c: include/trust_util.h samples/client/sts_client/client.c samples/server/saml_sts/saml_skeleton.c src/trust/sts_client.c src/trust/util.c

Author: milinda
Date: Wed Jan 23 19:20:54 2008
New Revision: 614783

URL: http://svn.apache.org/viewvc?rev=614783&view=rev
Log:
Fixed some typos.

Modified:
    webservices/rampart/scratch/c/trust/c/include/trust_util.h
    webservices/rampart/scratch/c/trust/c/samples/client/sts_client/client.c
    webservices/rampart/scratch/c/trust/c/samples/server/saml_sts/saml_skeleton.c
    webservices/rampart/scratch/c/trust/c/src/trust/sts_client.c
    webservices/rampart/scratch/c/trust/c/src/trust/util.c

Modified: webservices/rampart/scratch/c/trust/c/include/trust_util.h
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/c/include/trust_util.h?rev=614783&r1=614782&r2=614783&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/c/include/trust_util.h (original)
+++ webservices/rampart/scratch/c/trust/c/include/trust_util.h Wed Jan 23 19:20:54 2008
@@ -193,7 +193,8 @@
     trust_util_create_requsted_proof_token_element(
         const axutil_env_t * env,
         axis2_char_t *wst_ns_uri,
-        axiom_node_t * parent_node);
+        axiom_node_t * parent_node,
+        axiom_node_t *req_proof_token);
 
     /**
      * Create the Entropy Element for Issuance binding. User must set the content.

Modified: webservices/rampart/scratch/c/trust/c/samples/client/sts_client/client.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/c/samples/client/sts_client/client.c?rev=614783&r1=614782&r2=614783&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/c/samples/client/sts_client/client.c (original)
+++ webservices/rampart/scratch/c/trust/c/samples/client/sts_client/client.c Wed Jan 23 19:20:54 2008
@@ -32,7 +32,7 @@
 
     /* Set end point reference of echo service */
     address = "http://localhost:8080/axis2/services/saml_sts";
-    client_home = "/home/milinda/Projects/axis2c/deploy";
+    client_home = "/home/milinda/Projects/axis2c/deploy/client_repo";
     
     file_name = "./client.xml";
     file_name2 = "./service.xml";

Modified: webservices/rampart/scratch/c/trust/c/samples/server/saml_sts/saml_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/c/samples/server/saml_sts/saml_skeleton.c?rev=614783&r1=614782&r2=614783&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/c/samples/server/saml_sts/saml_skeleton.c (original)
+++ webservices/rampart/scratch/c/trust/c/samples/server/saml_sts/saml_skeleton.c Wed Jan 23 19:20:54 2008
@@ -41,10 +41,16 @@
     axis2_svc_skeleton_t *svc_skeleton,
     const axutil_env_t *env);
 
+axiom_node_t * AXIS2_CALL
+saml_issuer_on_fault(
+        axis2_svc_skeleton_t *svc_skel,
+        const axutil_env_t *env,
+        axiom_node_t *node);
+
 static const axis2_svc_skeleton_ops_t saml_issuer_svc_skeleton_ops_var = {
     saml_issuer_init,
     saml_issuer_invoke,
-    NULL,
+    saml_issuer_on_fault,
     saml_issuer_free
 };
 
@@ -110,9 +116,16 @@
 		
 
     
-    return axis2_saml_issuer_issue(env, trust_ctx);
-    
-   
+    return axis2_saml_issuer_issue(env, trust_ctx);  
+}
+
+axiom_node_t * AXIS2_CALL
+saml_issuer_on_fault(
+        axis2_svc_skeleton_t *svc_skel,
+        const axutil_env_t *env,
+        axiom_node_t *node)
+{
+    return NULL;
 }
 
 AXIS2_EXPORT int

Modified: webservices/rampart/scratch/c/trust/c/src/trust/sts_client.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/c/src/trust/sts_client.c?rev=614783&r1=614782&r2=614783&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/c/src/trust/sts_client.c (original)
+++ webservices/rampart/scratch/c/trust/c/src/trust/sts_client.c Wed Jan 23 19:20:54 2008
@@ -51,6 +51,7 @@
 
     sts_client = (trust_sts_client_t *) AXIS2_MALLOC(env->allocator, sizeof(trust_sts_client_t));
 
+    sts_client->algo_suite = NULL;
     sts_client->trust10 = NULL;
     sts_client->home_dir = NULL;
     sts_client->issuer_address = NULL;
@@ -87,13 +88,16 @@
     axiom_node_t *rst_node = NULL;
     axiom_node_t *return_node = NULL;
     
-	/*Action Logic*/
-	trust_rst_t *rst = NULL;
-	axis2_char_t *request_type = NULL;
+    /*Action Logic*/
+    trust_rst_t *rst = NULL;
+    axis2_char_t *request_type = NULL;
+    
+    if(sts_client->issuer_policy_location && sts_client->service_policy_location)
+    {
+        issuer_policy = neethi_util_create_policy_from_file(env, sts_client->issuer_policy_location);
+        service_policy = neethi_util_create_policy_from_file(env, sts_client->service_policy_location);
+    }
     
-    issuer_policy = neethi_util_create_policy_from_file(env, sts_client->issuer_policy_location);
-    service_policy = neethi_util_create_policy_from_file(env, sts_client->service_policy_location);
-
     if (!issuer_policy || !service_policy)
     {
         status = AXIS2_FAILURE;
@@ -104,24 +108,24 @@
     }
 
  
-	/*Action Logic - RequestType - used for specify the requesting action*/
-	rst = trust_context_get_rst(env, trust_context);
-	if(NULL == rst)
-	{
-		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RST is NULL: Created RST_CTX may not set to TrustContest");
-		return;
-	}
-	
-	request_type = trust_rst_get_request_type(rst, env);
-	
-	if(NULL == request_type)
-	{
-		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RST-RequestType is NOT set. RST MUST have a RequestType");
-		return;
-	}
-	
-	svc_client =
-        trust_sts_client_get_svc_client(sts_client, env, request_type);
+    /*Action Logic - RequestType - used for specify the requesting action*/
+    rst = trust_context_get_rst(env, trust_context);
+    if(NULL == rst)
+    {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RST is NULL: Created RST_CTX may not set to TrustContest");
+            return;
+    }
+
+    request_type = trust_rst_get_request_type(rst, env);
+
+    if(NULL == request_type)
+    {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RST-RequestType is NOT set. RST MUST have a RequestType");
+            return;
+    }
+
+    svc_client =
+    trust_sts_client_get_svc_client(sts_client, env, request_type);
 														  
 
     if (status == AXIS2_SUCCESS)
@@ -133,15 +137,17 @@
         }
 		/*Building the RST */
         rst_node = trust_context_build_rst_node(env, trust_context);
-		if(rst_node)
-		{
-	        return_node = axis2_svc_client_send_receive(svc_client, env, rst_node);
-		}
-		else
-		{
-			AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RST-Not send -> RST Node building failed");
-			return;
-		}
+        if(rst_node)
+        {
+            return_node = axis2_svc_client_send_receive(svc_client, env, rst_node);
+            if(!return_node)
+                printf("return node null!");
+        }
+        else
+        {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RST-Not send -> RST Node building failed");
+            return;
+        }
     }
     if (svc_client)
     {

Modified: webservices/rampart/scratch/c/trust/c/src/trust/util.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/c/src/trust/util.c?rev=614783&r1=614782&r2=614783&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/c/src/trust/util.c (original)
+++ webservices/rampart/scratch/c/trust/c/src/trust/util.c Wed Jan 23 19:20:54 2008
@@ -317,16 +317,17 @@
         axiom_element_create(env, parent_node, TRUST_REQUESTED_SECURITY_TOKEN, wst_ns,
                              &requested_token_node);
     
-    if(sec_token_node)
-    {      
-        axiom_node_add_child(requested_token_node, env, sec_token_node);
-    }
     if (!requested_token_ele)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[trust] RequestedSecurityToken Element creation failed!");
         return NULL;
     }
+    
+    if(sec_token_node)
+    {      
+        axiom_node_add_child(requested_token_node, env, sec_token_node);
+    }
 
     return requested_token_node;
 }
@@ -335,7 +336,8 @@
 trust_util_create_requsted_proof_token_element(
     const axutil_env_t * env,
     axis2_char_t *wst_ns_uri,
-    axiom_node_t * parent_node)
+    axiom_node_t * parent_node,
+    axiom_node_t *req_proof_token)
 {
     axiom_namespace_t *wst_ns = NULL;
     axiom_node_t *requested_prooft_node = NULL;
@@ -351,6 +353,14 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[trust] RequestedProofToken Element creation failed!");
         return NULL;
+    }
+    if(req_proof_token)
+    {
+        if(AXIS2_FAILURE == axiom_node_add_child(requested_prooft_node, env, req_proof_token))
+        {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[trust] RequestedProofToken child setting failed!");
+            return NULL;
+        }
     }
 
     return requested_prooft_node;