Author: kaushalye
Date: Thu Mar 29 05:50:48 2007
New Revision: 523690

URL: http://svn.apache.org/viewvc?view=rev&rev=523690
Log:
Adding a replay detection record to rampart

Added:
    webservices/rampart/trunk/c/include/rampart_rd_record.h
    webservices/rampart/trunk/c/src/util/rampart_rd_record.c
Modified:
    
webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/src/util/Makefile.am

Added: webservices/rampart/trunk/c/include/rampart_rd_record.h
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_rd_record.h?view=auto&rev=523690
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_rd_record.h (added)
+++ webservices/rampart/trunk/c/include/rampart_rd_record.h Thu Mar 29 05:50:48 
2007
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef RAMPART_RD_RECORD_H
+#define RAMPART_RD_RECORD_H
+
+/** @defgroup rampart_context
+ * @ingroup rampart_context
+ * @{
+ */
+
+#include <rampart_util.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ typedef struct rampart_rd_record_t rampart_rd_record_t;
+/*Create function*/
+AXIS2_EXTERN rampart_rd_record_t *AXIS2_CALL
+rampart_rd_record_create(const axis2_env_t *env);
+
+/*Free*/
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_free(rampart_rd_record_t *rd_record,
+                  const axis2_env_t *env);
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rampart_rd_record_get_id(
+    const rampart_rd_record_t *rd_record,
+    const axis2_env_t *env);
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rampart_rd_record_get_timestamp(
+    const rampart_rd_record_t *rd_record,
+    const axis2_env_t *env);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_set_id(
+    rampart_rd_record_t *rd_record,
+    const axis2_env_t *env,
+    axis2_char_t *id);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_set_timestamp(
+    rampart_rd_record_t *rd_record,
+    const axis2_env_t *env,
+    axis2_char_t *timestamp);
+
+AXIS2_EXTERN rampart_rd_record_t *AXIS2_CALL
+rampart_rd_record_create(const axis2_env_t *env);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_free(rampart_rd_record_t *rd_record,
+                  const axis2_env_t *env);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Modified: 
webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-outgoing-secpolicy.xml
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-outgoing-secpolicy.xml?view=diff&rev=523690&r1=523689&r2=523690
==============================================================================
--- 
webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-outgoing-secpolicy.xml
 (original)
+++ 
webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-outgoing-secpolicy.xml
 Thu Mar 29 05:50:48 2007
@@ -37,9 +37,9 @@
                        <sp:Wss10 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                <wsp:Policy>
                     <!--Please uncomment ONE of these to select an identifier 
pattern-->
-                    <sp:MustSupportRefKeyIdentifier/>
-                    <!--sp:MustSupportRefEmbeddedToken/-->
-                    <!--sp:MustSupportRefIssuerSerial-->
+                    <!--sp:MustSupportRefKeyIdentifier/-->
+                    <sp:MustSupportRefEmbeddedToken/>
+                    <!--sp:MustSupportRefIssuerSerial/-->
                                </wsp:Policy>
                        </sp:Wss10>
                        <sp:EncryptedParts 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>

Modified: webservices/rampart/trunk/c/src/util/Makefile.am
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/Makefile.am?view=diff&rev=523690&r1=523689&r2=523690
==============================================================================
--- webservices/rampart/trunk/c/src/util/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/util/Makefile.am Thu Mar 29 05:50:48 2007
@@ -6,7 +6,7 @@
                                                        rampart_util.c 
rampart_handler_util.c username_token.c  timestamp_token.c \
                                                        rampart_encryption.c 
rampart_sec_header_processor.c rampart_sec_processed_result.c \
                                                        
rampart_sec_header_builder.c rampart_context.c rampart_engine.c 
rampart_token_processor.c rampart_signature.c \
-                                                       rampart_token_builder.c
+                                                       rampart_token_builder.c 
rampart_rd_record.c
 
 
 librampart_util_la_LIBADD  = -lssl \

Added: webservices/rampart/trunk/c/src/util/rampart_rd_record.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_rd_record.c?view=auto&rev=523690
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_rd_record.c (added)
+++ webservices/rampart/trunk/c/src/util/rampart_rd_record.c Thu Mar 29 
05:50:48 2007
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rampart_rd_record.h>
+#include <rampart_constants.h>
+
+struct rampart_rd_record_t
+{
+    axis2_char_t *id;
+    axis2_char_t *timestamp;
+
+};
+/*Public functions*/
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rampart_rd_record_get_id(
+    const rampart_rd_record_t *rd_record,
+    const axis2_env_t *env)
+{
+    return rd_record->id;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rampart_rd_record_get_timestamp(
+    const rampart_rd_record_t *rd_record,
+    const axis2_env_t *env)
+{
+    return rd_record->timestamp;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_set_id(
+    rampart_rd_record_t *rd_record,
+    const axis2_env_t *env,
+    axis2_char_t *id)
+{
+
+    if (rd_record->id)
+    {
+        AXIS2_FREE(env->allocator, rd_record->id );
+        rd_record->id = NULL;
+    }
+    rd_record->id = axis2_strdup(env, id);
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_set_timestamp(
+    rampart_rd_record_t *rd_record,
+    const axis2_env_t *env,
+    axis2_char_t *timestamp)
+{
+
+    if (rd_record->timestamp)
+    {
+        AXIS2_FREE(env->allocator, rd_record->timestamp );
+        rd_record->timestamp = NULL;
+    }
+    rd_record->timestamp = axis2_strdup(env, timestamp);
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rampart_rd_record_t *AXIS2_CALL
+rampart_rd_record_create(const axis2_env_t *env)
+{
+    rampart_rd_record_t *rd_record = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    rd_record = AXIS2_MALLOC(env->allocator, sizeof(rampart_rd_record_t));
+    if (!rd_record)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+    rd_record->id = NULL;
+    rd_record->timestamp = NULL;
+
+    return rd_record;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_rd_record_free(rampart_rd_record_t *rd_record,
+                  const axis2_env_t *env)
+{
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    if (rd_record->id)
+    {
+        AXIS2_FREE(env->allocator, rd_record->id);
+        rd_record->id = NULL;
+    }
+
+    if (rd_record->timestamp)
+    {
+        AXIS2_FREE(env->allocator, rd_record->timestamp);
+        rd_record->timestamp = NULL;
+    }
+
+    AXIS2_FREE(env->allocator,  rd_record);
+    rd_record = NULL;
+
+    return AXIS2_SUCCESS;
+}


Reply via email to