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 2007/10/12 13:34:34 UTC

svn commit: r584137 - in /webservices/rampart/scratch/c/trust: ./ include/ src/ src/canceler/ src/issuer/ src/renewer/ src/validator/

Author: milinda
Date: Fri Oct 12 04:34:32 2007
New Revision: 584137

URL: http://svn.apache.org/viewvc?rev=584137&view=rev
Log:
Compilation scirpt for test purposes, changes to Security Token Service Implementation, and chages to trust data processing code added with prototypes of custom issuer, renewer, validator and canceler.

Added:
    webservices/rampart/scratch/c/trust/compile_impls.sh   (with props)
    webservices/rampart/scratch/c/trust/compile_sts.sh   (with props)
    webservices/rampart/scratch/c/trust/src/canceler/
    webservices/rampart/scratch/c/trust/src/canceler/canceler.c   (with props)
    webservices/rampart/scratch/c/trust/src/issuer/
    webservices/rampart/scratch/c/trust/src/issuer/issuer.c   (with props)
    webservices/rampart/scratch/c/trust/src/renewer/
    webservices/rampart/scratch/c/trust/src/renewer/renewer.c   (with props)
    webservices/rampart/scratch/c/trust/src/validator/
    webservices/rampart/scratch/c/trust/src/validator/validator.c   (with props)
Modified:
    webservices/rampart/scratch/c/trust/include/trust_constants.h
    webservices/rampart/scratch/c/trust/include/trust_data.h
    webservices/rampart/scratch/c/trust/include/trust_sts.h
    webservices/rampart/scratch/c/trust/src/data.c
    webservices/rampart/scratch/c/trust/src/sts.c

Added: webservices/rampart/scratch/c/trust/compile_impls.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/compile_impls.sh?rev=584137&view=auto
==============================================================================
--- webservices/rampart/scratch/c/trust/compile_impls.sh (added)
+++ webservices/rampart/scratch/c/trust/compile_impls.sh Fri Oct 12 04:34:32 2007
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#create the service lib
+gcc -g -I$AXIS2C_HOME/include/axis2-1.1 -I./include -shared ./src/issuer/*.c -o issuer.a -fPIC -DPIC -shared -lpthread -ldl  -Wl,-soname -Wl,issuer.so -o issuer.so 
+
+gcc -g -I$AXIS2C_HOME/include/axis2-1.1 -I./include -shared ./src/validator/*.c -o validator.a -fPIC -DPIC -shared -lpthread -ldl  -Wl,-soname -Wl,validator.so -o validator.so
+
+gcc -g -I$AXIS2C_HOME/include/axis2-1.1 -I./include -shared ./src/canceler/*.c -o canceler.a -fPIC -DPIC -shared -lpthread -ldl  -Wl,-soname -Wl,canceler.so -o canceler.so
+
+gcc -g -I$AXIS2C_HOME/include/axis2-1.1 -I./include -shared ./src/renewer/*.c -o renewer.a -fPIC -DPIC -shared -lpthread -ldl  -Wl,-soname -Wl,renewer.so -o renewer.so
+
+

Propchange: webservices/rampart/scratch/c/trust/compile_impls.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/rampart/scratch/c/trust/compile_sts.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/compile_sts.sh?rev=584137&view=auto
==============================================================================
--- webservices/rampart/scratch/c/trust/compile_sts.sh (added)
+++ webservices/rampart/scratch/c/trust/compile_sts.sh Fri Oct 12 04:34:32 2007
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+#create the service lib
+gcc -g -I$AXIS2C_HOME/include/axis2-1.1 -I./include -shared ./src/*.c -o libSTS.a -fPIC -DPIC -shared -lpthread -ldl  -Wl,-soname -Wl,libSTS.so -o libSTS.so 

Propchange: webservices/rampart/scratch/c/trust/compile_sts.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: webservices/rampart/scratch/c/trust/include/trust_constants.h
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_constants.h?rev=584137&r1=584136&r2=584137&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_constants.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_constants.h Fri Oct 12 04:34:32 2007
@@ -35,7 +35,7 @@
 #define TRUST_REQUEST_TYPE		"RequestType"
 #define TRUST_APPLIES_TO		"AppliesTo"
 
-#define TRSUT_KEY_TYPE			"KeyType"
+#define TRUST_KEY_TYPE			"KeyType"
 #define TRUST_KEY_SIZE			"KeySize"
 
 #define TRUST_CLAIMS			"Claims"

Modified: webservices/rampart/scratch/c/trust/include/trust_data.h
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_data.h?rev=584137&r1=584136&r2=584137&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_data.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_data.h Fri Oct 12 04:34:32 2007
@@ -31,7 +31,7 @@
 #include <axiom_soap.h>
 #include <axiom.h>
 #include <axis2_msg_ctx.h>
-#include <axi2_addr.h>
+#include <axis2_addr.h>
 #include <trust_constants.h>
 
 
@@ -82,7 +82,7 @@
 		const axutil_env_t *env);
 
 	AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_entropy(
-		trust_data *trust_data,
+		trust_data_t *trust_data,
 		const axutil_env_t *env);
 
 

Modified: webservices/rampart/scratch/c/trust/include/trust_sts.h
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_sts.h?rev=584137&r1=584136&r2=584137&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_sts.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_sts.h Fri Oct 12 04:34:32 2007
@@ -26,9 +26,9 @@
 #include <stdio.h>
 #include <axiom_soap.h>
 #include <axutil_dll_desc.h>
-#include "trust_data.h"
-#include "trust_token.h"
-#include "trust_constants.h"
+#include <trust_data.h>
+#include <trust_token.h>
+#include <trust_constants.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -73,7 +73,7 @@
 
 		void (*trust_token_set_config_param)
 			(axis2_char_t *file_name, const axutil_env_t *env);
-	} trsut_token_validator_t;
+	} trust_token_validator_t;
 
 	typedef struct
 	{	
@@ -88,7 +88,7 @@
 		
 		void (*trust_token_set_config_param)
 			(axis2_char_t *file_name, const axutil_env_t *env);
-	} trsut_token_renewer_t;
+	} trust_token_renewer_t;
 
 	typedef struct
 	{
@@ -103,7 +103,7 @@
 
 		void (*trust_token_set_config_param)
 			(axis2_char_t *file_name, const axutil_env_t *env);
-	}trsut_token_canceler_t;
+	}trust_token_canceler_t;
 
 	/**
 	  *Load the default token issuer from a dll.

Added: webservices/rampart/scratch/c/trust/src/canceler/canceler.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/canceler/canceler.c?rev=584137&view=auto
==============================================================================
--- webservices/rampart/scratch/c/trust/src/canceler/canceler.c (added)
+++ webservices/rampart/scratch/c/trust/src/canceler/canceler.c Fri Oct 12 04:34:32 2007
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <trust_sts.h>
+#include <axutil_utils.h>
+
+AXIS2_EXPORT int axis2_get_instance(trust_token_canceler_t **inst, const axutil_env_t *env)
+{
+    *inst = (trust_token_canceler_t *)malloc(sizeof(trust_token_canceler_t));	
+    if (!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int axis2_remove_instance(trust_token_canceler_t *inst,
+        const axutil_env_t *env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    return status;
+}
+

Propchange: webservices/rampart/scratch/c/trust/src/canceler/canceler.c
------------------------------------------------------------------------------
    svn:executable = *

Modified: webservices/rampart/scratch/c/trust/src/data.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/data.c?rev=584137&r1=584136&r2=584137&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/src/data.c (original)
+++ webservices/rampart/scratch/c/trust/src/data.c Fri Oct 12 04:34:32 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <trust_data.h>
+#include "trust_data.h"
 
 struct trust_data {
 	/* in message context of STS */
@@ -132,7 +132,7 @@
 	axiom_element_t *rst_ele = NULL;
 	axiom_element_t *epr_ele = NULL;
 	axiom_element_t *addr_ele = NULL;
-	axiom_namespace_t *addr_namespace = NULL:
+	axiom_namespace_t *addr_namespace = NULL;
 
 	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -144,13 +144,13 @@
 	appliesto_ele = axiom_element_get_first_child_with_qname(rst_ele, env, applies_to_qname, rst_node, &appliesto_node);
     if(appliesto_ele)
 	{
-		epr_ele = axiom_element_get_first_element(appliesto_ele, env, appliesto_node, epr_node);
+		epr_ele = axiom_element_get_first_element(appliesto_ele, env, appliesto_node, &epr_node);
 		trust_data->applies_to_epr_node = epr_node;
 
 		if(!trust_data->addressing_namespace) 
 		{
-			addressing_namespace = axiom_element_get_default_namespace(epr_ele, env, epr_node);
-			trust_data->addressing_namespace = axiom_namespace_get_uri(addressing_namespace, env);
+			addr_namespace = axiom_element_get_default_namespace(epr_ele, env, epr_node);
+			trust_data->addressing_namespace = axiom_namespace_get_uri(addr_namespace, env);
 		}
 
 		if(epr_ele)
@@ -303,7 +303,7 @@
 }
 
 AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_entropy(
-    trust_data *trust_data,
+    trust_data_t *trust_data,
     const axutil_env_t *env)
 {
     /* TO DO: Complete the entropy processing*/
@@ -344,17 +344,17 @@
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     
-    rst_ele = (axiom_element_t *)(axiom_node_get_data_element(trust_data->rst_node, env));
+    rst_ele = (axiom_element_t *)(axiom_node_get_data_element(data->rst_node, env));
     
-    key_type_qname = axutil_qname_create(env, TRUST_KEY_TYPE, trust_data->wst_namespace, TRUST_WST);
+    key_type_qname = axutil_qname_create(env, TRUST_KEY_TYPE, data->wst_namespace, TRUST_WST);
     
     key_type_ele = axiom_element_get_first_child_with_qname(rst_ele, env, key_type_qname, 
-                                                              trust_data->rst_node, &key_type_node);
+                                                              data->rst_node, &key_type_node);
     if(!key_type_ele)
         AXIS2_FREE(env->allocator, key_type_qname);
         return AXIS2_FAILURE;
 
-    trust_data->key_type = axiom_element_get_text(key_type_ele, env, key_type_node);
+    data->key_type = axiom_element_get_text(key_type_ele, env, key_type_node);
 
     AXIS2_FREE(env->allocator, key_type_qname);
     return AXIS2_SUCCESS;
@@ -372,12 +372,12 @@
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    rst_ele = (axiom_element_t *)(axiom_node_get_data_element(trust_data->rst_node, env));
+    rst_ele = (axiom_element_t *)(axiom_node_get_data_element(data->rst_node, env));
 
-    key_size_qname = axutil_qname_create(env, TRUST_KEY_SIZE, trust_data->wst_namespace, TRUST_WST);
+    key_size_qname = axutil_qname_create(env, TRUST_KEY_SIZE, data->wst_namespace, TRUST_WST);
 
     key_size_ele = axiom_element_get_first_child_with_qname(rst_ele, env, key_size_qname,
-                                                            trust_data->rst_node, &key_size_node);
+                                                            data->rst_node, &key_size_node);
     if(!key_size_ele)
         AXIS2_FREE(env->allocator, key_size_qname);
         return AXIS2_FAILURE;
@@ -390,7 +390,7 @@
         return AXIS2_FAILURE;
     }
 
-    trust_data->key_size = atoi(size_str);
+    data->key_size = atoi(size_str);
     AXIS2_FREE(env->allocator, key_size_qname);
     return AXIS2_SUCCESS;
 }

Added: webservices/rampart/scratch/c/trust/src/issuer/issuer.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/issuer/issuer.c?rev=584137&view=auto
==============================================================================
--- webservices/rampart/scratch/c/trust/src/issuer/issuer.c (added)
+++ webservices/rampart/scratch/c/trust/src/issuer/issuer.c Fri Oct 12 04:34:32 2007
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <trust_sts.h>
+#include <axutil_utils.h>
+
+AXIS2_EXPORT int axis2_get_instance(trust_token_issuer_t **inst, const axutil_env_t *env)
+{
+    *inst = (trust_token_issuer_t *)malloc(sizeof(trust_token_issuer_t));	
+    if (!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int axis2_remove_instance(trust_token_issuer_t *inst,
+        const axutil_env_t *env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    return status;
+}
+

Propchange: webservices/rampart/scratch/c/trust/src/issuer/issuer.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/rampart/scratch/c/trust/src/renewer/renewer.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/renewer/renewer.c?rev=584137&view=auto
==============================================================================
--- webservices/rampart/scratch/c/trust/src/renewer/renewer.c (added)
+++ webservices/rampart/scratch/c/trust/src/renewer/renewer.c Fri Oct 12 04:34:32 2007
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <trust_sts.h>
+#include <axutil_utils.h>
+
+AXIS2_EXPORT int axis2_get_instance(trust_token_renewer_t **inst, const axutil_env_t *env)
+{
+    *inst = (trust_token_renewer_t *)malloc(sizeof(trust_token_renewer_t));	
+    if (!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int axis2_remove_instance(trust_token_renewer_t *inst,
+        const axutil_env_t *env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    return status;
+}
+

Propchange: webservices/rampart/scratch/c/trust/src/renewer/renewer.c
------------------------------------------------------------------------------
    svn:executable = *

Modified: webservices/rampart/scratch/c/trust/src/sts.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/sts.c?rev=584137&r1=584136&r2=584137&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/src/sts.c (original)
+++ webservices/rampart/scratch/c/trust/src/sts.c Fri Oct 12 04:34:32 2007
@@ -19,14 +19,13 @@
 typedef struct
 {
 	trust_svc_type_t type;	
-	axutil_dll_desc_t *desc;
-	viod *actor;
+    axutil_dll_desc_t *desc;
+    void *dll;
 }trust_dll_desc_t;
 
 typedef struct  
 {
 	axis2_svc_skeleton_t skeleton;
-	axutil_dll_desc_t *desc;
 	trust_dll_desc_t dll_desc[4];
 } axis2_svc_skeleton_impl_t;
 
@@ -89,11 +88,7 @@
         const axutil_env_t *env)
 {
 	axis2_svc_skeleton_impl_t *svc_skel_im = NULL;
-	trust_token_issuer_t *issuer = NULL;
-	trust_token_validator_t *validator = NULL;
-	trust_token_renewer_t *renewer = NULL;
-	trust_token_canceler_t *canceler = NULL;
-	axutil_dll_desc_t *desc = NULL;
+	int i = 0;
 
 	if (!svc_skeleton)
 	{
@@ -102,17 +97,19 @@
 	
 	svc_skel_im = (axis2_svc_skeleton_impl_t *)svc_skeleton;
 
-	/* Load the issuer DLLs */
-	issuer = trust_get_def_service(TRUST_ISSUER, &desc, env);
-	validator = trust	
-	if (!issuer)
-	{
-		return AXIS2_FAILURE;
-	}
-
-	svc_skel_im->desc = desc;
-	svc_skel_im->issuer = issuer;
-
+    /* Load the dlls for issuer, validator, canceler, renewer
+       implementations */
+    for(i = 0; i < 4; i++)
+    {
+        svc_skel_im->dll_desc[i].type = i;
+        svc_skel_im->dll_desc[i].dll = 
+            trust_get_def_service(i, &svc_skel_im->dll_desc[i].desc, env);
+        if(!svc_skel_im->dll_desc[i].dll)
+        {
+            return AXIS2_FAILURE;
+        }
+    }
+	
     return AXIS2_SUCCESS;
 }
 
@@ -184,6 +181,23 @@
 	
 	return service;
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 

Added: webservices/rampart/scratch/c/trust/src/validator/validator.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/validator/validator.c?rev=584137&view=auto
==============================================================================
--- webservices/rampart/scratch/c/trust/src/validator/validator.c (added)
+++ webservices/rampart/scratch/c/trust/src/validator/validator.c Fri Oct 12 04:34:32 2007
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <trust_sts.h>
+#include <axutil_utils.h>
+
+AXIS2_EXPORT int axis2_get_instance(trust_token_validator_t **inst, const axutil_env_t *env)
+{
+    *inst = (trust_token_validator_t *)malloc(sizeof(trust_token_validator_t));	
+    if (!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int axis2_remove_instance(trust_token_validator_t *inst,
+        const axutil_env_t *env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    return status;
+}
+

Propchange: webservices/rampart/scratch/c/trust/src/validator/validator.c
------------------------------------------------------------------------------
    svn:executable = *