Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 39792 invoked from network); 22 Jan 2007 12:39:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jan 2007 12:39:24 -0000 Received: (qmail 58217 invoked by uid 500); 22 Jan 2007 12:39:27 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 57683 invoked by uid 500); 22 Jan 2007 12:39:26 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 57657 invoked by uid 500); 22 Jan 2007 12:39:26 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 57634 invoked by uid 99); 22 Jan 2007 12:39:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jan 2007 04:39:26 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jan 2007 04:39:13 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 36D621A9825; Mon, 22 Jan 2007 04:38:07 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r498596 [5/7] - in /webservices/axis2/trunk/c/rampart: ./ include/ src/ src/secpolicy/ src/secpolicy/builder/ src/secpolicy/model/ src/secpolicy/test-resources/ Date: Mon, 22 Jan 2007 12:38:03 -0000 To: axis2-cvs@ws.apache.org From: kaushalye@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070122123807.36D621A9825@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/asymmetric_binding.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/asymmetric_binding.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/asymmetric_binding.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/asymmetric_binding.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,165 @@ +/* + * 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 + +struct rp_asymmetric_binding_t +{ + rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons; + rp_property_t *initiator_token; + rp_property_t *recipient_token; +}; + +AXIS2_EXTERN rp_asymmetric_binding_t *AXIS2_CALL +rp_asymmetric_binding_create(const axis2_env_t *env) +{ + rp_asymmetric_binding_t *asymmetric_binding = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + asymmetric_binding = (rp_asymmetric_binding_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_asymmetric_binding_t)); + + if(asymmetric_binding == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + asymmetric_binding->symmetric_asymmetric_binding_commons = NULL; + asymmetric_binding->initiator_token = NULL; + asymmetric_binding->recipient_token = NULL; + + return asymmetric_binding; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_asymmetric_binding_free( + rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(asymmetric_binding) + { + if(asymmetric_binding->symmetric_asymmetric_binding_commons) + { + rp_symmetric_asymmetric_binding_commons_free( + asymmetric_binding->symmetric_asymmetric_binding_commons, + env); + asymmetric_binding->symmetric_asymmetric_binding_commons=NULL; + } + if(asymmetric_binding->initiator_token) + { + rp_property_free(asymmetric_binding->initiator_token,env); + asymmetric_binding->initiator_token = NULL; + } + if(asymmetric_binding->recipient_token) + { + rp_property_free(asymmetric_binding->recipient_token,env); + asymmetric_binding->recipient_token = NULL; + } + AXIS2_FREE(env->allocator,asymmetric_binding); + } + + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN rp_symmetric_asymmetric_binding_commons_t *AXIS2_CALL +rp_asymmetric_binding_get_symmetric_asymmetric_binding_commons( + rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return asymmetric_binding->symmetric_asymmetric_binding_commons; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_asymmetric_binding_set_symmetric_asymmetric_binding_commons( + rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env, + rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,symmetric_asymmetric_binding_commons,AXIS2_FAILURE); + + asymmetric_binding->symmetric_asymmetric_binding_commons + =symmetric_asymmetric_binding_commons; + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN rp_property_t *AXIS2_CALL +rp_asymmetric_binding_get_initiator_token( + rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return asymmetric_binding->initiator_token; +} + + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_asymmetric_binding_set_initiator_token(rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env, + rp_property_t *initiator_token) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,initiator_token,AXIS2_FAILURE); + if(!asymmetric_binding->initiator_token) + { + return AXIS2_FAILURE; + } + asymmetric_binding->initiator_token =initiator_token; + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_asymmetric_binding_set_recipient_token( + rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env, + rp_property_t *recipient_token) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,recipient_token,AXIS2_FAILURE); + if(!asymmetric_binding->recipient_token) + { + return AXIS2_FAILURE; + } + asymmetric_binding->recipient_token = recipient_token; + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN rp_property_t *AXIS2_CALL +rp_asymmetric_binding_get_recipient_token( + rp_asymmetric_binding_t *asymmetric_binding, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return asymmetric_binding->recipient_token; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/asymmetric_binding.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/binding_commons.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/binding_commons.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/binding_commons.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/binding_commons.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,265 @@ +/* + * 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 + +struct rp_binding_commons_t +{ + rp_algorithmsuite_t *algorithmsuite; + axis2_bool_t include_timestamp; + rp_layout_t *layout; + rp_supporting_tokens_t *signed_supporting_tokens; + rp_supporting_tokens_t *signed_endorsing_supporting_tokens; + rp_supporting_tokens_t *endorsing_supporting_tokens; + rp_supporting_tokens_t *supporting_tokens; +}; + +AXIS2_EXTERN rp_binding_commons_t *AXIS2_CALL +rp_binding_commons_create(const axis2_env_t *env) +{ + rp_binding_commons_t *binding_commons = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + binding_commons = (rp_binding_commons_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_binding_commons_t)); + + if(binding_commons == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + binding_commons->algorithmsuite = NULL; + binding_commons->include_timestamp = AXIS2_FALSE; + binding_commons->layout = NULL; + binding_commons->signed_supporting_tokens = NULL; + binding_commons->signed_endorsing_supporting_tokens = NULL; + binding_commons->endorsing_supporting_tokens = NULL; + binding_commons->supporting_tokens = NULL; + + return binding_commons; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_free(rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(binding_commons) + { + + if(binding_commons->algorithmsuite) + { + rp_algorithmsuite_free(binding_commons->algorithmsuite,env); + binding_commons->algorithmsuite = NULL; + } + if(binding_commons->layout) + { + rp_layout_free(binding_commons->layout,env); + binding_commons->layout = NULL; + } + if(binding_commons->signed_supporting_tokens) + { + rp_supporting_tokens_free(binding_commons->signed_supporting_tokens,env); + binding_commons->signed_supporting_tokens = NULL; + } + if(binding_commons->signed_endorsing_supporting_tokens) + { + rp_supporting_tokens_free(binding_commons->signed_endorsing_supporting_tokens,env); + binding_commons->signed_endorsing_supporting_tokens = NULL; + } + if(binding_commons->endorsing_supporting_tokens) + { + rp_supporting_tokens_free(binding_commons->endorsing_supporting_tokens,env); + binding_commons->endorsing_supporting_tokens = NULL; + } + if(binding_commons->supporting_tokens) + { + rp_supporting_tokens_free(binding_commons->supporting_tokens,env); + binding_commons->supporting_tokens = NULL; + } + AXIS2_FREE(env->allocator,binding_commons); + binding_commons = NULL; + + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_binding_commons_get_include_timestamp(rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return binding_commons->include_timestamp; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_include_timestamp(rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + axis2_bool_t include_timestamp) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,include_timestamp,AXIS2_FAILURE); + + binding_commons->include_timestamp = include_timestamp; + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN rp_algorithmsuite_t *AXIS2_CALL +rp_binding_commons_get_algorithmsuite( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return binding_commons->algorithmsuite; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_algorithmsuite(rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + rp_algorithmsuite_t *algorithmsuite) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,algorithmsuite,AXIS2_FAILURE); + + binding_commons->algorithmsuite = algorithmsuite; + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN rp_layout_t *AXIS2_CALL +rp_binding_commons_get_layout( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return binding_commons->layout; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_layout(rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + rp_layout_t *layout) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,layout,AXIS2_FAILURE); + + binding_commons->layout = layout; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_binding_commons_get_signed_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return binding_commons->signed_supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_signed_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + rp_supporting_tokens_t *signed_supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_supporting_tokens,AXIS2_FAILURE); + + binding_commons->signed_supporting_tokens = signed_supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_binding_commons_get_signed_endorsing_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return binding_commons->signed_endorsing_supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_signed_endorsing_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + rp_supporting_tokens_t *signed_endorsing_supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_endorsing_supporting_tokens,AXIS2_FAILURE); + + binding_commons->signed_endorsing_supporting_tokens = signed_endorsing_supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_binding_commons_get_endorsing_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return binding_commons->endorsing_supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_endorsing_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + rp_supporting_tokens_t *endorsing_supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,endorsing_supporting_tokens,AXIS2_FAILURE); + binding_commons->endorsing_supporting_tokens = endorsing_supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_binding_commons_get_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return binding_commons->supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_binding_commons_set_supporting_tokens( + rp_binding_commons_t *binding_commons, + const axis2_env_t *env, + rp_supporting_tokens_t *supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,supporting_tokens,AXIS2_FAILURE); + + binding_commons->supporting_tokens = supporting_tokens; + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/binding_commons.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/encryption_crypto.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/encryption_crypto.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/encryption_crypto.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/encryption_crypto.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,109 @@ +/* + * 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 + +struct rp_encryption_crypto_t +{ + axis2_char_t *encryption_prop_file; + axis2_char_t *decryption_prop_file; +}; + +AXIS2_EXTERN rp_encryption_crypto_t *AXIS2_CALL +rp_encryption_crypto_create(const axis2_env_t *env) +{ + rp_encryption_crypto_t *encryption_crypto = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + encryption_crypto = (rp_encryption_crypto_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_encryption_crypto_t)); + + if(encryption_crypto == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + encryption_crypto->encryption_prop_file = NULL; + encryption_crypto->decryption_prop_file = NULL; + + return encryption_crypto; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_encryption_crypto_free( + rp_encryption_crypto_t *encryption_crypto, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(encryption_crypto) + { + AXIS2_FREE(env->allocator, encryption_crypto); + encryption_crypto = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_encryption_crypto_get_encryption_prop_file( + rp_encryption_crypto_t *encryption_crypto, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return encryption_crypto->encryption_prop_file; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_encryption_crypto_set_encryption_prop_file( + rp_encryption_crypto_t *encryption_crypto, + const axis2_env_t *env, + axis2_char_t *encryption_prop_file) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encryption_prop_file,AXIS2_FAILURE); + + encryption_crypto->encryption_prop_file = encryption_prop_file; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_encryption_crypto_get_decryption_prop_file( + rp_encryption_crypto_t *encryption_crypto, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return encryption_crypto->decryption_prop_file; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_encryption_crypto_set_decryption_prop_file( + rp_encryption_crypto_t *encryption_crypto, + const axis2_env_t *env, + axis2_char_t *decryption_prop_file) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,decryption_prop_file,AXIS2_FAILURE); + + encryption_crypto->decryption_prop_file = decryption_prop_file; + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/encryption_crypto.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/header.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/header.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/header.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/header.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,122 @@ +/* + * 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 + +struct rp_header_t +{ + axis2_char_t *name; + axis2_char_t *namespace; +}; + +AXIS2_EXTERN rp_header_t *AXIS2_CALL +rp_header_create(const axis2_env_t *env) +{ + rp_header_t *header = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + header = (rp_header_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_header_t)); + + if(header == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + header->name = NULL; + header->namespace = NULL; + + return header; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_header_free(rp_header_t *header, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(header) + { + if(header->name) + { + AXIS2_FREE(env->allocator, header->name); + header->name = NULL; + } + if(header->namespace) + { + AXIS2_FREE(env->allocator, header->namespace); + header->namespace = NULL; + } + AXIS2_FREE(env->allocator, header); + header = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_header_get_name(rp_header_t *header, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return header->name; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_header_set_name(rp_header_t *header, + const axis2_env_t *env, + axis2_char_t *name) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,name,AXIS2_FAILURE); + + header->name = name; + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_header_get_namespace(rp_header_t *header, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return header->namespace; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_header_set_namespace(rp_header_t *header, + const axis2_env_t *env, + axis2_char_t *namespace) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,namespace,AXIS2_FAILURE); + + header->namespace = namespace; + + return AXIS2_SUCCESS; + +} + + Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/header.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/https_token.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/https_token.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/https_token.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/https_token.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,134 @@ +/* + * 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 + +struct rp_https_token_t +{ + axis2_char_t *inclusion; + axis2_bool_t derivedkeys; + axis2_bool_t require_client_certificate; +}; + +AXIS2_EXTERN rp_https_token_t *AXIS2_CALL +rp_https_token_create(const axis2_env_t *env) +{ + rp_https_token_t *https_token = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + https_token = (rp_https_token_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_https_token_t)); + + if(https_token == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + https_token->inclusion = RP_INCLUDE_ALWAYS; + https_token->derivedkeys = AXIS2_FALSE; + https_token->require_client_certificate = AXIS2_FALSE; + + return https_token; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_https_token_free(rp_https_token_t *https_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(https_token) + { + AXIS2_FREE(env->allocator, https_token); + https_token = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_https_token_get_inclusion(rp_https_token_t *https_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return https_token->inclusion; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_https_token_set_inclusion(rp_https_token_t *https_token, + const axis2_env_t *env, + axis2_char_t *inclusion) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,inclusion,AXIS2_FAILURE); + + https_token->inclusion = inclusion; + printf("%s\n",https_token->inclusion); + + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_https_token_get_derivedkeys(rp_https_token_t *https_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FALSE); + + return https_token->derivedkeys; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_https_token_set_derivedkeys(rp_https_token_t *https_token, + const axis2_env_t *env, + axis2_bool_t derivedkeys) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,derivedkeys,AXIS2_FAILURE); + + https_token->derivedkeys = derivedkeys; + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_https_token_get_require_client_certificate(rp_https_token_t *https_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return https_token->require_client_certificate; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_https_token_set_require_client_certificate(rp_https_token_t *https_token, + const axis2_env_t *env, + axis2_bool_t require_client_certificate) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,require_client_certificate,AXIS2_FAILURE) + https_token->require_client_certificate = require_client_certificate; + + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/https_token.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/layout.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/layout.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/layout.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/layout.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,82 @@ +/* + * 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 + +struct rp_layout_t +{ + axis2_char_t *value; +}; + +AXIS2_EXTERN rp_layout_t *AXIS2_CALL +rp_layout_create(const axis2_env_t *env) +{ + rp_layout_t *layout = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + layout = (rp_layout_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_layout_t)); + + if(layout == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + layout->value = RP_LAYOUT_LAX; + return layout; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_layout_free(rp_layout_t *layout, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(layout) + { + AXIS2_FREE(env->allocator, layout); + layout = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_layout_get_value(rp_layout_t *layout, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return layout->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_layout_set_value(rp_layout_t *layout, + const axis2_env_t *env, + axis2_char_t *value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,value,AXIS2_FAILURE); + + layout->value = value; + return AXIS2_SUCCESS; +} + Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/layout.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/property.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/property.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/property.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/property.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,166 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include + + +struct rp_property_t +{ + int type; + void *value; +}; + + +AXIS2_EXTERN rp_property_t *AXIS2_CALL +rp_property_create(const axis2_env_t *env) +{ + rp_property_t *property = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + property = (rp_property_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_property_t)); + + if(property == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + property->type = 0; + property->value = NULL; + + return property; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_property_free( + rp_property_t *property, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(property) + { + if(property->value) + { + switch(property->type) + { + case RP_TOKEN_USERNAME: + rp_username_token_free((rp_username_token_t *)property->value,env); + property->value = NULL; + break; + + case RP_TOKEN_X509: + rp_x509_token_free((rp_x509_token_t *)property->value,env); + property->value = NULL; + break; + + case RP_TOKEN_SECURITY_CONTEXT: + rp_security_context_token_free((rp_security_context_token_t *)property->value,env); + property->value = NULL; + break; + + case RP_TOKEN_HTTPS: + rp_https_token_free((rp_https_token_t *)property->value,env); + property->value = NULL; + break; + + case RP_BINDING_SYMMETRIC: + rp_symmetric_binding_free((rp_symmetric_binding_t *)property->value,env); + property->value = NULL; + break; + + case RP_BINDING_ASYMMETRIC: + rp_asymmetric_binding_free((rp_asymmetric_binding_t *)property->value,env); + property->value = NULL; + break; + + case RP_BINDING_TRANSPORT: + rp_transport_binding_free((rp_transport_binding_t *)property->value,env); + property->value = NULL; + break; + + case RP_SUPPORTING_SIGNED_SUPPORTING: + rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value,env); + property->value = NULL; + break; + + case RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING: + rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value,env); + property->value = NULL; + break; + + case RP_WSS_WSS10: + rp_wss10_free((rp_wss10_t *)property->value,env); + property->value = NULL; + break; + + case RP_WSS_WSS11: + rp_wss11_free((rp_wss11_t *)property->value,env); + property->value = NULL; + break; + } + } + AXIS2_FREE(env->allocator,property); + } + + return AXIS2_SUCCESS; +} + + +/* Implementations */ +AXIS2_EXTERN void *AXIS2_CALL +rp_property_get_value( + rp_property_t *property, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return property->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_property_set_value(rp_property_t *property, + const axis2_env_t *env, + void *value, + int type) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,value,AXIS2_FAILURE); + + property->type = type; + property->value =(void *)value; + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN int AXIS2_CALL +rp_property_get_type( + rp_property_t *property, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return property->type; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/property.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/rampart_config.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/rampart_config.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/rampart_config.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/rampart_config.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,214 @@ +/* + * 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 + +struct rp_rampart_config_t +{ + axis2_char_t *user; + axis2_char_t *encryption_user; + axis2_char_t *password_callback_class; + axis2_char_t *authenticate_module; + rp_signature_crypto_t *signature_crypto; + rp_encryption_crypto_t *encryption_crypto; +}; + +AXIS2_EXTERN rp_rampart_config_t *AXIS2_CALL +rp_rampart_config_create(const axis2_env_t *env) +{ + rp_rampart_config_t *rampart_config = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + rampart_config = (rp_rampart_config_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_rampart_config_t)); + + if(rampart_config == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + rampart_config->user = NULL; + rampart_config->encryption_user = NULL; + rampart_config->password_callback_class = NULL; + rampart_config->signature_crypto = NULL; + rampart_config->encryption_crypto = NULL; + rampart_config->authenticate_module = NULL; + + return rampart_config; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_free(rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(rampart_config) + { + if(rampart_config->encryption_crypto) + { + rp_encryption_crypto_free(rampart_config->encryption_crypto,env); + rampart_config->encryption_crypto = NULL; + } + if(rampart_config->signature_crypto) + { + rp_signature_crypto_free(rampart_config->signature_crypto,env); + rampart_config->signature_crypto = NULL; + } + AXIS2_FREE(env->allocator,rampart_config); + rampart_config = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_rampart_config_get_user( + rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return rampart_config->user; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_set_user(rp_rampart_config_t *rampart_config, + const axis2_env_t *env, + axis2_char_t *user) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,user,AXIS2_FAILURE); + + rampart_config->user = user; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_rampart_config_get_encryption_user( + rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return rampart_config->encryption_user; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_set_encryption_user(rp_rampart_config_t *rampart_config, + const axis2_env_t *env, + axis2_char_t *encryption_user) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encryption_user,AXIS2_FAILURE); + + rampart_config->encryption_user = encryption_user; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_rampart_config_get_password_callback_class( + rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return rampart_config->password_callback_class; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_set_password_callback_class(rp_rampart_config_t *rampart_config, + const axis2_env_t *env, + axis2_char_t *password_callback_class) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,password_callback_class,AXIS2_FAILURE); + + rampart_config->password_callback_class = password_callback_class; + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_rampart_config_get_authenticate_module( + rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return rampart_config->authenticate_module; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_set_authenticate_module(rp_rampart_config_t *rampart_config, + const axis2_env_t *env, + axis2_char_t *authenticate_module) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,authenticate_module,AXIS2_FAILURE); + + rampart_config->authenticate_module = authenticate_module; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_signature_crypto_t *AXIS2_CALL +rp_rampart_config_get_signature_crypto( + rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return rampart_config->signature_crypto; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_set_signature_crypto(rp_rampart_config_t *rampart_config, + const axis2_env_t *env, + rp_signature_crypto_t *signature_crypto) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signature_crypto,AXIS2_FAILURE); + + rampart_config->signature_crypto = signature_crypto; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_encryption_crypto_t *AXIS2_CALL +rp_rampart_config_get_encryption_crypto( + rp_rampart_config_t *rampart_config, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return rampart_config->encryption_crypto; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_rampart_config_set_encryption_crypto(rp_rampart_config_t *rampart_config, + const axis2_env_t *env, + rp_encryption_crypto_t *encryption_crypto) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encryption_crypto,AXIS2_FAILURE); + + rampart_config->encryption_crypto = encryption_crypto; + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/rampart_config.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/secpolicy.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/secpolicy.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/secpolicy.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/secpolicy.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,394 @@ +/* + * 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 + +struct rp_secpolicy_t +{ + rp_property_t *binding; + rp_property_t *wss; + rp_supporting_tokens_t *supporting_tokens; + rp_supporting_tokens_t *signed_supporting_tokens; + rp_supporting_tokens_t *endorsing_supporting_tokens; + rp_supporting_tokens_t *signed_endorsing_supporting_tokens; + rp_signed_encrypted_parts_t *signed_parts; + rp_signed_encrypted_parts_t *encrypted_parts; + rp_signed_encrypted_elements_t *signed_elements; + rp_signed_encrypted_elements_t *encrypted_elements; + rp_rampart_config_t *rampart_config; + +}; + +AXIS2_EXTERN rp_secpolicy_t *AXIS2_CALL +rp_secpolicy_create(const axis2_env_t *env) +{ + rp_secpolicy_t *secpolicy = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + secpolicy = (rp_secpolicy_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_secpolicy_t)); + + if(secpolicy == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + secpolicy->binding = NULL; + secpolicy->wss = NULL; + secpolicy->supporting_tokens = NULL; + secpolicy->signed_supporting_tokens = NULL; + secpolicy->endorsing_supporting_tokens = NULL; + secpolicy->signed_endorsing_supporting_tokens = NULL; + secpolicy->signed_parts = NULL; + secpolicy->encrypted_parts = NULL; + secpolicy->signed_elements = NULL; + secpolicy->encrypted_elements = NULL; + secpolicy->rampart_config = NULL; + + return secpolicy; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_free( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(secpolicy) + { + if(secpolicy->binding) + { + rp_property_free(secpolicy->binding,env); + secpolicy->binding = NULL; + } + if(secpolicy->wss) + { + rp_property_free(secpolicy->wss,env); + secpolicy->wss = NULL; + } + if(secpolicy->supporting_tokens) + { + rp_supporting_tokens_free(secpolicy->supporting_tokens,env); + secpolicy->supporting_tokens = NULL; + } + if(secpolicy->signed_supporting_tokens) + { + rp_supporting_tokens_free(secpolicy->signed_supporting_tokens,env); + secpolicy->signed_supporting_tokens = NULL; + } + if(secpolicy->endorsing_supporting_tokens) + { + rp_supporting_tokens_free(secpolicy->endorsing_supporting_tokens,env); + secpolicy->endorsing_supporting_tokens = NULL; + } + if(secpolicy->signed_endorsing_supporting_tokens) + { + rp_supporting_tokens_free(secpolicy->signed_endorsing_supporting_tokens,env); + secpolicy->signed_endorsing_supporting_tokens = NULL; + } + if(secpolicy->signed_parts) + { + rp_signed_encrypted_parts_free(secpolicy->signed_parts,env); + secpolicy->signed_parts = NULL; + } + if(secpolicy->encrypted_parts) + { + rp_signed_encrypted_parts_free(secpolicy->encrypted_parts,env); + secpolicy->encrypted_parts = NULL; + } + if(secpolicy->signed_elements) + { + rp_signed_encrypted_elements_free(secpolicy->signed_elements,env); + secpolicy->signed_elements = NULL; + } + if(secpolicy->encrypted_elements) + { + rp_signed_encrypted_elements_free(secpolicy->encrypted_elements,env); + secpolicy->encrypted_elements = NULL; + } + if(secpolicy->rampart_config) + { + rp_rampart_config_free(secpolicy->rampart_config,env); + secpolicy->rampart_config = NULL; + } + AXIS2_FREE(env->allocator,secpolicy); + } + + return AXIS2_SUCCESS; +} + + +/* Implementations */ +AXIS2_EXTERN rp_property_t *AXIS2_CALL +rp_secpolicy_get_binding( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->binding; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_binding( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_property_t *binding) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,binding,AXIS2_FAILURE); + + secpolicy->binding = binding; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_supporting_tokens_t *supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,supporting_tokens,AXIS2_FAILURE); + + secpolicy->supporting_tokens = supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_secpolicy_get_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_signed_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_supporting_tokens_t *signed_supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_supporting_tokens,AXIS2_FAILURE); + + secpolicy->signed_supporting_tokens = signed_supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_secpolicy_get_signed_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->signed_supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_endorsing_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_supporting_tokens_t *endorsing_supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,endorsing_supporting_tokens,AXIS2_FAILURE); + + secpolicy->endorsing_supporting_tokens = endorsing_supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_secpolicy_get_endorsing_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->endorsing_supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_signed_endorsing_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_supporting_tokens_t *signed_endorsing_supporting_tokens) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_endorsing_supporting_tokens,AXIS2_FAILURE); + + secpolicy->signed_endorsing_supporting_tokens = signed_endorsing_supporting_tokens; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_secpolicy_get_signed_endorsing_supporting_tokens( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->signed_endorsing_supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_signed_parts( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_signed_encrypted_parts_t *signed_parts) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_parts,AXIS2_FAILURE); + secpolicy->signed_parts = signed_parts; + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL +rp_secpolicy_get_signed_parts( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->signed_parts; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_encrypted_parts( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_signed_encrypted_parts_t *encrypted_parts) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encrypted_parts,AXIS2_FAILURE); + + secpolicy->encrypted_parts = encrypted_parts; + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL +rp_secpolicy_get_encrypted_parts( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->encrypted_parts; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_signed_elements( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_signed_encrypted_elements_t *signed_elements) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_elements,AXIS2_FAILURE); + + secpolicy->signed_elements = signed_elements; + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL +rp_secpolicy_get_signed_elements( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->signed_elements; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_encrypted_elements( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_signed_encrypted_elements_t *encrypted_elements) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encrypted_elements,AXIS2_FAILURE); + + secpolicy->encrypted_elements = encrypted_elements; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL +rp_secpolicy_get_encrypted_elements( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->encrypted_elements; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_wss( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_property_t *wss) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,wss,AXIS2_FAILURE); + + secpolicy->wss = wss; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_property_t *AXIS2_CALL +rp_secpolicy_get_wss( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->wss; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_secpolicy_set_rampart_config( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env, + rp_rampart_config_t *rampart_config) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,rampart_config,AXIS2_FAILURE); + + secpolicy->rampart_config = rampart_config; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_rampart_config_t *AXIS2_CALL +rp_secpolicy_get_rampart_config( + rp_secpolicy_t *secpolicy, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return secpolicy->rampart_config; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/secpolicy.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/security_context_token.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/security_context_token.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/security_context_token.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/security_context_token.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,166 @@ +/* + * 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 + +struct rp_security_context_token_t +{ + axis2_char_t *inclusion; + axis2_bool_t derivedkeys; + axis2_bool_t require_external_uri_ref; + axis2_bool_t sc10_security_context_token; +}; + +AXIS2_EXTERN rp_security_context_token_t *AXIS2_CALL +rp_security_context_token_create(const axis2_env_t *env) +{ + rp_security_context_token_t *security_context_token = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + security_context_token = (rp_security_context_token_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_security_context_token_t)); + + if(security_context_token == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + security_context_token->inclusion = RP_INCLUDE_ALWAYS; + security_context_token->derivedkeys = AXIS2_FALSE; + security_context_token->require_external_uri_ref = AXIS2_FALSE; + security_context_token->sc10_security_context_token = AXIS2_FALSE; + + return security_context_token; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_security_context_token_free( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(security_context_token) + { + AXIS2_FREE(env->allocator, security_context_token); + security_context_token = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_security_context_token_get_inclusion( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return security_context_token->inclusion; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_security_context_token_set_inclusion( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env, + axis2_char_t *inclusion) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,inclusion,AXIS2_FAILURE); + + security_context_token->inclusion = inclusion; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_security_context_token_get_derivedkeys( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return security_context_token->derivedkeys; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_security_context_token_set_derivedkeys( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env, + axis2_bool_t derivedkeys) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,derivedkeys,AXIS2_FAILURE); + + security_context_token->derivedkeys = derivedkeys; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_security_context_token_get_require_external_uri_ref( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return security_context_token->require_external_uri_ref; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_security_context_token_set_require_external_uri_ref( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env, + axis2_bool_t require_external_uri_ref) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,require_external_uri_ref,AXIS2_FAILURE); + + security_context_token->require_external_uri_ref = + require_external_uri_ref; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_security_context_token_get_sc10_security_context_token( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return security_context_token->require_external_uri_ref; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_security_context_token_set_sc10_security_context_token( + rp_security_context_token_t *security_context_token, + const axis2_env_t *env, + axis2_bool_t sc10_security_context_token) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,sc10_security_context_token,AXIS2_FAILURE); + + security_context_token->sc10_security_context_token = + sc10_security_context_token; + + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/security_context_token.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/signature_crypto.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/signature_crypto.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/signature_crypto.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/signature_crypto.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,87 @@ +/* + * 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 + +struct rp_signature_crypto_t +{ + axis2_char_t *signature_prop_file; +}; + +AXIS2_EXTERN rp_signature_crypto_t *AXIS2_CALL +rp_signature_crypto_create(const axis2_env_t *env) +{ + rp_signature_crypto_t *signature_crypto = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + signature_crypto = (rp_signature_crypto_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_signature_crypto_t)); + + if(signature_crypto == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + signature_crypto->signature_prop_file = NULL; + + return signature_crypto; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signature_crypto_free( + rp_signature_crypto_t *signature_crypto, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(signature_crypto) + { + AXIS2_FREE(env->allocator, signature_crypto); + signature_crypto = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_signature_crypto_get_signature_prop_file( + rp_signature_crypto_t *signature_crypto, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signature_crypto->signature_prop_file; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signature_crypto_set_signature_prop_file( + rp_signature_crypto_t *signature_crypto, + const axis2_env_t *env, + axis2_char_t *signature_prop_file) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signature_prop_file,AXIS2_FAILURE); + + signature_crypto->signature_prop_file = signature_prop_file; + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/signature_crypto.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_elements.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_elements.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_elements.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_elements.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,161 @@ +/* + * 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 + +struct rp_signed_encrypted_elements_t +{ + axis2_bool_t signedelements; + axis2_array_list_t *xpath_expressions; + axis2_char_t *xpath_version; + +}; + +AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL +rp_signed_encrypted_elements_create(const axis2_env_t *env) +{ + rp_signed_encrypted_elements_t *signed_encrypted_elements = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + signed_encrypted_elements = (rp_signed_encrypted_elements_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_signed_encrypted_elements_t)); + + if(signed_encrypted_elements == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + signed_encrypted_elements->xpath_expressions = NULL; + + signed_encrypted_elements->xpath_expressions = axis2_array_list_create(env, 0); + if (!(signed_encrypted_elements->xpath_expressions)) + { + rp_signed_encrypted_elements_free(signed_encrypted_elements, env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + signed_encrypted_elements->xpath_version = NULL; + + return signed_encrypted_elements; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_elements_free(rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(signed_encrypted_elements) + { + + if(signed_encrypted_elements->xpath_expressions) + { + int i = 0; + for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(signed_encrypted_elements->xpath_expressions, + env); i++) + { + axis2_char_t *expression = NULL; + expression = (axis2_char_t *) + AXIS2_ARRAY_LIST_GET(signed_encrypted_elements->xpath_expressions,env, i); + if (expression) + AXIS2_FREE(env->allocator,expression); + + expression = NULL; + } + AXIS2_ARRAY_LIST_FREE(signed_encrypted_elements->xpath_expressions, env); + signed_encrypted_elements->xpath_expressions = NULL; + + } + AXIS2_FREE(env->allocator,signed_encrypted_elements); + signed_encrypted_elements = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_signed_encrypted_elements_get_signedelements(rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signed_encrypted_elements->signedelements; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_elements_set_signedelements(rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env, + axis2_bool_t signedelements) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signedelements,AXIS2_FAILURE); + + signed_encrypted_elements->signedelements = signedelements; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_array_list_t *AXIS2_CALL +rp_signed_encrypted_elements_get_xpath_expressions( + rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signed_encrypted_elements->xpath_expressions; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_elements_add_expression(rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env, + axis2_char_t *expression) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,expression,AXIS2_FAILURE); + + AXIS2_ARRAY_LIST_ADD(signed_encrypted_elements->xpath_expressions,env,expression); + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +rp_signed_encrypted_elements_get_xpath_version(rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signed_encrypted_elements->xpath_version; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_elements_set_xpath_version(rp_signed_encrypted_elements_t *signed_encrypted_elements, + const axis2_env_t *env, + axis2_char_t *xpath_version) +{ + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,xpath_version,AXIS2_FAILURE); + + signed_encrypted_elements->xpath_version = xpath_version; + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_elements.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_parts.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_parts.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_parts.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_parts.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,158 @@ +/* + * 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 + +struct rp_signed_encrypted_parts_t +{ + axis2_bool_t body; + axis2_bool_t signedparts; + axis2_array_list_t *headers; + +}; + +AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL +rp_signed_encrypted_parts_create(const axis2_env_t *env) +{ + rp_signed_encrypted_parts_t *signed_encrypted_parts = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + signed_encrypted_parts = (rp_signed_encrypted_parts_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_signed_encrypted_parts_t)); + + if(signed_encrypted_parts == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + signed_encrypted_parts->headers = NULL; + + signed_encrypted_parts->headers = axis2_array_list_create(env, 0); + if (!(signed_encrypted_parts->headers) ) + { + rp_signed_encrypted_parts_free(signed_encrypted_parts, env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + return signed_encrypted_parts; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_parts_free(rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(signed_encrypted_parts) + { + + if(signed_encrypted_parts->headers) + { + int i = 0; + for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(signed_encrypted_parts->headers, + env); i++) + { + rp_header_t *header = NULL; + header = (rp_header_t *) + AXIS2_ARRAY_LIST_GET(signed_encrypted_parts->headers,env, i); + if (header) + rp_header_free(header, env); + + header = NULL; + } + AXIS2_ARRAY_LIST_FREE(signed_encrypted_parts->headers, env); + signed_encrypted_parts->headers = NULL; + + } + AXIS2_FREE(env->allocator,signed_encrypted_parts); + signed_encrypted_parts = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_signed_encrypted_parts_get_body(rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signed_encrypted_parts->body; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_parts_set_body(rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env, + axis2_bool_t body) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,body,AXIS2_FAILURE); + signed_encrypted_parts->body = body; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +rp_signed_encrypted_parts_get_signedparts(rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signed_encrypted_parts->signedparts; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_parts_set_signedparts(rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env, + axis2_bool_t signedparts) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signedparts,AXIS2_FAILURE); + signed_encrypted_parts->signedparts = signedparts; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_array_list_t *AXIS2_CALL +rp_signed_encrypted_parts_get_headers( + rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return signed_encrypted_parts->headers; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_signed_encrypted_parts_add_header(rp_signed_encrypted_parts_t *signed_encrypted_parts, + const axis2_env_t *env, + rp_header_t *header) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,header,AXIS2_FAILURE); + + AXIS2_ARRAY_LIST_ADD(signed_encrypted_parts->headers,env,header); + return AXIS2_SUCCESS; +} + Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/signed_encrypted_parts.c ------------------------------------------------------------------------------ svn:executable = * Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/supporting_tokens.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/supporting_tokens.c?view=auto&rev=498596 ============================================================================== --- webservices/axis2/trunk/c/rampart/src/secpolicy/model/supporting_tokens.c (added) +++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/supporting_tokens.c Mon Jan 22 04:37:57 2007 @@ -0,0 +1,280 @@ +/* + * 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 + +struct rp_supporting_tokens_t +{ + rp_algorithmsuite_t *algorithmsuite; + axis2_array_list_t *tokens; + rp_signed_encrypted_elements_t *signed_elements; + rp_signed_encrypted_parts_t *signed_parts; + rp_signed_encrypted_elements_t *encrypted_elements; + rp_signed_encrypted_parts_t *encrypted_parts; + int type; +}; + +AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL +rp_supporting_tokens_create(const axis2_env_t *env) +{ + rp_supporting_tokens_t *supporting_tokens = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + supporting_tokens = (rp_supporting_tokens_t *) AXIS2_MALLOC (env->allocator, + sizeof (rp_supporting_tokens_t)); + + if(supporting_tokens == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + supporting_tokens->tokens = NULL; + supporting_tokens->tokens = axis2_array_list_create(env,0); + if (!(supporting_tokens->tokens)) + { + rp_supporting_tokens_free(supporting_tokens, env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + supporting_tokens->algorithmsuite = NULL; + supporting_tokens->signed_parts = NULL; + supporting_tokens->signed_elements = NULL; + supporting_tokens->encrypted_parts = NULL; + supporting_tokens->encrypted_elements = NULL; + supporting_tokens->type = 0; + return supporting_tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_free(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(supporting_tokens) + { + + if(supporting_tokens->tokens) + { + int i = 0; + for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(supporting_tokens->tokens, + env); i++) + { + rp_property_t *token = NULL; + token = (rp_property_t *) + AXIS2_ARRAY_LIST_GET(supporting_tokens->tokens,env, i); + if (token) + rp_property_free(token, env); + + token = NULL; + } + AXIS2_ARRAY_LIST_FREE(supporting_tokens->tokens, env); + supporting_tokens->tokens = NULL; + + } + if(supporting_tokens->algorithmsuite) + { + rp_algorithmsuite_free(supporting_tokens->algorithmsuite,env); + supporting_tokens->algorithmsuite = NULL; + } + if(supporting_tokens->signed_parts) + { + rp_signed_encrypted_parts_free(supporting_tokens->signed_parts,env); + supporting_tokens->signed_parts = NULL; + } + if(supporting_tokens->signed_elements) + { + rp_signed_encrypted_elements_free(supporting_tokens->signed_elements,env); + supporting_tokens->signed_elements = NULL; + } + if(supporting_tokens->encrypted_parts) + { + rp_signed_encrypted_parts_free(supporting_tokens->encrypted_parts,env); + supporting_tokens->encrypted_parts = NULL; + } + if(supporting_tokens->encrypted_elements) + { + rp_signed_encrypted_elements_free(supporting_tokens->encrypted_elements,env); + supporting_tokens->encrypted_elements = NULL; + } + AXIS2_FREE(env->allocator,supporting_tokens); + supporting_tokens = NULL; + } + return AXIS2_SUCCESS; +} + + +/* Implementations */ + +AXIS2_EXTERN axis2_array_list_t *AXIS2_CALL +rp_supporting_tokens_get_tokens( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return supporting_tokens->tokens; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_add_token(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + rp_property_t *token) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,token,AXIS2_FAILURE); + + AXIS2_ARRAY_LIST_ADD(supporting_tokens->tokens,env,token); + return AXIS2_SUCCESS; +} + + + +AXIS2_EXTERN rp_algorithmsuite_t *AXIS2_CALL +rp_supporting_tokens_get_algorithmsuite( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return supporting_tokens->algorithmsuite; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_set_algorithmsuite(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + rp_algorithmsuite_t *algorithmsuite) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,algorithmsuite,AXIS2_FAILURE); + + supporting_tokens->algorithmsuite = algorithmsuite; + return AXIS2_SUCCESS; +} + + +AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL +rp_supporting_tokens_get_signed_parts( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return supporting_tokens->signed_parts; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_set_signed_parts(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + rp_signed_encrypted_parts_t *signed_parts) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_parts,AXIS2_FAILURE); + + supporting_tokens->signed_parts = signed_parts; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL +rp_supporting_tokens_get_signed_elements( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return supporting_tokens->signed_elements; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_set_signed_elements(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + rp_signed_encrypted_elements_t *signed_elements) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,signed_elements,AXIS2_FAILURE); + + supporting_tokens->signed_elements = signed_elements; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL +rp_supporting_tokens_get_encrypted_parts( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return supporting_tokens->encrypted_parts; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_set_encrypted_parts(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + rp_signed_encrypted_parts_t *encrypted_parts) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encrypted_parts,AXIS2_FAILURE); + + supporting_tokens->encrypted_parts = encrypted_parts; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL +rp_supporting_tokens_get_encrypted_elements( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return supporting_tokens->encrypted_elements; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_set_encrypted_elements(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + rp_signed_encrypted_elements_t *encrypted_elements) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error,encrypted_elements,AXIS2_FAILURE); + + supporting_tokens->encrypted_elements = encrypted_elements; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN int AXIS2_CALL +rp_supporting_tokens_get_type( + rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return supporting_tokens->type; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +rp_supporting_tokens_set_type(rp_supporting_tokens_t *supporting_tokens, + const axis2_env_t *env, + int type) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + supporting_tokens->type = type; + return AXIS2_SUCCESS; +} Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/supporting_tokens.c ------------------------------------------------------------------------------ svn:executable = * --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org