Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Commiting the code attached in AXIS2C-168. Thanks Kaushalye
- Loading branch information
Damitha N.M. Kumarage
committed
Jun 13, 2006
1 parent
bab706a
commit d8f0c3c5fdf5bf8754e5654d0fd6290b9bc9772b
Showing
33 changed files
with
2,430 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
SUBDIRS = src | ||
SUBDIRS = src test samples | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
AWAIT : Timestamp token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2004,2005 The Apache Software Foundation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef RAMPART_CALLBACK_H | ||
#define RAMPART_CALLBACK_H | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
/** | ||
* Struct to get password using callbacks | ||
* @defgroup rampart_callback rampart callback | ||
* @ingroup rampart_util | ||
* @{ | ||
*/ | ||
|
||
/** Type name for struct rampart_callback_ops */ | ||
typedef struct rampart_callback_ops rampart_callback_ops_t; | ||
|
||
/** Type name for struct rampart_callback */ | ||
typedef struct rampart_callback rampart_callback_t; | ||
|
||
/** | ||
* Only operation get_password is to get the password | ||
* User should prvide a function pointer to this | ||
*/ | ||
AXIS2_DECLARE_DATA struct rampart_callback_ops | ||
{ | ||
axis2_char_t *(AXIS2_CALL* | ||
get_password)(rampart_callback_t *rcb, | ||
const axis2_env_t *env, const axis2_char_t *username); | ||
|
||
}; | ||
|
||
AXIS2_DECLARE_DATA struct rampart_callback | ||
{ | ||
rampart_callback_ops_t *ops; | ||
}; | ||
|
||
/** @} */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* RAMPART_CALLBACK_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2004,2005 The Apache Software Foundation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
#ifndef RAMPART_CONSTANTS_H | ||
#define RAMPART_CONSTANTS_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
/* rampart element names*/ | ||
#define RAMPART_SECURITY "Security" | ||
#define RAMPART_SECURITY_USERNAMETOKEN "UsernameToken" | ||
#define RAMPART_SECURITY_USERNAMETOKEN_USERNAME "Username" | ||
#define RAMPART_SECURITY_USERNAMETOKEN_PASSWORD "Password" | ||
#define RAMPART_SECURITY_USERNAMETOKEN_CREATED "Created" | ||
#define RAMPART_SECURITY_USERNAMETOKEN_NONCE "Nonce" | ||
#define RAMPART_SECURITY_USERNAMETOKEN_PASSWORD_ATTR_TYPE "Type" | ||
#define RAMPART_SECURITY_TIMESTAMP "Timestamp" | ||
#define RAMPART_SECURITY_TIMESTAMP_CREATED "Created" | ||
#define RAMPART_SECURITY_TIMESTAMP_EXPIRES "Expires" | ||
|
||
/*Rampart URIs*/ | ||
#define RAMPART_WSSE "wsse" | ||
#define RAMPART_WSSE_XMLNS "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" | ||
#define RAMPART_WSU "wsu" | ||
#define RAMPART_WSU_XMLNS "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" | ||
#define RAMPART_PASSWORD_DIGEST_URI "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest" | ||
|
||
/* Inflow outflow security parameter */ | ||
#define RAMPART_INFLOW_SECURITY "InflowSecurity" | ||
#define RAMPART_OUTFLOW_SECURITY "OutflowSecurity" | ||
#define RAMPART_ACTION "action" | ||
#define RAMPART_ACTION_ITEMS "items" | ||
#define RAMPART_USER "user" | ||
#define RAMPART_PASSWORD_TYPE "passwordType" | ||
#define RAMPART_PASSWORD_TEXT "passwordText" | ||
#define RAMPART_PASSWORD_DIGEST "passwordDigest" | ||
#define RAMPART_ACTION_ITEMS_USERNAMETOKEN "UsernameToken" | ||
#define RAMPART_ACTION_ITEMS_TIMESTAMP "Timestamp" | ||
#define RAMPART_ACTION_PW_CALLBACK_CLASS "passwordCallbackClass" | ||
|
||
/*Dynamically set values*/ | ||
#define RAMPART_DYN_PASSWORD "password" | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* RAMPART_CONSTANTS_H*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright 2003-2004 The Apache Software Foundation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include<openssl/sha.h> | ||
|
||
#include <axis2_utils_defines.h> | ||
#include <axis2_defines.h> | ||
#include <axis2_env.h> | ||
|
||
/** | ||
* @file rampart_crypto_util.h | ||
* @brief RAMPART-UTIL Crypto | ||
*/ | ||
#ifndef RAMPART_CRYPTO_UTIL | ||
#define RAMPART_CRYPTO_UTIL | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @defgroup Rampart_Crypto_Util | ||
* @ingroup Rampart_Util | ||
*/ | ||
|
||
|
||
/** | ||
* Calculate the hash of concatenated string of followings | ||
* @param nonce | ||
* @param created | ||
* @param password | ||
* @return calculated hash | ||
*/ | ||
AXIS2_EXTERN axis2_char_t *AXIS2_CALL | ||
rampart_crypto_sha1(const axis2_env_t *env, | ||
const axis2_char_t *nonce, | ||
const axis2_char_t *created, | ||
const axis2_char_t *password); | ||
|
||
|
||
/* @} */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* !RAMPART_CRYPTO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/** | ||
* Copyright 2004,2005 The Apache Software Foundation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
#include <axis2_handler_desc.h> | ||
#include <axis2_array_list.h> | ||
#include <axiom_soap_const.h> | ||
#include <axiom_soap_envelope.h> | ||
#include <axiom_soap_header.h> | ||
#include <axiom_soap_header_block.h> | ||
#include <axis2_op.h> | ||
#include <axis2_msg_ctx.h> | ||
#include <axis2_msg_info_headers.h> | ||
#include <axis2_property.h> | ||
#include <rampart/rampart_constants.h> | ||
|
||
|
||
|
||
#ifndef RAMPART_HANDLER_UTIL_H | ||
#define RAMPART_HANDLER_UTIL_H | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
|
||
/** | ||
* Get parameter for the given parameter name | ||
* @param env pointer to environment struct | ||
* @param msg_ctx message context | ||
* @param parameter the parameter name | ||
* @return parameter | ||
*/ | ||
|
||
AXIS2_EXTERN axis2_param_t* AXIS2_CALL | ||
rampart_get_security_param( const axis2_env_t *env, | ||
const axis2_msg_ctx_t *msg_ctx, | ||
const axis2_char_t *parameter); | ||
|
||
/** | ||
* Get actions specified in In/OutflowSecurity | ||
* @param env pointer to environment struct | ||
* @param ctx context | ||
* @param Outflowsecurity | ||
* @return parameters in an array list | ||
*/ | ||
AXIS2_EXTERN axis2_array_list_t* AXIS2_CALL | ||
rampart_get_actions( const axis2_env_t *env, | ||
const axis2_ctx_t *ctx, | ||
const axis2_param_t *param_x_flow_security); | ||
|
||
|
||
|
||
|
||
/** | ||
* Get the value of the action parameter given the key name | ||
* Here the key name means the name of the subelement of the | ||
* action element. | ||
* @param env pointer to environment struct | ||
* @param ctx context | ||
* @param param_action action parameter | ||
* @param key element name as a string | ||
* @return the value of the element | ||
*/ | ||
|
||
AXIS2_EXTERN axis2_char_t* AXIS2_CALL | ||
rampart_get_action_params( const axis2_env_t *env, | ||
const axis2_ctx_t *ctx, | ||
const axis2_param_t *param_action, | ||
const axis2_char_t *key); | ||
|
||
|
||
/** | ||
* Get the security token from the header block | ||
* @param env pointer to environment struct | ||
* @param msg_ctx message context | ||
* @param soap heamsg_ctxder | ||
* @return soap_header security element node | ||
*/ | ||
AXIS2_EXTERN axiom_node_t *AXIS2_CALL | ||
rampart_get_security_token(const axis2_env_t *env, | ||
const axis2_msg_ctx_t *msg_ctx, | ||
axiom_soap_header_t *soap_header); | ||
|
||
/** | ||
* Get password using callback | ||
* @param env pointer to environment struct | ||
* @return password | ||
*/ | ||
|
||
AXIS2_EXTERN axis2_char_t* AXIS2_CALL | ||
rampart_callback_pw( const axis2_env_t *env, | ||
const axis2_char_t *callback_module_name, | ||
const axis2_char_t *username); | ||
|
||
/** @} */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
|
||
#endif /*RAMPART_HANDLER_UTIL_H*/ |
Oops, something went wrong.