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 ka...@apache.org on 2006/12/14 09:42:56 UTC

svn commit: r487134 - in /webservices/axis2/trunk/c/rampart: include/ samples/client/enc_echo/ src/omxmlsec/openssl/ src/util/

Author: kaushalye
Date: Thu Dec 14 00:42:55 2006
New Revision: 487134

URL: http://svn.apache.org/viewvc?view=rev&rev=487134
Log:
Modified deploy script, run script and  README file of the client sample.


Modified:
    webservices/axis2/trunk/c/rampart/include/rampart_constants.h
    webservices/axis2/trunk/c/rampart/samples/client/enc_echo/README.txt
    webservices/axis2/trunk/c/rampart/samples/client/enc_echo/deploy_client_repo.sh
    webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c
    webservices/axis2/trunk/c/rampart/samples/client/enc_echo/update_n_run.sh
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c

Modified: webservices/axis2/trunk/c/rampart/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_constants.h?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_constants.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_constants.h Thu Dec 14 00:42:55 2006
@@ -128,6 +128,7 @@
 
 /*Dynamically set values*/
 #define RAMPART_ACTION_PASSWORD "password"
+#define RAMPART_ACTION_ENC_USER_PASSWORD "encUserPassword"
 #define RAMPART_CALLBACK_SPECIFIC_PROPERTY "callbackSpecificProperty"
 
 /*Security processed results*/

Modified: webservices/axis2/trunk/c/rampart/samples/client/enc_echo/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/enc_echo/README.txt?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/enc_echo/README.txt (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/enc_echo/README.txt Thu Dec 14 00:42:55 2006
@@ -1,47 +1,41 @@
-This is a sample to help test encryption.
-This sample works with echo service.
+This sample works with sec_echo service.
 
-How to run
-----------
-1. Create the binary 
-    make
-    make install
-
-2. Create client repository
-    e.g. ~/client_home [CLIENT_HOME]
-    NOTE: You may use the AXIS2C_HOME as the common repository for server and
-    client. If so skip steps 3-5.
- 
-3. Copy rampart/samples/client/enc_echo/data/axis2.xml to CLIENT_REPO
-
-4. Copy AXIS2C_HOME/lib to CLIENT_HOME
-
-5. Copy AXIS2C_HOME/modules to CLIENT_HOME
-  
-   
-6. Enable rampart in axis2.xml in the AXIS2C_HOME and add In/Outflow parameters as
-    in rampart/samples/client/enc_eco/data/server.axis2.xml. (Or copy the
-    server.axis2.xml file to AXIS2C_HOME/ directory and rename it as axis2.xml)
-
-
-    Before proceed check followings. 
-    (*) The rampart module should be in the module directory of both
-        client(CLIENT_HOME/modules) and the server side(AXIS2C_HOME/deploy/modules).
-    (*) AXIS2C_HOME/axis2.xml and CLIENT_HOME/axis2.xml files should be configred to enable rampart.
- 
-8. To view the message flow use TCPMonitor
-    Listen port: 9090 [specified as in the client argumanet]
-    Target port: 8080 [server port] 
-
-9. Start server in port 8080 
+1. HOW TO CONFIGURE SERVER?
+-----------------------
+Go to rampart/samples/server/sec_echo and 
+Run  %make install
+This will deploy a sec_echo service and copy security enables services.xml
+file.
+
+2. HOW TO START SERVER
+---------------------
+Start server in port 8080 
      ./axis2_http_server -p8080
 
-10. Run the echo sample 
-     Syntax : ./echo [service_address] [client_home]
-     e.g.   : ./echo http://localhost:9090/axis2/services/echo ~/client_home   
+3. HOW TO CONFIGURE TCPMONITOR (To view messages)
+------------------------------
+    Listen port: 9090 [specified as in the client argument]
+    Target port: 8080 [server port]
+This step is OPTIONAL and can be avoided by starting the server without -p8080
+option.
+
+HOW TO RUN CLIENT?
+-----------------
+Using scripts
+-------------------------
+1. Run %deploy_client_repo.sh/bat 
+2. Run %update_n_run.sh/bat
+
+Using the actual binary
+--------------------------------------
+Run %echo <address> <client_repository>
+
 
-11. You should be able to see the security token is attached to the header of
+If everything is configured properly You should be able to see the security token(s) is/are  attached to the header of
     the SOAP message in the TCP Monitor.
 
-NOTE : Also you can use other samples available under AXIS2C.
+NOTE:
+You need to change the passwordCallbackClass and the en/decryptionPropFile
+in rampart/samples/client/enc_echo/data/client.axis2.xml and
+rampart/samples/server/sec_echo/services.xml to suit your environment.
 

Modified: webservices/axis2/trunk/c/rampart/samples/client/enc_echo/deploy_client_repo.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/enc_echo/deploy_client_repo.sh?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/enc_echo/deploy_client_repo.sh (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/enc_echo/deploy_client_repo.sh Thu Dec 14 00:42:55 2006
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-CLIENT_REPO="$HOME/client_repo"
+CLIENT_REPO="$AXIS2C_HOME/client_repo"
 echo "Start creating a client repository at $CLIENT_REPO"
 
 if [ -d  $CLIENT_REPO ]; 
@@ -12,22 +12,16 @@
     mkdir $CLIENT_REPO
 fi
 
-
 #copy [client]axis2.xml to CLIENT_REPO
-#Removed: We are using our own service. So no need to replace the axis2.xml in the server 
-#echo "Copying axis2.xml to client_repo"
-#cp data/client.enc.axis2.xml $CLIENT_REPO/axis2.xml
-
-#copy [server]axis2.xml to AXIS2C_HOME
-echo "Copying axis2.xml to AXIS2C_HOME"
-cp data/server.enc.axis2.xml $AXIS2C_HOME/axis2.xml
+echo "Copying axis2.xml to $CLIENT_REPO"
+cp data/client.enc.axis2.xml $CLIENT_REPO/axis2.xml
 
 #copy libs to client_repo
-echo "Copying libraries to client_repo"
+echo "Copying libraries to $CLIENT_REPO"
 cp -r $AXIS2C_HOME/lib $CLIENT_REPO/
 
 #INSTALL MODULES to make sure that both server and client have the same module.
-echo "Copying latest modules to client_repo"
+echo "Copying latest modules to $CLIENT_REPO"
 cp -r $AXIS2C_HOME/modules $CLIENT_REPO/
 
-echo "WARNING: Make sure that you have correct configurations in sec_echo/services.xml file"
+echo "WARNING: Make sure that you have correct configurations in sec_echo/services.xml and $AXIS2C_HOME/axis2.xmlfile"

Modified: webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c Thu Dec 14 00:42:55 2006
@@ -154,6 +154,8 @@
     axiom_element_t* echo_om_ele = NULL;
     axiom_node_t* text_om_node = NULL;
     axiom_element_t * text_om_ele = NULL;
+    axiom_node_t* text_om_node2 = NULL;
+    axiom_element_t * text_om_ele2 = NULL;
     axiom_namespace_t *ns1 = NULL;
     axis2_char_t *om_str = NULL;
 
@@ -161,6 +163,8 @@
     echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
     text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
     AXIOM_ELEMENT_SET_TEXT(text_om_ele, env, "echo5", text_om_node);
+    text_om_ele2 = axiom_element_create(env, echo_om_node, "text2", NULL, &text_om_node2);
+    AXIOM_ELEMENT_SET_TEXT(text_om_ele2, env, "echo52", text_om_node2);
 
     om_str = AXIOM_NODE_TO_STRING(echo_om_node, env);
     if (om_str)

Modified: webservices/axis2/trunk/c/rampart/samples/client/enc_echo/update_n_run.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/enc_echo/update_n_run.sh?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/enc_echo/update_n_run.sh (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/enc_echo/update_n_run.sh Thu Dec 14 00:42:55 2006
@@ -1,6 +1,6 @@
 #!/bin/bash
 #If your client repository is different, change the value.
-CLIENT_REPO="$HOME/client_repo"
+CLIENT_REPO="$AXIS2C_HOME/client_repo"
 
 #INSTALL MODULE to make sure that both server and client have the same module.
 echo "Copying latest module to client_repo"

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c Thu Dec 14 00:42:55 2006
@@ -59,7 +59,7 @@
     EVP_CIPHER_CTX_init(&ctx);
     ret = EVP_CipherInit_ex(&ctx, (EVP_CIPHER *)OPENSSL_CIPHER_CTX_GET_CIPHER(oc_ctx, env), NULL, NULL, NULL, do_encrypt);
 
-    /*EVP_CIPHER_CTX_set_padding(&ctx, 1);*/
+    /*EVP_CIPHER_CTX_set_padding(&ctx, 0);*/
 
     ret  = EVP_CipherInit_ex(&ctx, NULL, NULL, key_data,
             /*(unsigned char*)OPENSSL_CIPHER_CTX_GET_IV(oc_ctx, env),*/

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?view=diff&rev=487134&r1=487133&r2=487134
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c Thu Dec 14 00:42:55 2006
@@ -84,6 +84,16 @@
     axis2_char_t *password = NULL;
     axis2_ctx_t *ctx = NULL;
 
+    /*Check if encUserPassword is in the context. This is designed specially for PHP
+    i.e.In any context in the cotext hierarchy starting from msg, op, svc, etc.*/
+    ctx = AXIS2_MSG_CTX_GET_BASE(msg_ctx, env);
+    password = rampart_get_property_from_ctx(env, ctx,  RAMPART_ACTION_ENC_USER_PASSWORD);
+    if (password)
+    {
+        return password;
+    }
+    /*If not found then callback the password*/ 
+
     enc_user = RAMPART_ACTIONS_GET_ENC_USER(actions, env);
     pw_callback_module = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
     if(!pw_callback_module){
@@ -97,8 +107,7 @@
             return NULL;
         }
     }
-    /*Get axis2_ctx_t. This is for designed specially for PHP*/
-    ctx = AXIS2_MSG_CTX_GET_BASE(msg_ctx, env);
+    /*Get axis2_ctx_t. This is designed specially for PHP*/
 
     password = rampart_callback_password(env, pw_callback_module, enc_user, ctx);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org