You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by ka...@apache.org on 2007/10/26 08:17:08 UTC
svn commit: r588538 - in /webservices/rampart/trunk/c/src/omxmlsec:
derivation.c tokens/Makefile.am tokens/token_length.c tokens/token_offset.c
Author: kaushalye
Date: Thu Oct 25 23:17:08 2007
New Revision: 588538
URL: http://svn.apache.org/viewvc?rev=588538&view=rev
Log:
Length, Nonce and Offset values set in the DerrivedKey token
Build system modified to include lenght and offset tokens.
Modified:
webservices/rampart/trunk/c/src/omxmlsec/derivation.c
webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am
webservices/rampart/trunk/c/src/omxmlsec/tokens/token_length.c
webservices/rampart/trunk/c/src/omxmlsec/tokens/token_offset.c
Modified: webservices/rampart/trunk/c/src/omxmlsec/derivation.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/derivation.c?rev=588538&r1=588537&r2=588538&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/derivation.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/derivation.c Thu Oct 25 23:17:08 2007
@@ -41,7 +41,7 @@
axis2_char_t *dk_id = NULL;
axis2_char_t *nonce = NULL;
- int offset = 0;
+ int offset = -1;
int length = 0;
dk_token = oxs_token_build_derived_key_token_element(env, parent, dk_id, NULL);
@@ -49,14 +49,17 @@
ref_token = oxs_token_build_reference_element(env, dk_token, stref_uri, stref_val_type);
/*Create offset*/
- if(offset > 0){
+ offset = oxs_key_get_offset(derived_key, env);
+ if(offset > -1){
offset_token = oxs_token_build_offset_element(env, dk_token, offset);
}
/*Create length*/
+ length = oxs_key_get_size(derived_key, env);
if(length > 0){
length_token = oxs_token_build_length_element(env, dk_token, length);
}
/*Create nonce*/
+ nonce = oxs_key_get_nonce(derived_key, env);
if(nonce){
nonce_token = oxs_token_build_nonce_element(env, dk_token, nonce);
}
Modified: webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am?rev=588538&r1=588537&r2=588538&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am Thu Oct 25 23:17:08 2007
@@ -9,7 +9,7 @@
token_c14n_method.c token_signature_method.c token_digest_method.c token_digest_value.c \
token_transform.c token_transforms.c token_signature.c token_ds_reference.c \
token_x509_certificate.c token_signature_confirmation.c token_derived_key_token.c \
- token_properties.c token_generation.c
+ token_properties.c token_generation.c token_length.c token_nonce.c token_offset.c
INCLUDES = -I$(top_builddir)/include \
Modified: webservices/rampart/trunk/c/src/omxmlsec/tokens/token_length.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/token_length.c?rev=588538&r1=588537&r2=588538&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/token_length.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/token_length.c Thu Oct 25 23:17:08 2007
@@ -22,7 +22,6 @@
#include <axiom_element.h>
#include <oxs_axiom.h>
-
AXIS2_EXTERN int AXIS2_CALL
oxs_token_get_length_value(const axutil_env_t *env,
axiom_node_t *length_node)
Modified: webservices/rampart/trunk/c/src/omxmlsec/tokens/token_offset.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/token_offset.c?rev=588538&r1=588537&r2=588538&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/token_offset.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/token_offset.c Thu Oct 25 23:17:08 2007
@@ -59,7 +59,7 @@
OXS_ERROR_ELEMENT_FAILED, "Error creating %s element", OXS_NODE_OFFSET);
return NULL;
}
- if(offset > 0){
+ if(offset > -1){
offset_val = (axis2_char_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
sprintf(offset_val, "%d", offset );
}