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/08/21 10:49:24 UTC

svn commit: r568023 - in /webservices/rampart/trunk/c/src: omxmlsec/key.c util/rampart_context.c

Author: kaushalye
Date: Tue Aug 21 01:49:24 2007
New Revision: 568023

URL: http://svn.apache.org/viewvc?rev=568023&view=rev
Log:
Rampart context need to maintain it's session key

Modified:
    webservices/rampart/trunk/c/src/omxmlsec/key.c
    webservices/rampart/trunk/c/src/util/rampart_context.c

Modified: webservices/rampart/trunk/c/src/omxmlsec/key.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/key.c?rev=568023&r1=568022&r2=568023&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/key.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/key.c Tue Aug 21 01:49:24 2007
@@ -126,7 +126,8 @@
     AXIS2_ENV_CHECK(env, NULL);
     
     AXIS2_PARAM_CHECK(env->error, key, NULL);
-    
+
+    /*Create new key*/
     new_key = oxs_key_create(env);
     if (!new_key)
     {
@@ -134,7 +135,7 @@
         return NULL;
     }
    
-       
+    /*Populate with data buf*/   
     oxs_key_populate_with_buf(new_key, 
                     env,
                     oxs_key_get_buffer(key, env),

Modified: webservices/rampart/trunk/c/src/util/rampart_context.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_context.c?rev=568023&r1=568022&r2=568023&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_context.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_context.c Tue Aug 21 01:49:24 2007
@@ -176,6 +176,7 @@
     rampart_context->require_timestamp = AXIS2_FALSE;
     rampart_context->ctx = NULL;
     rampart_context->ref = 0;
+    rampart_context->session_key = NULL;
 
     return rampart_context;
 }
@@ -232,7 +233,12 @@
             /*RAMPART_AUTHN_PROVIDER_FREE(rampart_context->authn_provider, env);*/
             rampart_context->authn_provider = NULL;
         }
-        
+       
+        if(rampart_context->session_key)
+        {
+            oxs_key_free(rampart_context->session_key, env);
+            rampart_context->session_key = NULL;
+        }
         AXIS2_FREE(env->allocator,rampart_context);
         rampart_context = NULL;
     }
@@ -779,7 +785,12 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, session_key, AXIS2_FAILURE);
 
-    rampart_context->session_key = session_key;
+    /*Dup before set*/
+    if(rampart_context->session_key){
+        oxs_key_free(rampart_context->session_key, env);
+        rampart_context->session_key = NULL;
+    }
+    rampart_context->session_key = oxs_key_dup(session_key, env);
     return AXIS2_SUCCESS;
 }