You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ka...@apache.org on 2007/02/02 06:29:13 UTC
svn commit: r502506 - in /webservices/axis2/trunk/c/rampart: include/
samples/client/sec_echo/ src/core/ src/handlers/ src/omxmlsec/tokens/
src/util/
Author: kaushalye
Date: Thu Feb 1 21:29:11 2007
New Revision: 502506
URL: http://svn.apache.org/viewvc?view=rev&rev=502506
Log:
This commit includes
1. New tokens added to the OMXMLSecurity token base.
ds:SignatureValue, ds:SignedInfo, ds:C14nMethod, ds:SignatureMethod, ds:DigestMethod, ds:DigestValue,ds:Transform,ds:Transforms
2. Seperated password callback module loading and calling logic. This will help to write a init() function later that will load all DLLs at the on the startup. Definitely will boost the performance.
3. Few logs were added to the mod_rampart and rampart handlers.
4. Modified build system to include new tokens.
Added:
webservices/axis2/trunk/c/rampart/include/oxs_token_c14n_method.h
webservices/axis2/trunk/c/rampart/include/oxs_token_digest_method.h
webservices/axis2/trunk/c/rampart/include/oxs_token_digest_value.h
webservices/axis2/trunk/c/rampart/include/oxs_token_signature_method.h
webservices/axis2/trunk/c/rampart/include/oxs_token_signature_value.h
webservices/axis2/trunk/c/rampart/include/oxs_token_signed_info.h
webservices/axis2/trunk/c/rampart/include/oxs_token_transform.h
webservices/axis2/trunk/c/rampart/include/oxs_token_transforms.h
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_c14n_method.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_method.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_value.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_method.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_value.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signed_info.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transform.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transforms.c
Modified:
webservices/axis2/trunk/c/rampart/include/oxs_constants.h
webservices/axis2/trunk/c/rampart/include/oxs_token_encryption_method.h
webservices/axis2/trunk/c/rampart/include/rampart_util.h
webservices/axis2/trunk/c/rampart/samples/client/sec_echo/deploy_client_repo.sh
webservices/axis2/trunk/c/rampart/src/core/mod_rampart.c
webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/Makefile.am
webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c
webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c
webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
webservices/axis2/trunk/c/rampart/src/util/username_token.c
Modified: webservices/axis2/trunk/c/rampart/include/oxs_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_constants.h?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_constants.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_constants.h Thu Feb 1 21:29:11 2007
@@ -175,6 +175,10 @@
#define OXS_NODE_ENCRYPTED_KEY "EncryptedKey"
#define OXS_HREF_ENCRYPTED_KEY "http://www.w3.org/2001/04/xmlenc#EncryptedKey"
+/****************************************************************
+ C14N
+****************************************************************/
+#define OXS_HREF_C14N "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
/****************************************************************
KeyNAME
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_c14n_method.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_c14n_method.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_c14n_method.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_c14n_method.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_C14N_METHOD_H
+#define OXS_C14N_METHOD_H
+
+
+/**
+ * @file oxs_token_c14n_method.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+* C14N Method element
+*/
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_c14n_method_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t *algorithm
+ );
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_c14n_method(const axis2_env_t *env, axiom_node_t *c14n_mtd_node);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_C14N_METHOD_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_digest_method.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_digest_method.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_digest_method.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_digest_method.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_DIGEST_METHOD_H
+#define OXS_DIGEST_METHOD_H
+
+
+/**
+ * @file oxs_token_digest_method.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+* DigestMethod element
+*/
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_digest_method_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t *algorithm
+ );
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_digest_method(const axis2_env_t *env, axiom_node_t *enc_mtd_node);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_DIGEST_METHOD_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_digest_value.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_digest_value.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_digest_value.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_digest_value.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_TOKEN_DIGEST_VALUE_H
+#define OXS_TOKEN_DIGEST_VALUE_H
+
+
+/**
+ * @file oxs_token_digest_value.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* DigestValue element
+*/
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_digest_value(const axis2_env_t *env,
+ axiom_node_t *sv_node);
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_digest_value_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* digest_val
+ );
+
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_TOKEN_DIGEST_VALUE_H */
Modified: webservices/axis2/trunk/c/rampart/include/oxs_token_encryption_method.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_encryption_method.h?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_encryption_method.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_encryption_method.h Thu Feb 1 21:29:11 2007
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-#ifndef OXS_ENCRIPTION_METHOD_H
-#define OXS_ENCRIPTION_METHOD_H
+#ifndef OXS_ENCRYPTION_METHOD_H
+#define OXS_ENCRYPTION_METHOD_H
/**
- * @file oxs_token_encription_method.h
+ * @file oxs_token_encryption_method.h
* @brief
*/
@@ -51,4 +51,4 @@
}
#endif
-#endif /* OXS_ENCRIPTION_METHOD_H */
+#endif /* OXS_ENCRYPTION_METHOD_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_signature_method.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_signature_method.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_signature_method.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_signature_method.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_SIGNATURE_METHOD_H
+#define OXS_SIGNATURE_METHOD_H
+
+
+/**
+ * @file oxs_token_signature_method.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+* Signature Method element
+*/
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_signature_method_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t *algorithm
+ );
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_signature_method(const axis2_env_t *env, axiom_node_t *enc_mtd_node);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_SIGNATURE_METHOD_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_signature_value.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_signature_value.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_signature_value.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_signature_value.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_TOKEN_SIGNATURE_VALUE_H
+#define OXS_TOKEN_SIGNATURE_VALUE_H
+
+
+/**
+ * @file oxs_token_signature_value.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* Signature Value element
+*/
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_signature_value(const axis2_env_t *env,
+ axiom_node_t *sv_node);
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_signature_value_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* signature_val
+ );
+
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_TOKEN_SIGNATURE_VALUE_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_signed_info.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_signed_info.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_signed_info.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_signed_info.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_TOKEN_SIGNED_INFO_H
+#define OXS_TOKEN_SIGNED_INFO_H
+
+
+/**
+ * @file oxs_token_signed_info.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* SignedInfo element
+*/
+AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+oxs_token_build_signed_info_element(const axis2_env_t *env,
+ axiom_node_t *parent
+ );
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_TOKEN_SIGNED_INFO_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_transform.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_transform.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_transform.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_transform.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_TRANSFORM_H
+#define OXS_TRANSFORM_H
+
+
+/**
+ * @file oxs_token_c14n_method.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+* ds:Transform element
+*/
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_transform_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t *algorithm
+ );
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_transform(const axis2_env_t *env, axiom_node_t *transform_node);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_TRANSFORM_H */
Added: webservices/axis2/trunk/c/rampart/include/oxs_token_transforms.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_transforms.h?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_transforms.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_transforms.h Thu Feb 1 21:29:11 2007
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_TOKEN_TRANSFORMS_H
+#define OXS_TOKEN_TRANSFORMS_H
+
+
+/**
+ * @file oxs_token_signed_info.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* ds:Transforms element
+*/
+AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+oxs_token_build_transforms_element(const axis2_env_t *env,
+ axiom_node_t *parent
+ );
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_TOKEN_TRANSFORMS_H */
Modified: webservices/axis2/trunk/c/rampart/include/rampart_util.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_util.h?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_util.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_util.h Thu Feb 1 21:29:11 2007
@@ -23,6 +23,7 @@
#include <axis2_msg_ctx.h>
#include <rampart_authn_provider.h>
#include <rampart_credentials.h>
+#include <rampart_callback.h>
/**
* @file rampart_util.h
* @brief Utilities of rampart
@@ -83,6 +84,14 @@
const axis2_char_t *password_type,
axis2_msg_ctx_t *msg_ctx);
+/**
+ * Load the password callback module
+ *
+ */
+AXIS2_EXTERN rampart_callback_t* AXIS2_CALL
+rampart_load_pwcb_module(const axis2_env_t *env,
+ axis2_char_t *callback_module_name);
+
/**
*@env the environment
*@callback_module_name the file name of the callback module (.so or .DLL)
@@ -90,12 +99,11 @@
*@ctx The axis2 context
*@return the password for the user or NULL if failed
*/
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
rampart_callback_password(const axis2_env_t *env,
- axis2_char_t *callback_module_name,
+ rampart_callback_t *callback_module,
const axis2_char_t *username,
- axis2_ctx_t *ctx);
+ axis2_ctx_t *ctx);
/**
* Generates the nonce. Nonce is a base64 encoded random string.
Modified: webservices/axis2/trunk/c/rampart/samples/client/sec_echo/deploy_client_repo.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/sec_echo/deploy_client_repo.sh?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/sec_echo/deploy_client_repo.sh (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/sec_echo/deploy_client_repo.sh Thu Feb 1 21:29:11 2007
@@ -24,4 +24,4 @@
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 and $AXIS2C_HOME/axis2.xmlfile"
+echo "WARNING: Make sure that you have correct configurations in sec_echo/services.xml and $CLIENT_REPO/axis2.xml file."
Modified: webservices/axis2/trunk/c/rampart/src/core/mod_rampart.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/core/mod_rampart.c?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/core/mod_rampart.c (original)
+++ webservices/axis2/trunk/c/rampart/src/core/mod_rampart.c Thu Feb 1 21:29:11 2007
@@ -58,6 +58,7 @@
axis2_module_desc_t *module_desc)
{
/* Any initialization stuff of mod_rampart goes here */
+ AXIS2_LOG_INFO(env->log,"[rampart][mod_rampart] mod_rampart initialized");
return AXIS2_SUCCESS;
}
@@ -65,6 +66,7 @@
mod_rampart_shutdown(axis2_module_t *module,
const axis2_env_t *env)
{
+ AXIS2_LOG_INFO(env->log,"[rampart][mod_rampart] mod_rampart shutdown");
if (module->ops)
{
AXIS2_FREE(env->allocator, module->ops);
Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c Thu Feb 1 21:29:11 2007
@@ -48,6 +48,8 @@
rampart_in_handler_create(const axis2_env_t *env,
axis2_string_t *name)
{
+ AXIS2_LOG_INFO(env->log,
+ "[rampart][rampart_in_handler] Created");
axis2_handler_t *handler = NULL;
AXIS2_ENV_CHECK(env, NULL);
handler = axis2_handler_create(env);
Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/Makefile.am?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/Makefile.am Thu Feb 1 21:29:11 2007
@@ -5,7 +5,9 @@
token_reference_list.c token_data_reference.c token_encrypted_key.c \
token_key_identifier.c token_x509_data.c token_x509_issuer_serial.c\
token_x509_issuer_name.c token_x509_serial_number.c token_security_token_reference.c \
- token_embedded.c token_reference.c
+ token_embedded.c token_reference.c token_signature_value.c token_signed_info.c \
+ token_c14n_method.c token_signature_method.c token_digest_method.c token_digest_value.c \
+ token_transform.c token_transforms.c
liboxstokens_la_LIBADD =../../../../util/src/libaxis2_util.la \
../../../../axiom/src/om/libaxis2_axiom.la
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_c14n_method.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_c14n_method.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_c14n_method.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_c14n_method.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,90 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_c14n_method.h>
+#include <axiom_attribute.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_c14n_method_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* algorithm
+ )
+{
+ axiom_node_t *c14n_method_node = NULL;
+ axiom_element_t *c14n_method_ele = NULL;
+ axiom_attribute_t *algo_attr = NULL;
+ int ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+ c14n_method_ele = axiom_element_create(env, parent, OXS_NODE_CANONICALIZATION_METHOD, ns_obj, &c14n_method_node);
+ if (!c14n_method_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating c14n method element");
+ return NULL;
+ }
+ /*If c14n algorithm is NULL then use the default*/
+ if (!algorithm)
+ {
+ algorithm = (axis2_char_t*)OXS_HREF_C14N;
+ }
+
+ algo_attr = axiom_attribute_create(env, OXS_ATTR_ALGORITHM, algorithm, NULL);
+
+ ret = AXIOM_ELEMENT_ADD_ATTRIBUTE(c14n_method_ele, env, algo_attr, c14n_method_node);
+
+ return c14n_method_node;
+
+}
+
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_c14n_method(const axis2_env_t *env, axiom_node_t *c14n_mtd_node)
+{
+ axis2_char_t *c14n_mtd = NULL;
+ axiom_element_t *c14n_mtd_ele = NULL;
+
+ if(!c14n_mtd_node){
+ return NULL;
+ }
+
+ c14n_mtd_ele = AXIOM_NODE_GET_DATA_ELEMENT(c14n_mtd_node, env);
+ if (!c14n_mtd_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error retrieving c14n method element");
+ return NULL;
+ }
+
+ c14n_mtd = AXIOM_ELEMENT_GET_ATTRIBUTE_VALUE_BY_NAME(c14n_mtd_ele, env, OXS_ATTR_ALGORITHM);
+ if((!c14n_mtd) ||(0 == AXIS2_STRCMP("", c14n_mtd))){
+ return NULL;
+ }
+
+ return c14n_mtd;
+
+}
+
Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c Thu Feb 1 21:29:11 2007
@@ -40,7 +40,7 @@
if (!cipher_data_ele)
{
oxs_error(env, ERROR_LOCATION,
- OXS_ERROR_ELEMENT_FAILED, "Error creating cipher value element");
+ OXS_ERROR_ELEMENT_FAILED, "Error creating cipher data element");
return NULL;
}
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_method.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_method.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_method.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_method.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,90 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_digest_method.h>
+#include <axiom_attribute.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_digest_method_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* algorithm
+ )
+{
+ axiom_node_t *digest_method_node = NULL;
+ axiom_element_t *digest_method_ele = NULL;
+ axiom_attribute_t *algo_attr = NULL;
+ int ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+ digest_method_ele = axiom_element_create(env, parent, OXS_NODE_DIGEST_METHOD, ns_obj, &digest_method_node);
+ if (!digest_method_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating digest method element");
+ return NULL;
+ }
+ /*If digest algorithm is NULL then use the default*/
+ if (!algorithm)
+ {
+ algorithm = (axis2_char_t*)OXS_HREF_SHA1;
+ }
+
+ algo_attr = axiom_attribute_create(env, OXS_ATTR_ALGORITHM, algorithm, NULL);
+
+ ret = AXIOM_ELEMENT_ADD_ATTRIBUTE(digest_method_ele, env, algo_attr, digest_method_node);
+
+ return digest_method_node;
+
+}
+
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_digest_method(const axis2_env_t *env, axiom_node_t *digest_mtd_node)
+{
+ axis2_char_t *digest_mtd = NULL;
+ axiom_element_t *digest_mtd_ele = NULL;
+
+ if(!digest_mtd_node){
+ return NULL;
+ }
+
+ digest_mtd_ele = AXIOM_NODE_GET_DATA_ELEMENT(digest_mtd_node, env);
+ if (!digest_mtd_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error retrieving digest method element");
+ return NULL;
+ }
+
+ digest_mtd = AXIOM_ELEMENT_GET_ATTRIBUTE_VALUE_BY_NAME(digest_mtd_ele, env, OXS_ATTR_ALGORITHM);
+ if((!digest_mtd) ||(0 == AXIS2_STRCMP("", digest_mtd))){
+ return NULL;
+ }
+
+ return digest_mtd;
+
+}
+
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_value.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_value.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_value.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_digest_value.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,67 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_digest_value.h>
+#include <axiom_element.h>
+#include <oxs_axiom.h>
+
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_digest_value(const axis2_env_t *env,
+ axiom_node_t *digest_val_node)
+{
+ axis2_char_t *digest_val = NULL;
+ /*TODO Verification*/
+ digest_val = (axis2_char_t*)oxs_axiom_get_node_content(env, digest_val_node);
+ return digest_val;
+
+}
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_digest_value_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* digest_val
+ )
+{
+ axiom_node_t *digest_value_node = NULL;
+ axiom_element_t *digest_value_ele = NULL;
+ axis2_status_t ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+ digest_value_ele = axiom_element_create(env, parent, OXS_NODE_DIGEST_VALUE, ns_obj, &digest_value_node);
+ if (!digest_value_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating digest value element");
+ return NULL;
+ }
+
+ if (digest_val)
+ {
+ ret = AXIOM_ELEMENT_SET_TEXT(digest_value_ele, env, digest_val, digest_value_node);
+ }
+
+ return digest_value_node;
+
+}
+
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_method.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_method.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_method.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_method.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,89 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_signature_method.h>
+#include <axiom_attribute.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_signature_method_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* algorithm
+ )
+{
+ axiom_node_t *signature_method_node = NULL;
+ axiom_element_t *signature_method_ele = NULL;
+ axiom_attribute_t *algo_attr = NULL;
+ int ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+ signature_method_ele = axiom_element_create(env, parent, OXS_NODE_SIGNATURE_METHOD, ns_obj, &signature_method_node);
+ if (!signature_method_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating signature method element");
+ return NULL;
+ }
+ /*Fixed bug. If signature algorithm is NULL then use the default*/
+ if (!algorithm)
+ {
+ algorithm = (axis2_char_t*)OXS_HREF_RSA_SHA1;
+ }
+
+ algo_attr = axiom_attribute_create(env, OXS_ATTR_ALGORITHM, algorithm, NULL);
+
+ ret = AXIOM_ELEMENT_ADD_ATTRIBUTE(signature_method_ele, env, algo_attr, signature_method_node);
+
+ return signature_method_node;
+
+}
+
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_signature_method(const axis2_env_t *env, axiom_node_t *enc_mtd_node)
+{
+ axis2_char_t *enc_mtd = NULL;
+ axiom_element_t *enc_mtd_ele = NULL;
+
+ if(!enc_mtd_node){
+ return NULL;
+ }
+
+ enc_mtd_ele = AXIOM_NODE_GET_DATA_ELEMENT(enc_mtd_node, env);
+ if (!enc_mtd_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error retrieving signature method element");
+ return NULL;
+ }
+
+ enc_mtd = AXIOM_ELEMENT_GET_ATTRIBUTE_VALUE_BY_NAME(enc_mtd_ele, env, OXS_ATTR_ALGORITHM);
+ if((!enc_mtd) ||(0 == AXIS2_STRCMP("", enc_mtd))){
+ return NULL;
+ }
+ return enc_mtd;
+
+}
+
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_value.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_value.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_value.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signature_value.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,67 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_signature_value.h>
+#include <axiom_element.h>
+#include <oxs_axiom.h>
+
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_signature_value(const axis2_env_t *env,
+ axiom_node_t *sv_node)
+{
+ axis2_char_t *sv = NULL;
+ /*TODO Verification*/
+ sv = (axis2_char_t*)oxs_axiom_get_node_content(env, sv_node);
+ return sv;
+
+}
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_signature_value_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* signature_val
+ )
+{
+ axiom_node_t *signature_value_node = NULL;
+ axiom_element_t *signature_value_ele = NULL;
+ axis2_status_t ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+ signature_value_ele = axiom_element_create(env, parent, OXS_NODE_SIGNATURE_VALUE, ns_obj, &signature_value_node);
+ if (!signature_value_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating signature value element");
+ return NULL;
+ }
+
+ if (signature_val)
+ {
+ ret = AXIOM_ELEMENT_SET_TEXT(signature_value_ele, env, signature_val, signature_value_node);
+ }
+
+ return signature_value_node;
+
+}
+
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signed_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signed_info.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signed_info.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_signed_info.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,48 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_signed_info.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_signed_info_element(const axis2_env_t *env,
+ axiom_node_t *parent
+ )
+{
+ axiom_node_t *signed_info_node = NULL;
+ axiom_element_t *signed_info_ele = NULL;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+
+ signed_info_ele = axiom_element_create(env, parent, OXS_NODE_SIGNEDINFO, ns_obj, &signed_info_node);
+ if (!signed_info_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating SignedInfo element");
+ return NULL;
+ }
+
+ return signed_info_node;
+}
+
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transform.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transform.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transform.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transform.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,90 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_transform.h>
+#include <axiom_attribute.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_transform_element(const axis2_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* algorithm
+ )
+{
+ axiom_node_t *transform_node = NULL;
+ axiom_element_t *transform_ele = NULL;
+ axiom_attribute_t *algo_attr = NULL;
+ int ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+ transform_ele = axiom_element_create(env, parent, OXS_NODE_TRANSFORM, ns_obj, &transform_node);
+ if (!transform_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating transform element");
+ return NULL;
+ }
+ /*If transform algorithm is NULL then use the default*/
+ if (!algorithm)
+ {
+ algorithm = (axis2_char_t*)OXS_HREF_C14N;
+ }
+
+ algo_attr = axiom_attribute_create(env, OXS_ATTR_ALGORITHM, algorithm, NULL);
+
+ ret = AXIOM_ELEMENT_ADD_ATTRIBUTE(transform_ele, env, algo_attr, transform_node);
+
+ return transform_node;
+
+}
+
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+oxs_token_get_transform(const axis2_env_t *env, axiom_node_t *transform_node)
+{
+ axis2_char_t *transform = NULL;
+ axiom_element_t *transform_ele = NULL;
+
+ if(!transform_node){
+ return NULL;
+ }
+
+ transform_ele = AXIOM_NODE_GET_DATA_ELEMENT(transform_node, env);
+ if (!transform_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error retrieving digest method element");
+ return NULL;
+ }
+
+ transform = AXIOM_ELEMENT_GET_ATTRIBUTE_VALUE_BY_NAME(transform_ele, env, OXS_ATTR_ALGORITHM);
+ if((!transform) ||(0 == AXIS2_STRCMP("", transform))){
+ return NULL;
+ }
+
+ return transform;
+
+}
+
Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transforms.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transforms.c?view=auto&rev=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transforms.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_transforms.c Thu Feb 1 21:29:11 2007
@@ -0,0 +1,48 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_token_transforms.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_transforms_element(const axis2_env_t *env,
+ axiom_node_t *parent
+ )
+{
+ axiom_node_t *transforms_node = NULL;
+ axiom_element_t *transforms_ele = NULL;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+ OXS_DS);
+
+
+ transforms_ele = axiom_element_create(env, parent, OXS_NODE_TRANSFORMS, ns_obj, &transforms_node);
+ if (!transforms_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating Transforms element");
+ return NULL;
+ }
+
+ return transforms_node;
+}
+
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=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c Thu Feb 1 21:29:11 2007
@@ -80,9 +80,10 @@
axis2_msg_ctx_t *msg_ctx)
{
axis2_char_t *enc_user = NULL;
- axis2_char_t *pw_callback_module = NULL;
+ axis2_char_t *pw_callback_module_name = NULL;
axis2_char_t *password = NULL;
axis2_ctx_t *ctx = NULL;
+ rampart_callback_t *pwcb = NULL;
/*Check if encUserPassword is in the context. This is designed specially for PHP
i.e.In any context in the context hierarchy starting from msg, op, svc, etc.*/
@@ -95,8 +96,8 @@
/*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){
+ pw_callback_module_name = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
+ if(!pw_callback_module_name){
return NULL;
}
if(!enc_user){
@@ -108,8 +109,13 @@
}
}
/*Get axis2_ctx_t. This is designed specially for PHP*/
-
- password = rampart_callback_password(env, pw_callback_module, enc_user, ctx);
+ pwcb = rampart_load_pwcb_module(env, pw_callback_module_name);
+ if(!pwcb){
+ AXIS2_LOG_INFO(env->log, "[rampart][rhu] Password callback module %s is NULL", pw_callback_module_name);
+ return NULL;
+ }else{
+ password = rampart_callback_password(env, pwcb, enc_user, ctx);
+ }
return password;
}
Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_util.c?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_util.c Thu Feb 1 21:29:11 2007
@@ -137,18 +137,30 @@
return auth_status;
}
+AXIS2_EXTERN rampart_callback_t* AXIS2_CALL
+rampart_load_pwcb_module(const axis2_env_t *env,
+ axis2_char_t *callback_module_name)
+{
+ rampart_callback_t *cb = NULL;
+
+ cb = (rampart_callback_t*)rampart_load_module(env, callback_module_name);
+ if (!cb)
+ {
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_util] Unable to identify the callback module %s. ERROR", callback_module_name);
+ return AXIS2_FAILURE;
+ }
+
+ return cb;
+
+}
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
rampart_callback_password(const axis2_env_t *env,
- axis2_char_t *callback_module_name,
+ rampart_callback_t *callback_module,
const axis2_char_t *username,
axis2_ctx_t *ctx)
{
- rampart_callback_t* rcb = NULL;
axis2_char_t *password = NULL;
- axis2_dll_desc_t *dll_desc = NULL;
- void *ptr = NULL;
- axis2_param_t *impl_info_param = NULL;
axis2_property_t* property = NULL;
void *cb_prop_val= NULL;
@@ -161,31 +173,16 @@
property = NULL;
}
- dll_desc = axis2_dll_desc_create(env);
- AXIS2_DLL_DESC_SET_NAME(dll_desc, env, callback_module_name);
- impl_info_param = axis2_param_create(env, NULL, NULL);
- AXIS2_PARAM_SET_VALUE(impl_info_param, env, dll_desc);
- axis2_class_loader_init(env);
- ptr = axis2_class_loader_create_dll(env, impl_info_param);
-
- /*callback()*/
- if (!ptr)
- {
- AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Unable to create the pw callback module %s. ERROR", callback_module_name);
- return NULL;
- }
-
- rcb = (rampart_callback_t*)ptr;
- if (!rcb)
+ if (!callback_module)
{
- AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Unable to load the pw callback module %s. ERROR", callback_module_name);
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Cannot callback password. PWCB module is NULL. ERROR");
return NULL;
}
/*Get the password thru the callback*/
- password = RAMPART_CALLBACK_CALLBACK_PASSWORD(rcb, env, username, cb_prop_val);
+ password = RAMPART_CALLBACK_CALLBACK_PASSWORD(callback_module, env, username, cb_prop_val);
- AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Password taken from the callback module %s. SUCCESS", callback_module_name);
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Password taken from the callback module. SUCCESS");
return password;
}
Modified: webservices/axis2/trunk/c/rampart/src/util/username_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/username_token.c?view=diff&rev=502506&r1=502505&r2=502506
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/username_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/username_token.c Thu Feb 1 21:29:11 2007
@@ -96,7 +96,7 @@
{
axis2_char_t *password = NULL;
axis2_char_t *username = NULL;
- axis2_char_t *pw_callback_module = NULL;
+ axis2_char_t *pw_callback_module_name = NULL;
/*Check if password is in the context.
i.e.In any context in the cotext hierarchy starting from msg, op, svc, etc.*/
@@ -109,11 +109,18 @@
/*TODO: If not in the context, get the password+username from the credentials module*/
/*If not check whether there is a callback class specified*/
- pw_callback_module = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
- if (pw_callback_module)
+ pw_callback_module_name = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
+ if (pw_callback_module_name)
{
+ rampart_callback_t *pwcb = NULL;
+
+ pwcb = rampart_load_pwcb_module(env, pw_callback_module_name);
+ if(!pwcb){
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Password callback module %s is NULL", pw_callback_module_name);
+ return NULL;
+ }
username = RAMPART_ACTIONS_GET_USER(actions, env);
- password = rampart_callback_password(env, pw_callback_module, username, ctx);
+ password = rampart_callback_password(env, pwcb, username, ctx);
}
return password;
}
@@ -354,7 +361,7 @@
axis2_char_t *nonce = NULL;
axis2_char_t *created = NULL;
axis2_char_t *password_type = NULL;
- axis2_char_t *pw_callback_module = NULL;
+ axis2_char_t *pw_callback_module_name = NULL;
axis2_char_t *authn_module_name = NULL;
axis2_char_t *password_from_svr = NULL;
axis2_char_t *password_to_compare = NULL;
@@ -514,16 +521,22 @@
}
}else{
+ rampart_callback_t *pwcb = NULL;
+
/*Auth module is NULL. Use Callback password*/
- pw_callback_module = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
- if(!pw_callback_module){
+ pw_callback_module_name = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
+ if(!pw_callback_module_name){
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][rampart_usernametoken] Password callback module is not specified");
return AXIS2_FAILURE;
}
- AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Password authentication using CALLBACK MODULE %s", pw_callback_module);
-
- password_from_svr = rampart_callback_password(env, pw_callback_module, username, ctx);
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Password authentication using CALLBACK MODULE %s", pw_callback_module_name);
+ pwcb = rampart_load_pwcb_module(env, pw_callback_module_name);
+ if(!pwcb){
+ AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Password callback module %s is NULL", pw_callback_module_name);
+ return AXIS2_FAILURE;
+ }
+ password_from_svr = rampart_callback_password(env, pwcb, username, ctx);
if (!password_from_svr)
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][rampart_usernametoken] Cannot get the password for user %s", username);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org