Author: milinda
Date: Mon Nov 5 21:15:14 2007
New Revision: 592283
URL: http://svn.apache.org/viewvc?rev=592283&view=rev
Log:
Add formatting changes.
Modified:
webservices/rampart/scratch/c/trust/include/trust_constants.h
webservices/rampart/scratch/c/trust/include/trust_data.h
webservices/rampart/scratch/c/trust/include/trust_policy_util.h
webservices/rampart/scratch/c/trust/include/trust_sts_client.h
webservices/rampart/scratch/c/trust/include/trust_util.h
webservices/rampart/scratch/c/trust/src/data.c
webservices/rampart/scratch/c/trust/src/policy_util.c
webservices/rampart/scratch/c/trust/src/sts_client.c
Modified: webservices/rampart/scratch/c/trust/include/trust_constants.h
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_constants.h?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_constants.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_constants.h Mon Nov 5
21:15:14 2007
@@ -39,46 +39,50 @@
#define TRUST_KEY_SIZE "KeySize"
#define TRUST_CLAIMS "Claims"
-#define TRUST_CLAIMS_DIALECT "Dialect"
+#define TRUST_CLAIMS_DIALECT "Dialect"
#define TRUST_ENTROPY "Entropy"
#define TRUST_BINARY_SECRET "BinarySecret"
-#define TRUST_LIFE_TIME "LifeTime"
+#define TRUST_LIFE_TIME "LifeTime"
#define TRUST_LIFE_TIME_CREATED "Created"
#define TRUST_LIFE_TIME_EXPIRES "Expires"
#define TRUST_REQUEST_SECURITY_TOKEN "RequestSecurityToken"
-#define TRUST_REQUESTED_SECURITY_TOKEN "RequestedSecurityToken"
+#define TRUST_REQUESTED_SECURITY_TOKEN "RequestedSecurityToken"
#define TRUST_REQUEST_SECURITY_TOKEN_RESPONSE "RequestSecurityTokenResponse"
-#define TRUST_REQUESTED_PROOF_TOKEN "RequestedProofToken"
+#define TRUST_REQUESTED_PROOF_TOKEN "RequestedProofToken"
#define TRUST_REQUEST_SECURITY_TOKEN_RESPONSE_COLLECTION
"RequestSecurityTokenResponseCollection"
#define TRUST_REQUESTED_TOKEN_CANCELED "RequestedTokenCancelled"
#define TRUST_COMPUTED_KEY_ALGO "ComputedKeyAlgorithm"
#define TRUST_COMPUTED_KEY "ComputedKey"
#define TRUST_REQUESTED_ATTACHED_REFERENCE "RequestedAttachedReference"
#define TRUST_REQUESTED_UNATTACHED_REFERENCE "RequestedUnattachedReference"
-#define TRUST_SECURITY_TOKEN_REFERENCE "SecurityTokenReference"
-#define TRUST_ENCRYPTED_DATA "EncryptedData"
+#define TRUST_SECURITY_TOKEN_REFERENCE "SecurityTokenReference"
+#define TRUST_ENCRYPTED_DATA "EncryptedData"
#define TRUST_REQUESTED_TOKEN_CANCELED "RequestedTokenCancelled"
#define TRUST_CANCEL_TARGET "CancelTarget"
#define TRUST_URI "URI"
-#define TRUST_EPR "EndpointReference"
+#define TRUST_EPR "EndpointReference"
#define TRUST_EPR_ADDRESS "Address"
#define TRUST_STR_REFERENCE "Reference"
/* Renewal Bindings */
-#define TRUST_RENEW_TARGET "RenewTarget"
-#define TRUST_ALLOW_POSTDATING "AllowPostdating"
-#define TRUST_RENEWING "Renewing"
-
-#define TRUST_RENEW_ALLOW_ATTR "Allow"
-#define TRUST_RENEW_OK_ATTR "OK"
-
+#define TRUST_RENEW_TARGET "RenewTarget"
+#define TRUST_ALLOW_POSTDATING "AllowPostdating"
+#define TRUST_RENEWING "Renewing"
+
+#define TRUST_RENEW_ALLOW_ATTR "Allow"
+#define TRUST_RENEW_OK_ATTR "OK"
+
+#define TRUST_VALIDATION_STATUS "Status"
+#define TRUST_VALIDATION_CODE "Code"
+#define TRUST_VALIDATION_REASON "Reason"
+
+#define TRUST_CANCEL_TARGET "CancelTarget"
- /* Cancel Bindings */
-#define ATTR_TYPE "Type"
+#define ATTR_TYPE "Type"
#define TRUST_BIN_SEC_TYPE_NONCE "/Nonce"
/* Request Types */
Modified: webservices/rampart/scratch/c/trust/include/trust_data.h
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_data.h?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_data.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_data.h Mon Nov 5
21:15:14 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -34,82 +35,95 @@
#include <axis2_addr.h>
#include <trust_constants.h>
-
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
typedef struct trust_data trust_data_t;
- AXIS2_EXPORT trust_data_t *AXIS2_CALL trust_data_create(
- const axutil_env_t * env,
- axis2_msg_ctx_t * in_msg_ctx);
-
- AXIS2_EXPORT void AXIS2_CALL trust_data_free(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_applies_to(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_request_context(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_request_type(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_applies_to(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_life_time(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_claims(
- trust_data_t *trust_data,
- axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_entorpy(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_token_type(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_entropy(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_char_t* AXIS2_CALL trust_data_get_request_type(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_char_t* AXIS2_CALL trust_data_get_soap_ns(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_char_t* AXIS2_CALL trust_data_get_wst_ns(
- trust_data_t *trust_data,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_data_process_key_type(
- trust_data_t * data,
- axutil_env_t * env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_data_process_key_size(
- trust_data_t * data,
- axutil_env_t * env);
-
+ AXIS2_EXPORT trust_data_t *AXIS2_CALL
+ trust_data_create(
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * in_msg_ctx);
+
+ AXIS2_EXPORT void AXIS2_CALL
+ trust_data_free(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_applies_to(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+
+ trust_data_process_request_context(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_request_type(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_applies_to(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_life_time(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_claims(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_entorpy(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_token_type(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_entropy(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_char_t *AXIS2_CALL
+ trust_data_get_request_type(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_char_t *AXIS2_CALL
+ trust_data_get_soap_ns(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_char_t *AXIS2_CALL
+ trust_data_get_wst_ns(
+ trust_data_t * trust_data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_key_type(
+ trust_data_t * data,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_data_process_key_size(
+ trust_data_t * data,
+ const axutil_env_t * env);
#ifdef __cplusplus
}
#endif
-#endif /*TRUST_DATA_H */
-
+#endif /*TRUST_DATA_H */
Modified: webservices/rampart/scratch/c/trust/include/trust_policy_util.h
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_policy_util.h?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_policy_util.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_policy_util.h Mon Nov 5
21:15:14 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -25,24 +26,29 @@
#include <rp_secpolicy_builder.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
- AXIS2_EXPORT rp_algorithmsuite_t* AXIS2_CALL
trust_policy_util_get_algorithmsuite(
- const axutil_env_t *env,
- neethi_policy_t *policy);
-
- AXIS2_EXPORT rp_binding_commons_t* AXIS2_CALL
trust_policy_util_get_binding_commons(
- const axutil_env_t *env,
- rp_secpolicy_t *secpolicy);
-
- AXIS2_EXPORT rp_trust10_t* AXIS2_CALL trust_policy_util_get_trust10(
- const axutil_env_t *env,
- neethi_policy_t *policy);
+ AXIS2_EXPORT rp_algorithmsuite_t *AXIS2_CALL
+
+ trust_policy_util_get_algorithmsuite(
+ const axutil_env_t * env,
+ neethi_policy_t * policy);
+
+ AXIS2_EXPORT rp_binding_commons_t *AXIS2_CALL
+
+ trust_policy_util_get_binding_commons(
+ const axutil_env_t * env,
+ rp_secpolicy_t * secpolicy);
+
+ AXIS2_EXPORT rp_trust10_t *AXIS2_CALL
+ trust_policy_util_get_trust10(
+ const axutil_env_t * env,
+ neethi_policy_t * policy);
#ifdef __cplusplus
}
#endif
-#endif /* _TRUST_POLICY_UTIL_H */
-
+#endif /* _TRUST_POLICY_UTIL_H */
Modified: webservices/rampart/scratch/c/trust/include/trust_sts_client.h
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_sts_client.h?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_sts_client.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_sts_client.h Mon Nov 5
21:15:14 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -27,7 +28,7 @@
#include <stdlib.h>
#include <axiom.h>
#include <axutil_utils.h>
-#include <axis2_client.h>
+#include <axis2_client.h>
#include <rp_includes.h>
#include <rp_secpolicy.h>
#include <neethi_policy.h>
@@ -39,91 +40,72 @@
#include <trust_token.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
typedef struct trust_sts_client trust_sts_client_t;
- AXIS2_EXPORT trust_sts_client_t* AXIS2_CALL trust_sts_client_create(
- const axutil_env_t *env);
-
- AXIS2_EXPORT void AXIS2_CALL trust_sts_client_free(
- trust_sts_client_t* sts_client,
- const axutil_env_t *env);
-
- AXIS2_EXPORT void AXIS2_CALL trust_sts_client_request_security_token(
- trust_sts_client_t *sts_client,
- const axutil_env_t *env,
- axis2_char_t *applies_to,
- axis2_char_t *token_type);
-
- AXIS2_EXPORT axiom_node_t* AXIS2_CALL
trust_sts_client_create_issue_request(
- trust_sts_client_t* sts_client,
- const axutil_env_t *env,
- const axis2_char_t *request_type,
- const axis2_char_t *applies_to,
- const axis2_char_t *token_type);
- AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_sts_client_process_policies(
- trust_sts_client_t *sts_client,
- const axutil_env_t *env,
- neethi_policy_t *issuer_policy,
- neethi_policy_t *service_policy);
-
- AXIS2_EXPORT axis2_svc_client_t* AXIS2_CALL
trust_sts_client_get_svc_client(
- trust_sts_client_t *sts_client,
- const axutil_env_t *env,
- axis2_char_t *action);
-
- AXIS2_EXPORT trust_token_t* AXIS2_CALL
trust_sts_client_process_issue_response(
- trust_sts_client_t* sts_client,
+ AXIS2_EXPORT trust_sts_client_t *AXIS2_CALL
+ trust_sts_client_create(
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT void AXIS2_CALL
+ trust_sts_client_free(
+ trust_sts_client_t * sts_client,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT void AXIS2_CALL
+ trust_sts_client_request_security_token(
+ trust_sts_client_t * sts_client,
+ const axutil_env_t * env,
+ axis2_char_t * applies_to,
+ axis2_char_t * token_type);
+
+ AXIS2_EXPORT axiom_node_t *AXIS2_CALL
+ trust_sts_client_create_issue_request(
+ trust_sts_client_t * sts_client,
+ const axutil_env_t * env,
+ axis2_char_t * request_type,
+ axis2_char_t * applies_to,
+ axis2_char_t * token_type);
+
+ AXIS2_EXPORT axis2_status_t AXIS2_CALL
+ trust_sts_client_process_policies(
+ trust_sts_client_t * sts_client,
+ const axutil_env_t * env,
+ neethi_policy_t * issuer_policy,
+ neethi_policy_t * service_policy);
+
+ AXIS2_EXPORT axis2_svc_client_t *AXIS2_CALL
+ trust_sts_client_get_svc_client(
+ trust_sts_client_t * sts_client,
+ const axutil_env_t * env,
+ axis2_char_t * action);
+
+ AXIS2_EXPORT trust_token_t *AXIS2_CALL
+ trust_sts_client_process_issue_response(
+ trust_sts_client_t * sts_client,
int version,
- axiom_node_t* response_node,
- axiom_node_t* payload_sent,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_char_t* AXIS2_CALL trust_sts_client_find_identifier(
- trust_sts_client_t* sts_client,
- axiom_node_t* req_att_ref_node,
- axiom_node_t* req_unatt_ref_node,
- axiom_node_t* sec_token_node,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_char_t* AXIS2_CALL trust_sts_client_get_id_from_str(
- trust_sts_client_t* sts_client,
- axiom_node_t* ref_node,
- const axutil_env_t *env);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_sts_client_set_issuer_policy_location(
- trust_sts_client_t * sts_client,
- const axutil_env_t * env,
- axis2_char_t * file_path);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_sts_client_set_ttl(
- trust_sts_client_t * sts_client,
- const axutil_env_t * env,
- int ttl);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_sts_client_set_service_policy_location(
- trust_sts_client_t * sts_client,
- const axutil_env_t * env,
- axis2_char_t * file_path);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_sts_client_set_home_dir(
- trust_sts_client_t * sts_client,
- const axutil_env_t * env,
- axis2_char_t * directory);
-
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_sts_client_set_issuer_address(
- trust_sts_client_t * sts_client,
- const axutil_env_t * env,
- axis2_char_t * address);
+ axiom_node_t * response_node,
+ axiom_node_t * payload_sent,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_char_t *AXIS2_CALL
+ trust_sts_client_find_identifier(
+ trust_sts_client_t * sts_client,
+ axiom_node_t * req_att_ref_node,
+ axiom_node_t * req_unatt_ref_node,
+ axiom_node_t * sec_token_node,
+ const axutil_env_t * env);
+
+ AXIS2_EXPORT axis2_char_t *AXIS2_CALL
+ trust_sts_client_get_id_from_str(
+ trust_sts_client_t * sts_client,
+ axiom_node_t * ref_node,
+ const axutil_env_t * env);
#ifdef __cplusplus
}
#endif
-#endif /*TRUST_STS_CLIENT_H */
+#endif /*TRUST_STS_CLIENT_H */
Modified: webservices/rampart/scratch/c/trust/include/trust_util.h
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_util.h?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_util.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_util.h Mon Nov 5
21:15:14 2007
@@ -37,6 +37,18 @@
{
#endif
+ typedef enum
+ {
+ TRUST_ALLOW = 0,
+ TRUST_NOT_ALLOW
+ } trust_allow_t;
+
+ typedef enum
+ {
+ TRUST_OK = 0,
+ TRUST_NOT_OK
+ } trust_ok_t;
+
/**
* Create the RST Element for Issuance binding.
* <wst:RequestSecurityToken>
@@ -116,12 +128,11 @@
const axutil_env_t * env,
int wst_version,
axiom_node_t * parent_node,
- axis2_char_t *token_type);
+ axis2_char_t * token_type);
-
/**
* Create the AppliesTo Element for Issuance binding.
- * AppliesTo element Specifies the scope for which the security token is
desired.
+ * AppliesTo element Specifies the scope for which the security token is
desired.
* Same as TokenType. AppliesTo is higher in precedence than TokenType
* <wsp:AppliesTo>
* <wsa:EndpointReference>
@@ -133,7 +144,7 @@
* @param parent_node parent axiom node
* @param token_type string representing token type
* @returns TokenType axiom node, NULL if error ocurred.
- */
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
trust_util_create_applies_to_element(
const axutil_env_t * env,
@@ -150,10 +161,10 @@
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
trust_util_create_claims_element(
const axutil_env_t * env,
+ int wst_version,
axiom_node_t * parent_node,
- axis2_char_t * claims_val,
- axis2_char_t * dialect_uri,
- int version);
+ axiom_node_t * claims_content,
+ axis2_char_t * dialect_uri);
/**
* Create the RequestedSecurityToken Element for Issuance binding.
@@ -214,16 +225,16 @@
int wst_version,
axiom_node_t * parent_node);
- /**
- * Create BinarySecret element. This contains base64 encoded binary secret
or key.
- * And also contain @Type attribute.
- * @param env pointer to environment struct
- * @param wst_version integer representing wst version
- * @param parent_node pointer to parent axiom node
- * @param enc_secret string representing encoded secret
- * @param bin_sec_type Type of the binary secret
- * @returns BinarySecret element or NULL if error occurred.
- */
+ /**
+ * Create BinarySecret element. This contains base64 encoded binary
secret or key.
+ * And also contain @Type attribute.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @param enc_secret string representing encoded secret
+ * @param bin_sec_type Type of the binary secret
+ * @returns BinarySecret element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
trust_util_create_binary_secret_element(
const axutil_env_t * env,
@@ -232,23 +243,23 @@
axis2_char_t * enc_secret,
axis2_char_t * bin_sec_type);
- /**
- * Create ComputedKeyAlgorithm element.
- * @param env pointer to environment struct
- * @param wst_version integer representing wst version
- * @param parent_node pointer to parent axiom node
- * @param algo_id Algorithm identifier
- * @returns ComputedKeyAlgorithm element or NULL if error occurred.
- */
+ /**
+ * Create ComputedKeyAlgorithm element.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @param algo_id Algorithm identifier
+ * @returns ComputedKeyAlgorithm element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
trust_util_create_computed_key_algo_element(
const axutil_env_t * env,
- const int version,
+ int wst_version,
axiom_node_t * parent_node,
- const axis2_char_t * algo_id);
+ axis2_char_t * algo_id);
- /**
- * Create KeySize element.
+ /**
+ * Create KeySize element.
* @param env pointer to environment struct
* @param wst_version integer representing wst version
* @param parent_node pointer to parent axiom node
@@ -262,8 +273,8 @@
axiom_node_t * parent_node,
axis2_char_t * key_size);
- /**
- * Create KeyType element.
+ /**
+ * Create KeyType element.
* @param env pointer to environment struct
* @param wst_version integer representing wst version
* @param parent_node pointer to parent axiom node
@@ -277,8 +288,8 @@
axiom_node_t * parent_node,
axis2_char_t * key_type);
- /**
- * Create LifeTime element.
+ /**
+ * Create LifeTime element.
*
* @param env pointer to environment struct
* @param wst_version integer representing wst version
@@ -291,9 +302,9 @@
axiom_node_t * parent_node,
int wst_version,
int ttl);
-
- /**
- * Create RequestedAttachedReference element.
+
+ /**
+ * Create RequestedAttachedReference element.
* @param env pointer to environment struct
* @param wst_version integer representing wst version
* @param parent_node pointer to parent axiom node
@@ -304,9 +315,9 @@
const axutil_env_t * env,
int wst_version,
axiom_node_t * parent_node);
-
- /**
- * Create RequestedUnAttachedReference element.
+
+ /**
+ * Create RequestedUnAttachedReference element.
* @param env pointer to environment struct
* @param wst_version integer representing wst version
* @param parent_node pointer to parent axiom node
@@ -316,10 +327,10 @@
trust_util_create_req_unattached_reference_element(
const axutil_env_t * env,
const int version,
- axiom_node_t * parent_node)
-
- /**
- * Create EncryptedData element.
+ axiom_node_t * parent_node);
+
+ /**
+ * Create EncryptedData element.
* @param env pointer to environment struct
* @param wst_version integer representing wst version
* @param parent_node pointer to parent axiom node
@@ -333,153 +344,92 @@
axiom_node_t * parent_node,
axis2_char_t * enc_data);
- /* Renewal Bindings */
-
/**
- * RenewTarget :Contains the Security Token or the STR pointing to the
token
- * to be renewed
- **/
+ * Create RenewTarget element.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @param token_renew_pending_node
+ * @returns RenewTarget element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
trust_util_create_renew_traget_element(
const axutil_env_t * env,
+ int wst_version,
axiom_node_t * parent_node,
- axiom_node_t * token_renew_pending_node,
- const int version);
+ axiom_node_t * token_renew_pending_node);
/**
- * AllowPostdating :This allows that the token to be issued that are not
immediately
- * valid (i.e. valid from next day etc.)
- * Empty Element with no attributes.
- **/
+ * Create AllowPostdating element.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @returns AllowPostdating element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
trust_util_create_allow_postdating_element(
const axutil_env_t * env,
- axiom_node_t * parent_node,
- const int version);
+ int wst_version,
+ axiom_node_t * parent_node);
/**
- * Renewing :Used to specify the renew semantics for types that
support
- * this operation
- * @Allow :Boolean Attribute that is used to request a renewable token
- * @OK :Boolean Operation (if true: then tokens can be renewed
after the expiration:(false -dafault)
- **/
+ * Create Renewing element.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @param allow_flag
+ * @param ok_flag
+ * @returns Renewing element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
trust_util_create_renewing_element(
const axutil_env_t * env,
+ int wst_version,
axiom_node_t * parent_node,
- int allow_flag,
- int ok_flag,
- const int version);
-
- /* Cancal Bindings */
-
- /* Validation Bindings */
-
- /* RSTR Specific operations */
-
- /**
- *RequstedAttachedReference :This element indicate how to refer to the
returned token when
- * the token doesn't
support refering through XML ID.
- *STR : <wsse:SecurityTokenReference> can be used to reference the token
- **/
- AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
- trust_util_create_req_attached_reference_element(
- const axutil_env_t * env,
- const int version,
- axiom_node_t * parent_node);
-
- /**
- *RequstedUnattachedReference :This element indicate how to refer to the
returned token when
- * the token is not in
the message.
- *STR : <wsse:SecurityTokenReference> can be used to reference the token
which is not in
- * the
message itself
- **/
- AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
- trust_util_create_req_unattached_reference_element(
- const axutil_env_t * env,
- const int version,
- axiom_node_t * parent_node);
+ trust_allow_t allow_flag,
+ trust_ok_t ok_flag);
/**
- *wsse:SecurityTokenReference (STR) : Can be used to reference the
security token
- * when it is
inside the security headers or other uri
- **/
+ * Create CancelTarget element.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @param token_cancel_pending_node
+ * @returns CancelTarget element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
- trust_util_create_security_token_reference_element(
+ trust_util_create_cancel_target_element(
const axutil_env_t * env,
- const int version,
+ int wst_version,
axiom_node_t * parent_node,
- axis2_char_t * token_ref);
+ axiom_node_t * token_cancel_pending_node);
/**
- *xenc:EncryptedData : Used when an encrypted key is using <unlike binary
secret>
- *
- **/
- AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
- trust_util_create_encrypted_data_element(
- const axutil_env_t * env,
- const int version,
- axiom_node_t * parent_node,
- axis2_char_t * enc_data);
-
- AXIS2_EXPORT axiom_node_t *AXIS2_CALL
- trust_util_create_attribute(
- const axutil_env_t * env,
- axiom_node_t * node,
- const int version,
- axis2_char_t * local_name,
- axis2_char_t * value,
- axiom_namespace_t * ns);
-
- /* Internal Operation */
-
- /* create generic axiom nodes - internal */
- AXIS2_EXPORT axiom_node_t *AXIS2_CALL
- trust_util_create_om_node(
- const axutil_env_t * env,
- axiom_node_t * parent_node,
- const axis2_char_t * ns,
- const axis2_char_t * ln,
- const axis2_char_t * prefix);
-
+ * Create Status element for validation response.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @param parent_node pointer to parent axiom node
+ * @param token_cancel_pending_node
+ * @returns Status element or NULL if error occurred.
+ */
AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
- trust_util_create_om_node_with_text(
+ trust_util_create_validation_response_element(
const axutil_env_t * env,
axiom_node_t * parent_node,
- const axis2_char_t * ns,
- const axis2_char_t * ln,
- const axis2_char_t * prefix,
- const axis2_char_t * text);
-
- /* Set text of the created Nodes */
- AXIS2_EXPORT axis2_status_t AXIS2_CALL
- trust_util_set_node_text(
- const axutil_env_t * env,
- axiom_node_t * om_node,
- axis2_char_t * text);
-
- /* Get child with its local name, NS and Prefix */
- AXIS2_EXPORT axiom_node_t *AXIS2_CALL
-
- trust_util_get_first_child_with_qname(
- const axutil_env_t * env,
- axiom_node_t * om_node,
- axis2_char_t * local_name,
- axis2_char_t * ns_uri,
- axis2_char_t * prefix);
+ int wst_version,
+ axis2_char_t * code,
+ axis2_char_t * reason);
- /* Get NS based on the version */
+ /**
+ * Returns the namespace uri of WST according to the version.
+ * @param env pointer to environment struct
+ * @param wst_version integer representing wst version
+ * @returns namespace uri according to version.
+ */
AXIS2_EXPORT axis2_char_t *AXIS2_CALL
trust_util_get_wst_ns(
const axutil_env_t * env,
- const int version);
+ int wst_version);
#ifdef __cplusplus
}
Modified: webservices/rampart/scratch/c/trust/src/data.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/data.c?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/src/data.c (original)
+++ webservices/rampart/scratch/c/trust/src/data.c Mon Nov 5 21:15:14 2007
@@ -81,8 +81,8 @@
axiom_namespace_t *soap_ns = NULL;
axiom_namespace_t *wst_ns = NULL;
axiom_element_t *rst_ele = NULL;
- trust_data_t *trust_data = NULL;
+ trust_data_t *trust_data = NULL;
trust_data = (trust_data_t *) AXIS2_MALLOC(env->allocator,
sizeof(trust_data_t));
// Processing Message Context
@@ -97,7 +97,9 @@
// Processing WS-Trust namespace
rst_ele = (axiom_element_t *)
axiom_node_get_data_element(trust_data->rst_node, env);
wst_ns = axiom_element_get_namespace(rst_ele, env, trust_data->rst_node);
+
trust_data->wst_namespace = axiom_namespace_get_uri(wst_ns, env);
+
trust_data_process_request_context(trust_data, env);
trust_data_process_request_type(trust_data, env);
trust_data_process_token_type(trust_data, env);
@@ -140,6 +142,8 @@
axiom_element_t *addr_ele = NULL;
axiom_namespace_t *addr_namespace = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
rst_node = trust_data->rst_node;
rst_ele = (axiom_element_t *) (axiom_node_get_data_element(rst_node, env));
@@ -176,6 +180,7 @@
AXIS2_FREE(env->allocator, applies_to_qname);
return AXIS2_FAILURE;
}
+
}
else
{
@@ -259,8 +264,10 @@
axutil_qname_t *token_type_qname = NULL;
rst_ele = (axiom_element_t *)
(axiom_node_get_data_element(trust_data->rst_node, env));
+
token_type_qname =
axutil_qname_create(env, TRUST_TOKEN_TYPE, trust_data->wst_namespace,
TRUST_WST);
+
token_type_ele =
axiom_element_get_first_child_with_qname(rst_ele, env,
token_type_qname,
trust_data->rst_node,
&token_type_node);
@@ -269,7 +276,9 @@
AXIS2_FREE(env->allocator, token_type_qname);
return AXIS2_FAILURE;
}
+
trust_data->token_type = axiom_element_get_text(token_type_ele, env,
token_type_node);
+
AXIS2_FREE(env->allocator, token_type_qname);
return AXIS2_SUCCESS;
}
@@ -284,10 +293,14 @@
axiom_element_t *rst_ele = NULL;
axutil_qname_t *claims_qname = NULL;
axutil_qname_t *attr_dialect_qname = NULL;
- axis2_char_t *dialect = NULL;
+ axis2_char_t *dialect = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
rst_ele = (axiom_element_t *)
(axiom_node_get_data_element(trust_data->rst_node, env));
+
claims_qname = axutil_qname_create(env, TRUST_CLAIMS,
trust_data->wst_namespace, TRUST_WST);
+
claims_ele =
axiom_element_get_first_child_with_qname(rst_ele, env, claims_qname,
trust_data->rst_node,
&claims_node);
@@ -296,7 +309,9 @@
AXIS2_FREE(env->allocator, claims_qname);
return AXIS2_FAILURE;
}
+
trust_data->claims_node = claims_node;
+
attr_dialect_qname =
axutil_qname_create(env, TRUST_CLAIMS_DIALECT,
trust_data->wst_namespace, TRUST_WST);
if (!attr_dialect_qname)
@@ -304,7 +319,9 @@
AXIS2_FREE(env->allocator, claims_qname);
return AXIS2_FAILURE;
}
+
dialect = axiom_element_get_attribute_value(claims_ele, env,
attr_dialect_qname);
+
if (!dialect)
{
AXIS2_FREE(env->allocator, claims_qname);
@@ -312,6 +329,7 @@
return AXIS2_FAILURE;
}
trust_data->claims_dialect = dialect;
+
AXIS2_FREE(env->allocator, claims_qname);
AXIS2_FREE(env->allocator, attr_dialect_qname);
return AXIS2_SUCCESS;
@@ -329,10 +347,14 @@
axiom_element_t *rst_ele = NULL;
axiom_element_t *binary_secret_ele = NULL;
axutil_qname_t *entropy_qname = NULL;
- axis2_char_t *bin_sec_str = NULL;
+ axis2_char_t *bin_sec_str = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
rst_ele = (axiom_element_t *)
(axiom_node_get_data_element(trust_data->rst_node, env));
+
entropy_qname = axutil_qname_create(env, TRUST_ENTROPY,
trust_data->wst_namespace, TRUST_WST);
+
entropy_ele =
axiom_element_get_first_child_with_qname(rst_ele, env, entropy_qname,
trust_data->rst_node,
&entropy_node);
@@ -341,6 +363,7 @@
AXIS2_FREE(env->allocator, entropy_qname);
return AXIS2_FAILURE;
}
+
binary_secret_ele =
axiom_element_get_first_element(entropy_ele, env, entropy_node,
&binary_secret_node);
bin_sec_str = axiom_element_get_text(binary_secret_ele, env,
binary_secret_node);
@@ -354,21 +377,26 @@
AXIS2_FREE(env->allocator, entropy_qname);
return AXIS2_FAILURE;
}
+
return AXIS2_SUCCESS;
}
AXIS2_EXPORT axis2_status_t AXIS2_CALL
trust_data_process_key_type(
trust_data_t * data,
- axutil_env_t * env)
+ const axutil_env_t * env)
{
axiom_node_t *key_type_node = NULL;
axiom_element_t *key_type_ele = NULL;
axiom_element_t *rst_ele = NULL;
- axutil_qname_t *key_type_qname = NULL;
+ axutil_qname_t *key_type_qname = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
rst_ele = (axiom_element_t *) (axiom_node_get_data_element(data->rst_node,
env));
+
key_type_qname = axutil_qname_create(env, TRUST_KEY_TYPE,
data->wst_namespace, TRUST_WST);
+
key_type_ele =
axiom_element_get_first_child_with_qname(rst_ele, env, key_type_qname,
data->rst_node,
&key_type_node);
@@ -377,7 +405,9 @@
AXIS2_FREE(env->allocator, key_type_qname);
return AXIS2_FAILURE;
}
+
data->key_type = axiom_element_get_text(key_type_ele, env, key_type_node);
+
AXIS2_FREE(env->allocator, key_type_qname);
return AXIS2_SUCCESS;
}
@@ -385,7 +415,7 @@
AXIS2_EXPORT axis2_status_t AXIS2_CALL
trust_data_process_key_size(
trust_data_t * data,
- axutil_env_t * env)
+ const axutil_env_t * env)
{
axiom_node_t *key_size_node = NULL;
axiom_element_t *key_size_ele = NULL;
@@ -393,8 +423,12 @@
axutil_qname_t *key_size_qname = NULL;
axis2_char_t *size_str = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
rst_ele = (axiom_element_t *) (axiom_node_get_data_element(data->rst_node,
env));
+
key_size_qname = axutil_qname_create(env, TRUST_KEY_SIZE,
data->wst_namespace, TRUST_WST);
+
key_size_ele =
axiom_element_get_first_child_with_qname(rst_ele, env, key_size_qname,
data->rst_node,
&key_size_node);
@@ -403,12 +437,15 @@
AXIS2_FREE(env->allocator, key_size_qname);
return AXIS2_FAILURE;
}
+
size_str = axiom_element_get_text(key_size_ele, env, key_size_node);
+
if (!size_str)
{
AXIS2_FREE(env->allocator, key_size_qname);
return AXIS2_FAILURE;
}
+
data->key_size = atoi(size_str);
AXIS2_FREE(env->allocator, key_size_qname);
return AXIS2_SUCCESS;
@@ -420,6 +457,7 @@
const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
return trust_data->request_type;
}
@@ -429,5 +467,6 @@
const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
return trust_data->wst_namespace;
-}
\ No newline at end of file
+}
Modified: webservices/rampart/scratch/c/trust/src/policy_util.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/policy_util.c?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/src/policy_util.c (original)
+++ webservices/rampart/scratch/c/trust/src/policy_util.c Mon Nov 5 21:15:14
2007
@@ -16,89 +16,94 @@
*/
#include <trust_policy_util.h>
-AXIS2_EXPORT rp_algorithmsuite_t* AXIS2_CALL
trust_policy_util_get_algorithmsuite(
- const axutil_env_t *env,
- neethi_policy_t *policy)
+AXIS2_EXPORT rp_algorithmsuite_t *AXIS2_CALL
+trust_policy_util_get_algorithmsuite(
+ const axutil_env_t * env,
+ neethi_policy_t * policy)
{
rp_secpolicy_t *secpolicy = NULL;
rp_binding_commons_t *binding_commons = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
secpolicy = rp_secpolicy_builder_build(env, policy);
- if(!secpolicy)
+ if (!secpolicy)
{
return NULL;
}
-
+
binding_commons = trust_policy_util_get_binding_commons(env, secpolicy);
-
- return rp_binding_commons_get_algorithmsuite(binding_commons,env);
+
+ return rp_binding_commons_get_algorithmsuite(binding_commons, env);
}
-AXIS2_EXPORT rp_trust10_t* AXIS2_CALL trust_policy_util_get_trust10(
- const axutil_env_t *env,
- neethi_policy_t *policy)
+AXIS2_EXPORT rp_trust10_t *AXIS2_CALL
+trust_policy_util_get_trust10(
+ const axutil_env_t * env,
+ neethi_policy_t * policy)
{
rp_secpolicy_t *secpolicy = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
secpolicy = rp_secpolicy_builder_build(env, policy);
- if(!secpolicy)
+ if (!secpolicy)
{
return NULL;
}
-
+
return rp_secpolicy_get_trust10(secpolicy, env);
}
-AXIS2_EXPORT rp_binding_commons_t* AXIS2_CALL
trust_policy_util_get_binding_commons(
- const axutil_env_t *env,
- rp_secpolicy_t *secpolicy)
+AXIS2_EXPORT rp_binding_commons_t *AXIS2_CALL
+trust_policy_util_get_binding_commons(
+ const axutil_env_t * env,
+ rp_secpolicy_t * secpolicy)
{
rp_property_t *property = NULL;
- property = rp_secpolicy_get_binding(secpolicy,env);
- if(!property)
+ property = rp_secpolicy_get_binding(secpolicy, env);
+ if (!property)
return NULL;
- if(rp_property_get_type(property,env) == RP_PROPERTY_ASYMMETRIC_BINDING)
+ if (rp_property_get_type(property, env) == RP_PROPERTY_ASYMMETRIC_BINDING)
{
rp_asymmetric_binding_t *asymmetric_binding = NULL;
rp_symmetric_asymmetric_binding_commons_t *sym_asym_commons = NULL;
- asymmetric_binding =
(rp_asymmetric_binding_t*)rp_property_get_value(property, env);
- if(!asymmetric_binding)
+ asymmetric_binding = (rp_asymmetric_binding_t *)
rp_property_get_value(property, env);
+ if (!asymmetric_binding)
return NULL;
- sym_asym_commons =
rp_asymmetric_binding_get_symmetric_asymmetric_binding_commons(asymmetric_binding,env);
- if(!sym_asym_commons)
+ sym_asym_commons =
+
rp_asymmetric_binding_get_symmetric_asymmetric_binding_commons(asymmetric_binding,
env);
+ if (!sym_asym_commons)
return NULL;
- return
rp_symmetric_asymmetric_binding_commons_get_binding_commons(sym_asym_commons,env);
+ return
rp_symmetric_asymmetric_binding_commons_get_binding_commons(sym_asym_commons,
env);
}
- else if(rp_property_get_type(property,env) ==
RP_PROPERTY_SYMMETRIC_BINDING)
+ else if (rp_property_get_type(property, env) ==
RP_PROPERTY_SYMMETRIC_BINDING)
{
rp_symmetric_binding_t *symmetric_binding = NULL;
rp_symmetric_asymmetric_binding_commons_t *sym_asym_commons = NULL;
- symmetric_binding =
(rp_symmetric_binding_t*)rp_property_get_value(property,env);
- if(!symmetric_binding)
+ symmetric_binding = (rp_symmetric_binding_t *)
rp_property_get_value(property, env);
+ if (!symmetric_binding)
return NULL;
- sym_asym_commons =
rp_symmetric_binding_get_symmetric_asymmetric_binding_commons(symmetric_binding,env);
- if(!sym_asym_commons)
+ sym_asym_commons =
+
rp_symmetric_binding_get_symmetric_asymmetric_binding_commons(symmetric_binding,
env);
+ if (!sym_asym_commons)
return NULL;
- return
rp_symmetric_asymmetric_binding_commons_get_binding_commons(sym_asym_commons,env);
+ return
rp_symmetric_asymmetric_binding_commons_get_binding_commons(sym_asym_commons,
env);
}
- else if(rp_property_get_type(property,env) ==
RP_PROPERTY_TRANSPORT_BINDING)
+ else if (rp_property_get_type(property, env) ==
RP_PROPERTY_TRANSPORT_BINDING)
{
rp_transport_binding_t *transport_binding = NULL;
- transport_binding =
(rp_transport_binding_t*)rp_property_get_value(property,env);
- if(!transport_binding)
+ transport_binding = (rp_transport_binding_t *)
rp_property_get_value(property, env);
+ if (!transport_binding)
return NULL;
- return rp_transport_binding_get_binding_commons(transport_binding,env);
+ return rp_transport_binding_get_binding_commons(transport_binding,
env);
}
else
return NULL;
Modified: webservices/rampart/scratch/c/trust/src/sts_client.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/sts_client.c?rev=592283&r1=592282&r2=592283&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/src/sts_client.c (original)
+++ webservices/rampart/scratch/c/trust/src/sts_client.c Mon Nov 5 21:15:14
2007
@@ -19,7 +19,7 @@
#ifndef TRUST_COMPUTED_KEY_PSHA1
#define TRUST_COMPUTED_KEY_PSHA1 ""
-#endif
+#endif
struct trust_sts_client
{
@@ -61,9 +61,7 @@
{
trust_sts_client_t *sts_client = NULL;
- sts_client =
- (trust_sts_client_t *) AXIS2_MALLOC(env->allocator,
- sizeof(trust_sts_client_t));
+ sts_client = (trust_sts_client_t *) AXIS2_MALLOC(env->allocator,
sizeof(trust_sts_client_t));
sts_client->version = TRUST_VERSION_05_02;
sts_client->key_size = 0;
@@ -105,14 +103,9 @@
axis2_status_t status = AXIS2_SUCCESS;
axiom_node_t *return_node = NULL;
- issuer_policy =
- neethi_util_create_policy_from_file(env,
-
sts_client->issuer_policy_location);
-
- service_policy =
- neethi_util_create_policy_from_file(env,
- sts_client->
- service_policy_location);
+ issuer_policy = neethi_util_create_policy_from_file(env,
sts_client->issuer_policy_location);
+
+ service_policy = neethi_util_create_policy_from_file(env,
sts_client->service_policy_location);
if (!issuer_policy || !service_policy)
{
@@ -120,8 +113,7 @@
}
else
{
- trust_sts_client_process_policies(sts_client, env, issuer_policy,
- service_policy);
+ trust_sts_client_process_policies(sts_client, env, issuer_policy,
service_policy);
}
/* TODO : Fix action logic */
@@ -139,16 +131,17 @@
return_node =
axis2_svc_client_send_receive(svc_client, env,
- trust_sts_client_create_issue_request
- (sts_client, env, "/Issue",
- applies_to, token_type));
+
trust_sts_client_create_issue_request(sts_client, env,
+
"/Issue",
+
applies_to,
+
token_type));
}
if (svc_client)
{
axis2_svc_client_free(svc_client, env);
svc_client = NULL;
}
-
+
return;
}
@@ -171,10 +164,8 @@
svc_client = axis2_svc_client_create(env, sts_client->home_dir);
if (!svc_client)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Stub invoke FAILED: Error code:" " %d :: %s",
- env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE(env->error));
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error
code:" " %d :: %s",
+ env->error->error_number,
AXIS2_ERROR_GET_MESSAGE(env->error));
return NULL;
}
@@ -198,14 +189,12 @@
if (issuer_policy)
{
- sts_client->algo_suite =
- trust_policy_util_get_algorithmsuite(env, issuer_policy);
+ sts_client->algo_suite = trust_policy_util_get_algorithmsuite(env,
issuer_policy);
}
if (service_policy)
{
- sts_client->trust10 =
- trust_policy_util_get_trust10(env, service_policy);
+ sts_client->trust10 = trust_policy_util_get_trust10(env,
service_policy);
}
return AXIS2_SUCCESS;
@@ -226,43 +215,32 @@
rst_node = trust_util_create_rst_element(env, sts_client->version, NULL);
/* Setting up the request type */
- trust_util_create_request_type_element(env, sts_client->version, rst_node,
- request_type);
+ trust_util_create_request_type_element(env, sts_client->version, rst_node,
request_type);
/* Setting up the token type */
if (token_type)
- {
- trust_util_create_token_type_element(env, sts_client->version,
rst_node,
- token_type);
+ {
+ trust_util_create_token_type_element(env, sts_client->version,
rst_node, token_type);
}
if (applies_to)
- trust_util_create_applies_to_element(env, rst_node, applies_to,
- TRUST_WSA_XMLNS);
+ trust_util_create_applies_to_element(env, rst_node, applies_to,
TRUST_WSA_XMLNS);
if (sts_client->trust10 && sts_client->algo_suite)
{
- if (rp_trust10_get_require_client_entropy(sts_client->trust10, env) ==
- AXIS2_TRUE)
+ if (rp_trust10_get_require_client_entropy(sts_client->trust10, env) ==
AXIS2_TRUE)
{
- entropy_node =
- trust_util_create_entropy_element(env, sts_client->version,
- rst_node);
- maxkey_len =
- rp_algorithmsuite_get_max_symmetric_keylength(sts_client->
- algo_suite, env);
+ entropy_node = trust_util_create_entropy_element(env,
sts_client->version, rst_node);
+ maxkey_len =
rp_algorithmsuite_get_max_symmetric_keylength(sts_client->algo_suite, env);
sts_client->requestor_entropy =
- (axis2_char_t*)rampart_generate_nonce(env, maxkey_len);
-
+ (axis2_char_t *) rampart_generate_nonce(env, maxkey_len);
+
binsec_node =
- trust_util_create_binary_secret_element(env,
- sts_client->version,
- entropy_node,
sts_client->requestor_entropy,
+ trust_util_create_binary_secret_element(env,
sts_client->version, entropy_node,
+
sts_client->requestor_entropy,
TRUST_BIN_SEC_TYPE_NONCE);
- trust_util_create_computed_key_algo_element(env,
- sts_client->version,
- rst_node,
+ trust_util_create_computed_key_algo_element(env,
sts_client->version, rst_node,
TRUST_COMPUTED_KEY_PSHA1);
}
}
@@ -270,8 +248,8 @@
{
printf("Algo Suite or Trust10 Error!\n");
}
-
- //trust_sts_client_free(sts_client, env);
+
+ trust_sts_client_free(sts_client, env);
return rst_node;
}
@@ -332,43 +310,34 @@
/* Extract Attached Reference */
attached_ref_qname =
- axutil_qname_create(env, TRUST_REQUESTED_ATTACH_REFERENCE,
trust_ns_str,
- TRUST_WST);
+ axutil_qname_create(env, TRUST_REQUESTED_ATTACHED_REFERENCE,
trust_ns_str, TRUST_WST);
attached_ref_ele =
- axiom_element_get_first_child_with_qname(rstr_ele, env,
- attached_ref_qname, rstr_node,
+ axiom_element_get_first_child_with_qname(rstr_ele, env,
attached_ref_qname, rstr_node,
&attached_ref_node);
if (attached_ref_ele)
{
- req_attached_ref_node =
- axiom_node_get_first_element(attached_ref_node, env);
+ req_attached_ref_node =
axiom_node_get_first_element(attached_ref_node, env);
}
/* Extract unattached Reference */
unattached_ref_qname =
- axutil_qname_create(env, TRUST_REQUESTED_UNATTACHED_REFERENCE,
- trust_ns_str, TRUST_WST);
+ axutil_qname_create(env, TRUST_REQUESTED_UNATTACHED_REFERENCE,
trust_ns_str, TRUST_WST);
unattached_ref_ele =
- axiom_element_get_first_child_with_qname(rstr_ele, env,
- unattached_ref_qname,
- rstr_node,
+ axiom_element_get_first_child_with_qname(rstr_ele, env,
unattached_ref_qname, rstr_node,
&unattached_ref_node);
if (unattached_ref_ele)
{
- req_unattached_ref_node =
- axiom_node_get_first_element(unattached_ref_node, env);
+ req_unattached_ref_node =
axiom_node_get_first_element(unattached_ref_node, env);
}
/* Extract Requested Security Token */
req_sec_token_qname =
- axutil_qname_create(env, TRUST_REQUESTED_SECURITY_TOKEN, trust_ns_str,
- TRUST_WST);
+ axutil_qname_create(env, TRUST_REQUESTED_SECURITY_TOKEN, trust_ns_str,
TRUST_WST);
req_sec_token_ele =
- axiom_element_get_first_child_with_qname(rstr_ele, env,
- req_sec_token_qname,
rstr_node,
+ axiom_element_get_first_child_with_qname(rstr_ele, env,
req_sec_token_qname, rstr_node,
&req_sec_token_node);
if (req_sec_token_node)
@@ -381,11 +350,10 @@
}
/* Extract Life Time */
- life_time_qname =
- axutil_qname_create(env, TRUST_LIFE_TIME, trust_ns_str, TRUST_WST);
+ life_time_qname = axutil_qname_create(env, TRUST_LIFE_TIME, trust_ns_str,
TRUST_WST);
life_time_ele =
- axiom_element_get_first_child_with_qname(rstr_ele, env,
life_time_qname,
- rstr_node, &life_time_node);
+ axiom_element_get_first_child_with_qname(rstr_ele, env,
life_time_qname, rstr_node,
+ &life_time_node);
if (NULL == life_time_ele)
{
@@ -412,14 +380,11 @@
if (req_att_ref_node)
{
- id_str =
- trust_sts_client_get_id_from_str(sts_client, req_att_ref_node,
env);
+ id_str = trust_sts_client_get_id_from_str(sts_client,
req_att_ref_node, env);
}
else if (req_unatt_ref_node)
{
- id_str =
- trust_sts_client_get_id_from_str(sts_client, req_unatt_ref_node,
- env);
+ id_str = trust_sts_client_get_id_from_str(sts_client,
req_unatt_ref_node, env);
}
else
{