summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Sanin <aleksey@src.gnome.org>2002-05-30 02:49:57 +0000
committerAleksey Sanin <aleksey@src.gnome.org>2002-05-30 02:49:57 +0000
commitba06229c7c79a618931723c7f02104b7fde63c61 (patch)
tree10cbf07303008e4bd76897f5f7ab919b65d0d8c7
parentde340dcca41dbca25f36901ef0721eb1e0aa6859 (diff)
downloadxmlsec1-ba06229c7c79a618931723c7f02104b7fde63c61.tar.gz
xmlsec1-ba06229c7c79a618931723c7f02104b7fde63c61.tar.bz2
xmlsec1-ba06229c7c79a618931723c7f02104b7fde63c61.zip
merged 0.0.6 release from local cvs
-rw-r--r--AUTHORS7
-rw-r--r--ChangeLog8
-rw-r--r--apps/Makefile.am12
-rw-r--r--apps/xmlsec.c198
-rw-r--r--configure.in36
-rw-r--r--docs/download.html17
-rwxr-xr-xdocs/examples/dsig4/test.pl3
-rw-r--r--docs/index.html59
-rw-r--r--docs/news.html28
-rw-r--r--docs/xmlenc.html1
-rw-r--r--globals.h8
-rw-r--r--include/xmlsec/.cvsignore1
-rw-r--r--include/xmlsec/Makefile.am1
-rw-r--r--include/xmlsec/base64.h16
-rw-r--r--include/xmlsec/bn.h8
-rw-r--r--include/xmlsec/buffered.h10
-rw-r--r--include/xmlsec/ciphers.h14
-rw-r--r--include/xmlsec/debug.h27
-rw-r--r--include/xmlsec/digests.h18
-rw-r--r--include/xmlsec/io.h24
-rw-r--r--include/xmlsec/keyinfo.h18
-rw-r--r--include/xmlsec/keys.h16
-rw-r--r--include/xmlsec/keysInternal.h8
-rw-r--r--include/xmlsec/keysmngr.h24
-rw-r--r--include/xmlsec/membuf.h5
-rw-r--r--include/xmlsec/transforms.h106
-rw-r--r--include/xmlsec/version.h30
-rw-r--r--include/xmlsec/x509.h74
-rw-r--r--include/xmlsec/xmldsig.h42
-rw-r--r--include/xmlsec/xmlenc.h44
-rw-r--r--include/xmlsec/xmlsec.h31
-rw-r--r--include/xmlsec/xmltree.h33
-rw-r--r--include/xmlsec/xpath.h4
-rw-r--r--src/Makefile.am2
-rw-r--r--src/base64.c4
-rw-r--r--src/debug.c42
-rw-r--r--src/dsa.c42
-rw-r--r--src/enveloped.c112
-rw-r--r--src/io.c325
-rw-r--r--src/keysmngr.c2
-rw-r--r--src/rsa.c56
-rw-r--r--src/transforms.c8
-rw-r--r--src/xmldsig.c66
-rw-r--r--src/xmlsec.c1
-rw-r--r--src/xmltree.c65
-rw-r--r--src/xpath.c603
-rw-r--r--src/xpathalt.c623
-rw-r--r--src/xslt.c51
-rw-r--r--tests/01-geuerp-xfilter2/xpath2filterOmitComments.tmpl49
-rw-r--r--tests/01-geuerp-xfilter2/xpath2filterOmitComments.xml49
-rw-r--r--tests/01-geuerp-xfilter2/xpath2filterWithComments.tmpl50
-rw-r--r--tests/01-geuerp-xfilter2/xpath2filterWithComments.xml50
-rw-r--r--tests/01-phaos-xmlenc-3/Readme.txt104
-rw-r--r--tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml58
-rw-r--r--tests/01-phaos-xmlenc-3/dh-priv-key.derbin475 -> 114 bytes
-rw-r--r--tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml60
-rw-r--r--tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml60
-rw-r--r--tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml60
-rw-r--r--tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml126
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml166
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml122
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml126
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml126
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml126
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml58
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml166
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml122
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml126
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml58
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml58
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml166
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml126
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml58
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml166
-rw-r--r--tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml58
-rw-r--r--tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml64
-rw-r--r--tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml56
-rw-r--r--tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml124
-rw-r--r--tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml128
-rw-r--r--tests/01-phaos-xmlenc-3/key.txt234
-rw-r--r--tests/01-phaos-xmlenc-3/payment.xml16
-rw-r--r--tests/01-phaos-xmlenc-3/rsa-priv-key.derbin1216 -> 309 bytes
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/keys.xml44
-rw-r--r--tests/merlin-xmldsig-twenty-three/certs/badb.crtbin850 -> 721 bytes
-rw-r--r--tests/merlin-xmldsig-twenty-three/certs/bres.crtbin850 -> 662 bytes
-rw-r--r--tests/merlin-xmldsig-twenty-three/certs/ca.crtbin862 -> 7 bytes
-rw-r--r--tests/merlin-xmldsig-twenty-three/certs/macha.crtbin852 -> 846 bytes
-rw-r--r--tests/merlin-xmldsig-twenty-three/certs/nemain.crtbin852 -> 608 bytes
-rw-r--r--tests/merlin-xmlenc-five/dh0.p8bin445 -> 409 bytes
-rw-r--r--tests/merlin-xmlenc-five/dh1.p8bin445 -> 409 bytes
-rw-r--r--tests/merlin-xmlenc-five/dsa.p8bin334 -> 333 bytes
-rw-r--r--tests/merlin-xmlenc-five/ids.p12bin9103 -> 499 bytes
-rw-r--r--tests/merlin-xmlenc-five/rsa.p8bin635 -> 312 bytes
-rwxr-xr-xtests/testDSig.sh14
-rwxr-xr-xtests/testEnc.sh4
-rw-r--r--win32/Makefile.msvc241
-rw-r--r--win32/Readme.txt129
-rw-r--r--win32/configure.js318
-rw-r--r--win32/dsp/xmlsec.dsp102
-rw-r--r--win32/dsp/xmlsec.dsw44
-rw-r--r--win32/dsp/xmlsec_lib.dsp296
-rw-r--r--win32/libxmlsec.def.src25
-rw-r--r--win32/mycfg.bat20
-rw-r--r--xmlsec.spec.in26
105 files changed, 5085 insertions, 2228 deletions
diff --git a/AUTHORS b/AUTHORS
index fdf728cb..a86b9390 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1 +1,6 @@
-Aleksey Sanin <aleksey@aleksey.com> \ No newline at end of file
+Aleksey Sanin <aleksey@aleksey.com>
+Igor Zlatkovic <igor@stud.fh-frankfurt.de> (Win32 config files for LibXML and
+ LibXSLT used as template for
+ XML Sec Win32 config files)
+
+
diff --git a/ChangeLog b/ChangeLog
index 3935b0bb..3da9d16d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,20 @@
+Wed 29 May 2002 12:07:35 AM PDT Aleksey Sanin <aleksey@aleksey.com>
+ * merged 0.0.6 release from local CVS
+ * win32 port
+ * xpath filter2
+ * custom network handlers
+
Mon 29 Apr 2002 12:07:35 AM PDT Aleksey Sanin <aleksey@aleksey.com>
* Significant API re-factoring (make it more simple and consistent)
* added symmetric Key Wrappers support (AES, DES)
* added RIPEMD-160 support
+
Sat 30 Mar 2002 12:55:30 AM PST Aleksey Sanin <aleksey@aleksey.com>
* Finished x509 supprot
* Added functions to create signature "on-the-fly"
* Updated examples and docs
* Fixed header files installation bug
+
Wed 27 Mar 2002 11:20:42 PM PST Aleksey Sanin <aleksey@aleksey.com>
* Added x509 verification support and a skeleton for x509
x509 based sigantures
diff --git a/apps/Makefile.am b/apps/Makefile.am
index 0d704eaa..6088d6df 100644
--- a/apps/Makefile.am
+++ b/apps/Makefile.am
@@ -9,19 +9,17 @@ INCLUDES =\
$(OPENSSL_CFLAGS) \
$(LIBXSLT_CFLAGS) \
$(LIBXML_CFLAGS) \
-$(NULL)
-
-LDFLAGS = \
--static \
$(NULL)
-LDADD = \
+
+
+xmlsec_LIBS =
+xmlsec_LDFLAGS = -static
+xmlsec_LDADD = \
$(top_builddir)/src/libxmlsec.la \
$(OPENSSL_LDADDS) \
$(LIBXSLT_LIBS) \
$(LIBXML_LIBS) \
$(NULL)
-
-
diff --git a/apps/xmlsec.c b/apps/xmlsec.c
index d88accc8..fd842935 100644
--- a/apps/xmlsec.c
+++ b/apps/xmlsec.c
@@ -18,7 +18,13 @@
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
+#ifndef XMLSEC_NO_XSLT
#include <libxslt/xslt.h>
+#include <libxslt/extensions.h>
+#include <libxslt/xsltInternals.h>
+#include <libxslt/xsltutils.h>
+#include <libexslt/exslt.h>
+#endif /* XMLSEC_NO_XSLT */
#include <xmlsec/xmlsec.h>
#include <xmlsec/xmltree.h>
@@ -27,6 +33,7 @@
#include <xmlsec/transforms.h>
#include <xmlsec/xmldsig.h>
#include <xmlsec/xmlenc.h>
+#include <xmlsec/debug.h>
static const char copyright[] =
@@ -43,17 +50,17 @@ static const char usage[] =
static const char helpCommands[] =
"XMLSec commands are:\n"
- " help display this help information and exit\n"
- " help-<command> display help information for <command> and exit\n"
- " version print version information and exit\n"
- " keys keys XML file manipulation\n"
+ " help display this help information and exit\n"
+ " help-<command> display help information for <command> and exit\n"
+ " version print version information and exit\n"
+ " keys keys XML file manipulation\n"
#ifndef XMLSEC_NO_XMLDSIG
- " sign sign data and output XML document\n"
- " verify verify signed document\n"
+ " sign sign data and output XML document\n"
+ " verify verify signed document\n"
#endif /* XMLSEC_NO_XMLDSIG */
#ifndef XMLSEC_NO_XMLENC
- " encrypt encrypt data and output XML document\n"
- " decrypt decrypt data from XML document\n"
+ " encrypt encrypt data and output XML document\n"
+ " decrypt decrypt data from XML document\n"
#endif /* XMLSEC_NO_XMLENC */
"\n";
@@ -67,24 +74,24 @@ static const char helpKeys[] =
"Keys XML file manipulation. The result keys set is written to the file.\n"
"\n"
"Keys generation options:\n"
- " --gen-hmac <name> generate new 24 bytes HMAC key and set the key name\n"
- " --gen-rsa <name> generate new RSA key and set the key name\n"
- " --gen-dsa <name> generate new DSA key and set the key name\n"
- " --gen-des3 <name> generate new DES key and set the key name\n"
- " --gen-aes128 <name> generate new AES 128 key and set the key name\n"
- " --gen-aes192 <name> generate new AES 192 key and set the key name\n"
- " --gen-aes256 <name> generate new AES 256 key and set the key name\n"
+ " --gen-hmac <name> generate new 24 bytes HMAC key and set the key name\n"
+ " --gen-rsa <name> generate new RSA key and set the key name\n"
+ " --gen-dsa <name> generate new DSA key and set the key name\n"
+ " --gen-des3 <name> generate new DES key and set the key name\n"
+ " --gen-aes128 <name> generate new AES 128 key and set the key name\n"
+ " --gen-aes192 <name> generate new AES 192 key and set the key name\n"
+ " --gen-aes256 <name> generate new AES 256 key and set the key name\n"
"\n";
static const char helpKeySelect[] =
"Key selection options:\n"
- " --session-key-hmac generate and use session 24 bytes HMAC key\n"
- " --session-key-rsa generate and use session RSA key\n"
- " --session-key-dsa generate and use session DSA key\n"
- " --session-key-des3 generate and use session DES key\n"
- " --session-key-aes128 generate and use session AES 128 key\n"
- " --session-key-aes192 generate and use session AES 192 key\n"
- " --session-key-aes256 generate and use session AES 256 key\n"
+ " --session-key-hmac generate and use session 24 bytes HMAC key\n"
+ " --session-key-rsa generate and use session RSA key\n"
+ " --session-key-dsa generate and use session DSA key\n"
+ " --session-key-des3 generate and use session DES key\n"
+ " --session-key-aes128 generate and use session AES 128 key\n"
+ " --session-key-aes192 generate and use session AES 192 key\n"
+ " --session-key-aes256 generate and use session AES 256 key\n"
"\n";
@@ -94,7 +101,8 @@ static const char helpSign[] =
"\n"
#ifndef XMLSEC_NO_XMLDSIG
"Signature options:\n"
- " --ignore-manifests do not process <Manifest> elements\n"
+ " --ignore-manifests do not process <Manifest> elements\n"
+ " --fake-signatures disable actual signature calc for perf tests\n"
#else /* XMLSEC_NO_XMLDSIG */
"XML Digital Signatures support was disabled during compilation\n"
#endif /* XMLSEC_NO_XMLDSIG */
@@ -114,6 +122,7 @@ static const char helpVerify[] =
" --print-signature store and print the pre-signated\n"
" data (<SignedInfo> element)\n"
" --print-all combination of the all \"--print-*\" options\n"
+ " --fake-signatures disable actual signature calc for perf tests\n"
#else /* XMLSEC_NO_XMLDSIG */
"XML Digital Signatures support was disabled during compilation\n"
#endif /* XMLSEC_NO_XMLDSIG */
@@ -183,7 +192,7 @@ static const char helpX509[] =
static const char helpMisc[] =
"Misc. options:\n"
- " --retry <number> retry the operation <number> times\n"
+ " --repeat <number> repeat the operation <number> times\n"
"\n";
typedef enum _xmlsecCommand {
@@ -270,7 +279,7 @@ xmlSecKeyPtr sessionKey = NULL;
char *nodeId = NULL;
char *nodeName = NULL;
char *nodeNs = NULL;
-int retries = 1;
+int repeats = 1;
int printResult = 0;
clock_t total_time = 0;
@@ -471,8 +480,8 @@ int main(int argc, char **argv) {
/**
* Misc. options
*/
- if((strcmp(argv[pos], "--retry") == 0) && (pos + 1 < argc)) {
- ret = readNumber(argv[++pos], &retries);
+ if((strcmp(argv[pos], "--repeat") == 0) && (pos + 1 < argc)) {
+ ret = readNumber(argv[++pos], &repeats);
} else
/**
@@ -550,8 +559,11 @@ int main(int argc, char **argv) {
*/
if((strcmp(argv[pos], "--ignore-manifests") == 0) && (dsigCtx != NULL)) {
dsigCtx->processManifests = 0;
+ } else if((strcmp(argv[pos], "--fake-signatures") == 0) && (dsigCtx != NULL)) {
+ dsigCtx->fakeSignatures = 1;
} else
+
/**
* Verification options
*/
@@ -630,7 +642,7 @@ int main(int argc, char **argv) {
ret = 0;
while((pos < argc) && (ret >= 0)) {
templateRequired = 0;
- for(i = 0; ((i < retries) && (ret >= 0)); ++i) {
+ for(i = 0; ((i < repeats) && (ret >= 0)); ++i) {
if(command == xmlsecCommandKeys) {
/* simply save keys */
ret = xmlSecSimpleKeysMngrSave(keyMgr, argv[pos],
@@ -682,8 +694,11 @@ int main(int argc, char **argv) {
goto done;
}
- if(retries > 1) {
- fprintf(stderr, "Executed %d tests in %ld msec\n", retries, total_time / (CLOCKS_PER_SEC / 1000));
+ if(repeats > 1) {
+ fprintf(stderr, "Executed %d tests in %ld msec\n", repeats, total_time / (CLOCKS_PER_SEC / 1000));
+ if(xmlSecTimerGet() > 0.0001) {
+ fprintf(stderr, "The debug timer is %f\n", xmlSecTimerGet());
+ }
}
/* success */
@@ -788,11 +803,17 @@ int init(xmlsecCommand command) {
xmlInitParser();
LIBXML_TEST_VERSION
+ xmlTreeIndentString = "\t";
+#ifndef XMLSEC_NO_XSLT
+ xmlIndentTreeOutput = 1;
+#endif /* XMLSEC_NO_XSLT */
+
/*
* Init xmlsec
*/
xmlSecInit();
+
/**
* Create Keys and x509 managers
*/
@@ -873,7 +894,9 @@ void shutdown(void) {
/*
* Shutdown libxslt/libxml
*/
+#ifndef XMLSEC_NO_XSLT
xsltCleanupGlobals();
+#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
/**
@@ -1108,16 +1131,19 @@ int generateDSig(xmlDocPtr doc) {
if(ret < 0) {
fprintf(stderr,"Error: xmlSecDSigGenerate() failed \n");
goto done;
- }
- /*
- * Print document out in default UTF-8 encoding
- */
- xmlDocDumpMemoryEnc(doc, &string, &len, NULL);
- if(string == NULL) {
- fprintf(stderr,"Error: failed to dump document to memory\n");
- goto done;
}
- fwrite(string, len, 1, stdout);
+
+ if(repeats <= 1) {
+ /*
+ * Print document out in default UTF-8 encoding
+ */
+ xmlDocDumpMemoryEnc(doc, &string, &len, NULL);
+ if(string == NULL) {
+ fprintf(stderr,"Error: failed to dump document to memory\n");
+ goto done;
+ }
+ fwrite(string, len, 1, stdout);
+ }
res = 0;
done:
@@ -1134,6 +1160,7 @@ int validateDSig(xmlDocPtr doc) {
xmlSecDSigResultPtr result = NULL;
xmlSecDSigStatus status;
xmlNodePtr signNode;
+ clock_t start_time;
int ret;
signNode = xmlSecFindNode(xmlDocGetRootElement(doc),
@@ -1142,8 +1169,10 @@ int validateDSig(xmlDocPtr doc) {
fprintf(stderr,"Error: failed to find Signature node\n");
return(-1);
}
-
+
+ start_time = clock();
ret = xmlSecDSigValidate(dsigCtx, NULL, sessionKey, signNode, &result);
+ total_time += clock() - start_time;
if((ret < 0) || (result == NULL)){
fprintf(stdout,"ERROR\n");
if(result != NULL) {
@@ -1162,15 +1191,17 @@ int validateDSig(xmlDocPtr doc) {
*/
memset(&status, 0, sizeof(status));
getDSigResult(result, &status);
-
- fprintf(stderr, "= Status:\n");
- fprintf(stderr, "== Signatures ok: %d\n", status.signaturesOk);
- fprintf(stderr, "== Signatures fail: %d\n", status.signaturesFail);
- fprintf(stderr, "== SignedInfo Ref ok: %d\n", status.signRefOk);
- fprintf(stderr, "== SignedInfo Ref fail: %d\n", status.signRefFail);
- fprintf(stderr, "== Manifest Ref ok: %d\n", status.manifestRefOk);
- fprintf(stderr, "== Manifest Ref fail: %d\n", status.manifestRefFail);
+ if(repeats <= 1) {
+
+ fprintf(stderr, "= Status:\n");
+ fprintf(stderr, "== Signatures ok: %d\n", status.signaturesOk);
+ fprintf(stderr, "== Signatures fail: %d\n", status.signaturesFail);
+ fprintf(stderr, "== SignedInfo Ref ok: %d\n", status.signRefOk);
+ fprintf(stderr, "== SignedInfo Ref fail: %d\n", status.signRefFail);
+ fprintf(stderr, "== Manifest Ref ok: %d\n", status.manifestRefOk);
+ fprintf(stderr, "== Manifest Ref fail: %d\n", status.manifestRefFail);
+ }
if(result != NULL) {
xmlSecDSigResultDestroy(result);
@@ -1195,14 +1226,17 @@ int encrypt(xmlDocPtr tmpl) {
xmlSecEncResultPtr encResult = NULL;
xmlChar *result = NULL;
xmlDocPtr doc = NULL;
+ clock_t start_time;
int len;
int ret;
int res = -1;
if(binary && (data != NULL)) {
+ start_time = clock();
ret = xmlSecEncryptUri(encCtx, NULL, sessionKey,
xmlDocGetRootElement(tmpl), data,
&encResult);
+ total_time += clock() - start_time;
if(ret < 0) {
fprintf(stderr,"Error: xmlSecEncryptUri() failed \n");
goto done;
@@ -1238,10 +1272,12 @@ int encrypt(xmlDocPtr tmpl) {
fprintf(stderr,"Error: empty document for file \"%s\" or unable to find node\n", data);
goto done;
}
-
+
+ start_time = clock();
ret = xmlSecEncryptXmlNode(encCtx, NULL, sessionKey,
xmlDocGetRootElement(tmpl),
cur, &encResult);
+ total_time += clock() - start_time;
if(ret < 0) {
fprintf(stderr,"Error: xmlSecEncryptXmlNode() failed \n");
goto done;
@@ -1250,20 +1286,22 @@ int encrypt(xmlDocPtr tmpl) {
fprintf(stderr,"Error: unknown type or bad type parameters\n");
goto done;
}
-
- /*
- * Print document out in default UTF-8 encoding
- */
- if((encResult != NULL) && (encResult->replaced) && (doc != NULL)) {
- xmlDocDumpMemoryEnc(doc, &result, &len, NULL);
- } else {
- xmlDocDumpMemoryEnc(tmpl, &result, &len, NULL);
- }
- if(result == NULL) {
- fprintf(stderr,"Error: failed to dump document to memory\n");
- goto done;
+
+ if(repeats <= 1) {
+ /*
+ * Print document out in default UTF-8 encoding
+ */
+ if((encResult != NULL) && (encResult->replaced) && (doc != NULL)) {
+ xmlDocDumpMemoryEnc(doc, &result, &len, NULL);
+ } else {
+ xmlDocDumpMemoryEnc(tmpl, &result, &len, NULL);
+ }
+ if(result == NULL) {
+ fprintf(stderr,"Error: failed to dump document to memory\n");
+ goto done;
+ }
+ fwrite(result, len, 1, stdout);
}
- fwrite(result, len, 1, stdout);
res = 0;
if(printResult) {
@@ -1286,6 +1324,7 @@ done:
int decrypt(xmlDocPtr doc) {
xmlSecEncResultPtr encResult = NULL;
xmlNodePtr cur;
+ clock_t start_time;
int ret;
int res = -1;
@@ -1294,31 +1333,34 @@ int decrypt(xmlDocPtr doc) {
fprintf(stderr,"Error: unable to find EncryptedData node\n");
goto done;
}
-
+
+ start_time = clock();
ret = xmlSecDecrypt(encCtx, NULL, sessionKey, cur, &encResult);
+ total_time += clock() - start_time;
if(ret < 0) {
fprintf(stderr,"Error: xmlSecDecrypt() failed \n");
goto done;
}
- if((encResult != NULL) && encResult->replaced && (encResult->buffer != NULL)) {
- ret = xmlDocDump(stdout, doc);
- } else if((encResult != NULL) && !encResult->replaced) {
- ret = fwrite(xmlBufferContent(encResult->buffer),
+ if(repeats <= 1) {
+ if((encResult != NULL) && encResult->replaced && (encResult->buffer != NULL)) {
+ ret = xmlDocDump(stdout, doc);
+ } else if((encResult != NULL) && !encResult->replaced) {
+ ret = fwrite(xmlBufferContent(encResult->buffer),
xmlBufferLength(encResult->buffer),
1, stdout);
- } else {
- fprintf(stderr,"Error: bad results \n");
- goto done;
- }
-
- if(ret < 0) {
- fprintf(stderr,"Error: failed to print out the result \n");
- goto done;
- }
+ } else {
+ fprintf(stderr,"Error: bad results \n");
+ goto done;
+ }
+ if(ret < 0) {
+ fprintf(stderr,"Error: failed to print out the result \n");
+ goto done;
+ }
- if(printResult) {
- xmlSecEncResultDebugDump(encResult, stderr);
+ if(printResult) {
+ xmlSecEncResultDebugDump(encResult, stderr);
+ }
}
res = 0;
diff --git a/configure.in b/configure.in
index 2e30ebc9..58001e35 100644
--- a/configure.in
+++ b/configure.in
@@ -1,13 +1,13 @@
AC_INIT(src/xmlsec.c)
-VERSION=0.0.5
PACKAGE=xmlsec
-
-XMLSEC_VERSION=$VERSION
-XMLSEC_VERSION_MAJOR=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d", $1 }'`
-XMLSEC_VERSION_MINOR=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d", $2 }'`
-XMLSEC_VERSION_SUBMINOR=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d", $3 }'`
+XMLSEC_VERSION_MAJOR=0
+XMLSEC_VERSION_MINOR=0
+XMLSEC_VERSION_SUBMINOR=6
+XMLSEC_VERSION=$XMLSEC_VERSION_MAJOR.$XMLSEC_VERSION_MINOR.$XMLSEC_VERSION_SUBMINOR
+VERSION=$XMLSEC_VERSION
XMLSEC_VERSION_INFO=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
+
AC_SUBST(XMLSEC_VERSION)
AC_SUBST(XMLSEC_VERSION_MAJOR)
AC_SUBST(XMLSEC_VERSION_MINOR)
@@ -49,7 +49,7 @@ dnl ==========================================================================
dnl find libxml
dnl ==========================================================================
LIBXML_WITHOUT="no"
-LIBXML_MIN_VERSION=2.4.18
+LIBXML_MIN_VERSION=2.4.22
LIBXML_CONFIG="xml2-config"
LIBXML_PREFIX=""
LIBXML_CFLAG=""
@@ -90,7 +90,7 @@ dnl ==========================================================================
dnl find libxslt
dnl ==========================================================================
LIBXSLT_WITHOUT="no"
-LIBXSLT_MIN_VERSION=1.0.14
+LIBXSLT_MIN_VERSION=1.0.17
LIBXSLT_CONFIG="xslt-config"
LIBXSLT_PREFIX=""
LIBXSLT_CFLAGS=""
@@ -138,8 +138,8 @@ AC_SUBST(LIBXSLT_LIBS)
dnl ==========================================================================
dnl See if we can find OpenSSL
dnl ==========================================================================
-ac_openssl_lib_dir="/usr/lib /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg"
-ac_openssl_inc_dir="/usr/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include"
+ac_openssl_lib_dir="/usr/lib /usr/local/lib /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg"
+ac_openssl_inc_dir="/usr/include /usr/local/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include"
OPENSSL_WITHOUT="no"
OPENSSL_MIN_VERSION="0.9.6"
@@ -382,6 +382,22 @@ fi
AC_SUBST(XMLSEC_NO_XMLENC)
dnl ==========================================================================
+dnl See do we need AltXPath suport
+dnl ==========================================================================
+AC_MSG_CHECKING(for AltXPath support)
+AC_ARG_ENABLE(AltXPath, [ --enable-altxpath enable alternative XPath Filter support (no)])
+if test "$enable_altxpath" = "yes" ; then
+ XMLSEC_NO_XPATHALT="0"
+ AC_MSG_RESULT(yes)
+else
+ XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XPATHALT=1"
+ XMLSEC_NO_XPATHALT="1"
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST(XMLSEC_NO_XPATHALT)
+
+
+dnl ==========================================================================
dnl See do we need Simple Keys Manager
dnl ==========================================================================
AC_MSG_CHECKING(for Simple Keys Manager testing)
diff --git a/docs/download.html b/docs/download.html
index 86590832..cf014ab7 100644
--- a/docs/download.html
+++ b/docs/download.html
@@ -62,14 +62,18 @@ xmlsec@aleksey.com archive</a>
<div align="Center">
<h2>Download</h2>
- <div align="Left">The latest XML Security Library version is <b>0.0.5</b>
-:<br>
+ <div align="Left">The latest XML Security Library version is <b>0.0.6</b>:
+ <br>
<ul>
- <li><a href="download/xmlsec-0.0.5.tar.gz">source archive</a>
+ <li><a href="download/xmlsec-0.0.6.tar.gz">source archive</a>
</li>
<li><a href="http://rpmfind.net/linux/rpm2html/search.php?query=xmlsec">
-rpm packages</a>
+rpm package</a>
+ (compiled with OpenSSL 0.9.6 because there are no OpenSSL 0.9.7 RPM yet;
+ has incomplete XML Encryption functionality). </li>
+ <li><a href="http://rpmfind.net/linux/rpm2html/search.php?query=xmlsec-devel">
+rpm-devel package</a>
(compiled with OpenSSL 0.9.6 because there are no OpenSSL 0.9.7 RPM yet;
has incomplete XML Encryption functionality). </li>
@@ -77,6 +81,7 @@ rpm packages</a>
The <a href="ftp://ftp.aleksey.com/pub/xmlsec/snapshots/">daily snapshots</a>
and <a href="ftp://ftp.aleksey.com/pub/xmlsec/releases/">previous versions</a>
are also available.
+
<p> <b>Mirrors</b><br>
</p>
<ul>
@@ -92,9 +97,9 @@ rpm packages</a>
The XML Security Library requires <br>
</p>
<ul>
- <li><a href="http://xmlsoft.org/downloads.html">LibXML version 2.4.18</a>
+ <li><a href="http://xmlsoft.org/downloads.html">LibXML version 2.4.22</a>
or geater</li>
- <li><a href="http://xmlsoft.org/XSLT/downloads.html">LibXSLT 1.0.14</a>
+ <li><a href="http://xmlsoft.org/XSLT/downloads.html">LibXSLT 1.0.17</a>
or greater (optional)</li>
<li><a href="ftp://ftp.openssl.org/snapshot/">OpenSSL version 0.9.7</a>
(prefered) or <a href="http://www.openssl.org/source/openssl-0.9.6c.tar.gz">
diff --git a/docs/examples/dsig4/test.pl b/docs/examples/dsig4/test.pl
index eda96f3c..a299f07e 100755
--- a/docs/examples/dsig4/test.pl
+++ b/docs/examples/dsig4/test.pl
@@ -1,4 +1,7 @@
#!/bin/perl
+#!/usr/bin/perl -w
+
+
#
# Read STDIN input and send it to
# XML Digital Signature Verifier
diff --git a/docs/index.html b/docs/index.html
index 36166cfa..a1c0803b 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -88,6 +88,33 @@ MIT Licence</a>
)<br>
<ul>
+ <li>May 28 2002<br>
+ New LibXML 2.4.22 is <a href="http://xmlsoft.org/news.html">released</a>
+ and new <a href="download.html">XML Security Library 0.0.6</a> is
+ released:<br>
+ - Win32 port is added: the idea and most of the configuration scripts
+ code was taken from LibXML2 (written by Igor Zlatkovic). I modified
+ original files so all errors are mine, not Igor's.<br>
+ - Many different performance optimizations (especially for RSA/DSA
+ algorithms and enveloped signatures).<br>
+ - <a href="http://www.w3.org/TR/xmldsig-filter2/">XPath Filter 2</a>
+ and <a href="http://lists.w3.org/Archives/Public/w3c-ietf-xmldsig/2002AprJun/0001.html">Alternative
+ XPath Filter</a> (not compiled by default, use --enable-altxpath configuration
+ switch if you need this transform) support is added. <br>
+ - Custom network protocol handler support is added. It is similar
+ to custom protocol handlers in LibXML2 but applied to binary files.<br>
+ - Separated XML Security Library RPM into xmlsec and xmlsec-devel
+ (suggested by Devin Heitmueller).<br>
+ </li>
+ <br>
+
+ <li>May 14 2002<br>
+ I've checked in new code for plugging in custom input handlers
+ (similar to ones that exist in LibXML2). The downside is that
+ you have to use <a href="ftp://xmlsoft.org/cvs-snapshot.tar.gz">daily
+ LibXML2 snapshot</a> to compile daily XML Security Library snapshot.
+ </li>
+ <br>
<li>April 28 2002<br>
<a href="download.html">XMLSec 0.0.5</a> released: <br>
- Big external and internal cleanup. Now the API looks much more consistent
@@ -133,38 +160,6 @@ OpenSSL 0.9.7</a>
<br>
</li>
<br>
- <li>April 6 2002<br>
- The <a href="download.html">RPM packages</a>
- are now available.<br>
- <br>
- </li>
- <li>April 5 2002<br>
- Test suite updates and new minor release <a href="download.html">XML Security
-Library 0.0.2a.</a>
- <br>
- New <a href="http://lists.w3.org/Archives/Public/w3c-ietf-xmldsig/2002AprJun/0017.html">
- interoperability tests</a>
- were provided by Merlin Hughes. XML Security Library successfully passed
- <b>all tests </b>after small test program tweaking and adding
-workaround for <a href="http://groups.google.com/groups?hl=en&amp;threadm=96uofi%2417gh%241%40FreeBSD.csie.NCTU.edu.tw&amp;rnum=2&amp;prev=/groups%3Fq%3DX509_STORE_add_crl%26hl%3Den%26selm%3D96uofi%252417gh%25241%2540FreeBSD.csie.NCTU.edu.tw%26rnum%3D2">
- OpenSSL CRL problem.</a>
- These new tests are included into the distribution and previous Merlin's
-test suites are removed. Because of these changes I decided to generate a
-new package that also will include the <a href="xmldsig-verifier.html"> Online
-XML Digital Signature Verifier</a>
- code.<br>
- <br>
- </li>
- <li>April 3 2002<br>
- The <a href="xmldsig-verifier.html">Online XML Digital Signature Verifier</a>
- is available! You can use this tool to verify your XML Digital Signatures
- from online Web form or using a simple Perl script. The idea was stolen from
- <a href="http://lists.w3.org/Archives/Public/w3c-ietf-xmldsig/2002AprJun/0006.html">
- Manoj K. Srivastava.</a>
- <br>
- <br>
- </li>
-
</ul>
<p> <a href="bugs.html">Aleksey Sanin</a>
diff --git a/docs/news.html b/docs/news.html
index e0499c32..634aed70 100644
--- a/docs/news.html
+++ b/docs/news.html
@@ -46,6 +46,34 @@
<ul>
+
+ <li>May 28 2002<br>
+ New LibXML 2.4.22 is <a href="http://xmlsoft.org/news.html">released</a>
+ and new <a href="download.html">XML Security Library 0.0.6</a> is
+ released:<br>
+ - Win32 port is added: the idea and most of the configuration scripts
+ code was taken from LibXML2 (written by Igor Zlatkovic). I modified
+ original files so all errors are mine, not Igor's.<br>
+ - Many different performance optimizations (especially for RSA/DSA
+ algorithms and enveloped signatures).<br>
+ - <a href="http://www.w3.org/TR/xmldsig-filter2/">XPath Filter 2</a>
+ and <a href="http://lists.w3.org/Archives/Public/w3c-ietf-xmldsig/2002AprJun/0001.html">Alternative
+ XPath Filter</a> (not compiled by default, use --enable-altxpath configuration
+ switch if you need this transform) support is added. <br>
+ - Custom network protocol handler support is added. It is similar
+ to custom protocol handlers in LibXML2 but applied to binary files.<br>
+ - Separated XML Security Library RPM into xmlsec and xmlsec-devel
+ (suggested by Devin Heitmueller).<br>
+ </li>
+ <br>
+
+ <li>May 14 2002<br>
+ I've checked in new code for plugging in custom input handlers
+ (similar to ones that exist in LibXML2). The downside is that
+ you have to use <a href="ftp://xmlsoft.org/cvs-snapshot.tar.gz">daily
+ LibXML2 snapshot</a> to compile daily XML Security Library snapshot.
+ </li>
+ <br>
<li>April 28 2002<br>
<a href="download.html">XMLSec 0.0.5</a> released: <br>
- Big external and internal cleanup. Now the API looks much more consistent
diff --git a/docs/xmlenc.html b/docs/xmlenc.html
index 0bed6155..8c6d7728 100644
--- a/docs/xmlenc.html
+++ b/docs/xmlenc.html
@@ -75,7 +75,6 @@
but following:<br>
<ul>
- <li>Symmetric Key Wrap</li>
<li>Diffie-Hellman Key Agreement</li>
<li>Decryption Transform</li>
diff --git a/globals.h b/globals.h
index c7633e58..ee62d41e 100644
--- a/globals.h
+++ b/globals.h
@@ -11,12 +11,8 @@
#ifndef __XMLSEC_GLOBALS_H__
#define __XMLSEC_GLOBALS_H__
-#if defined(WIN32) && !defined(__CYGWIN__)
-#include "win32config.h"
-#elif defined(macintosh)
-#include "config-mac.h"
-#else
#include "config.h"
-#endif
+
+#define IN_XMLSEC
#endif /* ! __XMLSEC_GLOBALS_H__ */
diff --git a/include/xmlsec/.cvsignore b/include/xmlsec/.cvsignore
index 9ba20bcc..282522db 100644
--- a/include/xmlsec/.cvsignore
+++ b/include/xmlsec/.cvsignore
@@ -1,3 +1,2 @@
Makefile
Makefile.in
-version.h
diff --git a/include/xmlsec/Makefile.am b/include/xmlsec/Makefile.am
index 6fe72daa..14b613bd 100644
--- a/include/xmlsec/Makefile.am
+++ b/include/xmlsec/Makefile.am
@@ -8,6 +8,7 @@ bn.h \
buffered.h \
ciphers.h \
digests.h \
+debug.h \
io.h \
keyinfo.h \
keys.h \
diff --git a/include/xmlsec/base64.h b/include/xmlsec/base64.h
index dd50be00..6283cfb8 100644
--- a/include/xmlsec/base64.h
+++ b/include/xmlsec/base64.h
@@ -28,26 +28,26 @@ extern "C" {
* Base64 Context
*/
typedef struct _xmlSecBase64Ctx *xmlSecBase64CtxPtr;
-xmlSecBase64CtxPtr xmlSecBase64CtxCreate (int encode,
- int columns);
-void xmlSecBase64CtxDestroy (xmlSecBase64CtxPtr ctx);
-int xmlSecBase64CtxInit (xmlSecBase64CtxPtr ctx);
-int xmlSecBase64CtxUpdate (xmlSecBase64CtxPtr ctx,
+XMLSEC_EXPORT xmlSecBase64CtxPtr xmlSecBase64CtxCreate (int encode,
+ int columns);
+XMLSEC_EXPORT void xmlSecBase64CtxDestroy (xmlSecBase64CtxPtr ctx);
+XMLSEC_EXPORT int xmlSecBase64CtxInit (xmlSecBase64CtxPtr ctx);
+XMLSEC_EXPORT int xmlSecBase64CtxUpdate (xmlSecBase64CtxPtr ctx,
const unsigned char *in,
size_t inLen,
unsigned char *out,
size_t outLen);
-int xmlSecBase64CtxFinal (xmlSecBase64CtxPtr ctx,
+XMLSEC_EXPORT int xmlSecBase64CtxFinal (xmlSecBase64CtxPtr ctx,
unsigned char *out,
size_t outLen);
/**
* Standalone routine to do base64 encode/decode "at once"
*/
-xmlChar* xmlSecBase64Encode (const unsigned char *buf,
+XMLSEC_EXPORT xmlChar* xmlSecBase64Encode (const unsigned char *buf,
size_t len,
int columns);
-int xmlSecBase64Decode (const xmlChar* str,
+XMLSEC_EXPORT int xmlSecBase64Decode (const xmlChar* str,
unsigned char *buf,
size_t len);
diff --git a/include/xmlsec/bn.h b/include/xmlsec/bn.h
index cfaa9b9b..1871f89c 100644
--- a/include/xmlsec/bn.h
+++ b/include/xmlsec/bn.h
@@ -20,13 +20,13 @@ extern "C" {
#include <xmlsec/xmlsec.h>
-BIGNUM* xmlSecCryptoBinary2BN (const xmlChar *str,
+XMLSEC_EXPORT BIGNUM* xmlSecCryptoBinary2BN (const xmlChar *str,
BIGNUM **a);
-xmlChar* xmlSecBN2CryptoBinary (const BIGNUM *a);
+XMLSEC_EXPORT xmlChar* xmlSecBN2CryptoBinary (const BIGNUM *a);
-BIGNUM* xmlSecNodeGetBNValue (const xmlNodePtr cur,
+XMLSEC_EXPORT BIGNUM* xmlSecNodeGetBNValue (const xmlNodePtr cur,
BIGNUM **a);
-int xmlSecNodeSetBNValue (xmlNodePtr cur,
+XMLSEC_EXPORT int xmlSecNodeSetBNValue (xmlNodePtr cur,
const BIGNUM *a,
int addLineBreak);
diff --git a/include/xmlsec/buffered.h b/include/xmlsec/buffered.h
index 1ee5ff0f..8b512500 100644
--- a/include/xmlsec/buffered.h
+++ b/include/xmlsec/buffered.h
@@ -73,17 +73,17 @@ typedef struct _xmlSecBufferedTransform {
/**
* BinTransform methods to be used in the Id structure
*/
-int xmlSecBufferedTransformRead (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT int xmlSecBufferedTransformRead (xmlSecBinTransformPtr transform,
unsigned char *buf,
size_t size);
-int xmlSecBufferedTransformWrite (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT int xmlSecBufferedTransformWrite (xmlSecBinTransformPtr transform,
const unsigned char *buf,
size_t size);
-int xmlSecBufferedTransformFlush (xmlSecBinTransformPtr transform);
+XMLSEC_EXPORT int xmlSecBufferedTransformFlush (xmlSecBinTransformPtr transform);
-void xmlSecBufferedDestroy (xmlSecBufferedTransformPtr buffered);
-int xmlSecBufferedProcess (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT void xmlSecBufferedDestroy (xmlSecBufferedTransformPtr buffered);
+XMLSEC_EXPORT int xmlSecBufferedProcess (xmlSecBinTransformPtr transform,
xmlBufferPtr buffer);
#ifdef __cplusplus
diff --git a/include/xmlsec/ciphers.h b/include/xmlsec/ciphers.h
index 59ff1186..17167a0e 100644
--- a/include/xmlsec/ciphers.h
+++ b/include/xmlsec/ciphers.h
@@ -85,30 +85,30 @@ typedef struct _xmlSecCipherTransform {
/**
* BinTransform methods to be used in the Id structure
*/
-int xmlSecCipherTransformRead (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT int xmlSecCipherTransformRead (xmlSecBinTransformPtr transform,
unsigned char *buf,
size_t size);
-int xmlSecCipherTransformWrite (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT int xmlSecCipherTransformWrite (xmlSecBinTransformPtr transform,
const unsigned char *buf,
size_t size);
-int xmlSecCipherTransformFlush (xmlSecBinTransformPtr transform);
+XMLSEC_EXPORT int xmlSecCipherTransformFlush (xmlSecBinTransformPtr transform);
/**
* EVP Cipher methods
*/
-int xmlSecEvpCipherUpdate (xmlSecCipherTransformPtr cipher,
+XMLSEC_EXPORT int xmlSecEvpCipherUpdate (xmlSecCipherTransformPtr cipher,
const unsigned char *buffer,
size_t size);
-int xmlSecEvpCipherFinal (xmlSecCipherTransformPtr cipher);
+XMLSEC_EXPORT int xmlSecEvpCipherFinal (xmlSecCipherTransformPtr cipher);
/**
* Low-level methods
*/
-int xmlSecCipherUpdate (xmlSecTransformPtr transform,
+XMLSEC_EXPORT int xmlSecCipherUpdate (xmlSecTransformPtr transform,
const unsigned char *buffer,
size_t size);
-int xmlSecCipherFinal (xmlSecTransformPtr transform);
+XMLSEC_EXPORT int xmlSecCipherFinal (xmlSecTransformPtr transform);
#ifdef __cplusplus
}
diff --git a/include/xmlsec/debug.h b/include/xmlsec/debug.h
new file mode 100644
index 00000000..d173608f
--- /dev/null
+++ b/include/xmlsec/debug.h
@@ -0,0 +1,27 @@
+/**
+ * XMLSec library
+ *
+ *
+ * See Copyright for the status of this software.
+ *
+ * Author: Aleksey Sanin <aleksey@aleksey.com>
+ */
+#ifndef __XMLSEC_DEBUG_H__
+#define __XMLSEC_DEBUG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+XMLSEC_EXPORT void xmlSecTimerInit (void);
+XMLSEC_EXPORT void xmlSecTimerStart (void);
+XMLSEC_EXPORT void xmlSecTimerEnd (void);
+XMLSEC_EXPORT double xmlSecTimerGet (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __XMLSEC_DEBUG_H__ */
+
diff --git a/include/xmlsec/digests.h b/include/xmlsec/digests.h
index dee84892..c643bf6f 100644
--- a/include/xmlsec/digests.h
+++ b/include/xmlsec/digests.h
@@ -87,24 +87,24 @@ typedef struct _xmlSecDigestTransform {
/**
* Digest specific hi-level methods
*/
-int xmlSecDigestSignNode (xmlSecTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestSignNode (xmlSecTransformPtr transform,
xmlNodePtr valueNode,
int removeOldContent);
-int xmlSecDigestVerifyNode (xmlSecTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestVerifyNode (xmlSecTransformPtr transform,
const xmlNodePtr valueNode);
-void xmlSecDigestSetPushMode (xmlSecTransformPtr transform,
+XMLSEC_EXPORT void xmlSecDigestSetPushMode (xmlSecTransformPtr transform,
int enabled);
/**
* Digest specific low-level methods
*/
-int xmlSecDigestUpdate (xmlSecTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestUpdate (xmlSecTransformPtr transform,
const unsigned char *buffer,
size_t size);
-int xmlSecDigestSign (xmlSecTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestSign (xmlSecTransformPtr transform,
unsigned char **buffer,
size_t *size);
-int xmlSecDigestVerify (xmlSecTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestVerify (xmlSecTransformPtr transform,
const unsigned char *buffer,
size_t size);
@@ -112,13 +112,13 @@ int xmlSecDigestVerify (xmlSecTransformPtr transform,
/**
* BinTransform methods to be used in the Id structure
*/
-int xmlSecDigestTransformRead (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestTransformRead (xmlSecBinTransformPtr transform,
unsigned char *buf,
size_t size);
-int xmlSecDigestTransformWrite (xmlSecBinTransformPtr transform,
+XMLSEC_EXPORT int xmlSecDigestTransformWrite (xmlSecBinTransformPtr transform,
const unsigned char *buf,
size_t size);
-int xmlSecDigestTransformFlush (xmlSecBinTransformPtr transform);
+XMLSEC_EXPORT int xmlSecDigestTransformFlush (xmlSecBinTransformPtr transform);
diff --git a/include/xmlsec/io.h b/include/xmlsec/io.h
index 67253e47..067cb2da 100644
--- a/include/xmlsec/io.h
+++ b/include/xmlsec/io.h
@@ -15,25 +15,25 @@ extern "C" {
#endif /* __cplusplus */
#include <libxml/tree.h>
+#include <libxml/xmlIO.h>
#include <xmlsec/xmlsec.h>
#include <xmlsec/transforms.h>
-void xmlSecIOInit (void);
-void xmlSecIOShutdown (void);
+XMLSEC_EXPORT void xmlSecIOInit (void);
+XMLSEC_EXPORT void xmlSecIOShutdown (void);
-extern xmlSecTransformId xmlSecInputUri;
-
-typedef void* (*xmlSecInputUriTransformOpenCallback) (const char *uri,
- void *context);
-typedef int (*xmlSecInputUriTransformReadCallback) (void *data,
- unsigned char *buffer,
- size_t size);
-typedef void (*xmlSecInputUriTransformCloseCallback) (void *data);
-
-int xmlSecInputUriTransformOpen (xmlSecTransformPtr transform,
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecInputUri;
+XMLSEC_EXPORT int xmlSecInputUriTransformOpen (xmlSecTransformPtr transform,
const char *uri);
+XMLSEC_EXPORT void xmlSecCleanupInputCallbacks (void);
+XMLSEC_EXPORT void xmlSecRegisterDefaultInputCallbacks (void);
+XMLSEC_EXPORT int xmlSecRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
+ xmlInputOpenCallback openFunc,
+ xmlInputReadCallback readFunc,
+ xmlInputCloseCallback closeFunc);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/xmlsec/keyinfo.h b/include/xmlsec/keyinfo.h
index 65b58f45..827a3115 100644
--- a/include/xmlsec/keyinfo.h
+++ b/include/xmlsec/keyinfo.h
@@ -21,13 +21,13 @@ extern "C" {
#include <xmlsec/transforms.h>
-xmlSecKeyPtr xmlSecKeyInfoNodeRead (xmlNodePtr keyInfoNode,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecKeyInfoNodeRead (xmlNodePtr keyInfoNode,
xmlSecKeysMngrPtr keysMngr,
void *context,
xmlSecKeyId keyId,
xmlSecKeyType keyType,
xmlSecKeyUsage keyUsage);
-int xmlSecKeyInfoNodeWrite (xmlNodePtr keyInfoNode,
+XMLSEC_EXPORT int xmlSecKeyInfoNodeWrite (xmlNodePtr keyInfoNode,
xmlSecKeysMngrPtr keysMngr,
void *context,
xmlSecKeyPtr key,
@@ -35,15 +35,17 @@ int xmlSecKeyInfoNodeWrite (xmlNodePtr keyInfoNode,
-xmlNodePtr xmlSecKeyInfoAddKeyName (xmlNodePtr keyInfoNode);
-xmlNodePtr xmlSecKeyInfoAddKeyValue (xmlNodePtr keyInfoNode);
-xmlNodePtr xmlSecKeyInfoAddX509Data (xmlNodePtr keyInfoNode);
-xmlNodePtr xmlSecKeyInfoAddRetrievalMethod (xmlNodePtr keyInfoNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecKeyInfoAddKeyName (xmlNodePtr keyInfoNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecKeyInfoAddKeyValue (xmlNodePtr keyInfoNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecKeyInfoAddX509Data (xmlNodePtr keyInfoNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecKeyInfoAddRetrievalMethod
+ (xmlNodePtr keyInfoNode,
const xmlChar *uri,
const xmlChar *type);
-xmlNodePtr xmlSecRetrievalMethodAddTransform (xmlNodePtr retrMethod,
+XMLSEC_EXPORT xmlNodePtr xmlSecRetrievalMethodAddTransform
+ (xmlNodePtr retrMethod,
xmlSecTransformId id);
-xmlNodePtr xmlSecKeyInfoAddEncryptedKey (xmlNodePtr keyInfoNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecKeyInfoAddEncryptedKey (xmlNodePtr keyInfoNode,
const xmlChar *id,
const xmlChar *type,
const xmlChar *recipient);
diff --git a/include/xmlsec/keys.h b/include/xmlsec/keys.h
index 9d9ff22b..1151d20a 100644
--- a/include/xmlsec/keys.h
+++ b/include/xmlsec/keys.h
@@ -21,7 +21,7 @@ typedef const struct _xmlSecKeyId *xmlSecKeyId;
typedef struct _xmlSecKey *xmlSecKeyPtr;
typedef struct _xmlSecKeysMngr *xmlSecKeysMngrPtr;
-extern xmlSecKeyId xmlSecAllKeyIds[];
+XMLSEC_EXPORT_VAR xmlSecKeyId xmlSecAllKeyIds[];
/**
* Key Types
@@ -86,19 +86,19 @@ struct _xmlSecKey {
};
-xmlSecKeyPtr xmlSecKeyCreate (xmlSecKeyId id,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecKeyCreate (xmlSecKeyId id,
xmlSecKeyOrigin origin);
-void xmlSecKeyDestroy (xmlSecKeyPtr key);
-xmlSecKeyPtr xmlSecKeyDuplicate (xmlSecKeyPtr key,
+XMLSEC_EXPORT void xmlSecKeyDestroy (xmlSecKeyPtr key);
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecKeyDuplicate (xmlSecKeyPtr key,
xmlSecKeyOrigin origin);
-int xmlSecVerifyKey (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecVerifyKey (xmlSecKeyPtr key,
const xmlChar *name,
xmlSecKeyId id,
xmlSecKeyType type);
-void xmlSecKeyDebugDump (xmlSecKeyPtr key,
+XMLSEC_EXPORT void xmlSecKeyDebugDump (xmlSecKeyPtr key,
FILE *output);
#ifndef XMLSEC_NO_X509
-int xmlSecKeyReadPemCert (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecKeyReadPemCert (xmlSecKeyPtr key,
const char *filename);
#endif /* XMLSEC_NO_X509 */
@@ -177,7 +177,7 @@ typedef struct _xmlSecKeysMngr {
} xmlSecKeysMngr;
-xmlSecKeyPtr xmlSecKeysMngrGetKey (xmlNodePtr keyInfoNode,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecKeysMngrGetKey (xmlNodePtr keyInfoNode,
xmlSecKeysMngrPtr mngr,
void *context,
xmlSecKeyId keyId,
diff --git a/include/xmlsec/keysInternal.h b/include/xmlsec/keysInternal.h
index 5d71fd60..2c79874d 100644
--- a/include/xmlsec/keysInternal.h
+++ b/include/xmlsec/keysInternal.h
@@ -78,15 +78,15 @@ void xmlSecKeysInit (void);
#define xmlSecKeyCheckTransform(key, tr) \
(xmlSecKeyIsValid(( key )) && \
((((const xmlSecKeyId) (( key )->id->transformId))) == ( tr )))
-xmlSecKeyPtr xmlSecKeyReadXml (xmlSecKeyId id,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecKeyReadXml (xmlSecKeyId id,
xmlNodePtr node);
-int xmlSecKeyWriteXml (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecKeyWriteXml (xmlSecKeyPtr key,
xmlSecKeyType type,
xmlNodePtr node);
-xmlSecKeyPtr xmlSecKeyReadBin (xmlSecKeyId id,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecKeyReadBin (xmlSecKeyId id,
const unsigned char *buf,
size_t size);
-int xmlSecKeyWriteBin (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecKeyWriteBin (xmlSecKeyPtr key,
xmlSecKeyType type,
unsigned char **buf,
size_t *size);
diff --git a/include/xmlsec/keysmngr.h b/include/xmlsec/keysmngr.h
index 77487ab4..ed420e89 100644
--- a/include/xmlsec/keysmngr.h
+++ b/include/xmlsec/keysmngr.h
@@ -24,27 +24,28 @@ extern "C" {
/**
* Simple Keys Manager:
*/
-xmlSecKeysMngrPtr xmlSecSimpleKeysMngrCreate (void);
-void xmlSecSimpleKeysMngrDestroy (xmlSecKeysMngrPtr mngr);
+XMLSEC_EXPORT xmlSecKeysMngrPtr xmlSecSimpleKeysMngrCreate
+ (void);
+XMLSEC_EXPORT void xmlSecSimpleKeysMngrDestroy (xmlSecKeysMngrPtr mngr);
/**
* Keys management
*/
-xmlSecKeyPtr xmlSecSimpleKeysMngrFindKey (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecSimpleKeysMngrFindKey (xmlSecKeysMngrPtr mngr,
void *context,
const xmlChar *name,
xmlSecKeyId id,
xmlSecKeyType keyType,
xmlSecKeyUsage keyUsage);
-int xmlSecSimpleKeysMngrAddKey (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT int xmlSecSimpleKeysMngrAddKey (xmlSecKeysMngrPtr mngr,
xmlSecKeyPtr key);
-int xmlSecSimpleKeysMngrLoad (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT int xmlSecSimpleKeysMngrLoad (xmlSecKeysMngrPtr mngr,
const char *uri,
int strict);
-int xmlSecSimpleKeysMngrSave (const xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT int xmlSecSimpleKeysMngrSave (const xmlSecKeysMngrPtr mngr,
const char *filename,
xmlSecKeyType type);
-xmlSecKeyPtr xmlSecSimpleKeysMngrLoadPemKey (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecSimpleKeysMngrLoadPemKey(xmlSecKeysMngrPtr mngr,
const char *keyfile,
const char *keyPwd,
pem_password_cb *keyPwdCallback,
@@ -54,20 +55,21 @@ xmlSecKeyPtr xmlSecSimpleKeysMngrLoadPemKey (xmlSecKeysMngrPtr mngr,
* X509 certificates management
*/
#ifndef XMLSEC_NO_X509
-xmlSecX509DataPtr xmlSecSimpleKeysMngrX509Find (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT xmlSecX509DataPtr xmlSecSimpleKeysMngrX509Find
+ (xmlSecKeysMngrPtr mngr,
void *context,
xmlChar *subjectName,
xmlChar *issuerName,
xmlChar *issuerSerial,
xmlChar *ski,
xmlSecX509DataPtr cert);
-int xmlSecSimpleKeysMngrX509Verify (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT int xmlSecSimpleKeysMngrX509Verify (xmlSecKeysMngrPtr mngr,
void *context,
xmlSecX509DataPtr cert);
-int xmlSecSimpleKeysMngrLoadPemCert (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT int xmlSecSimpleKeysMngrLoadPemCert (xmlSecKeysMngrPtr mngr,
const char *filename,
int trusted);
-int xmlSecSimpleKeysMngrAddCertsDir (xmlSecKeysMngrPtr mngr,
+XMLSEC_EXPORT int xmlSecSimpleKeysMngrAddCertsDir (xmlSecKeysMngrPtr mngr,
const char *path);
#endif /* XMLSEC_NO_X509 */
diff --git a/include/xmlsec/membuf.h b/include/xmlsec/membuf.h
index b5f0500d..6fe3c455 100644
--- a/include/xmlsec/membuf.h
+++ b/include/xmlsec/membuf.h
@@ -19,9 +19,10 @@ extern "C" {
#include <xmlsec/xmlsec.h>
#include <xmlsec/transforms.h>
-extern xmlSecTransformId xmlSecMemBuf;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecMemBuf;
-xmlBufferPtr xmlSecMemBufTransformGetBuffer (xmlSecTransformPtr transform,
+XMLSEC_EXPORT xmlBufferPtr xmlSecMemBufTransformGetBuffer
+ (xmlSecTransformPtr transform,
int removeBuffer);
#ifdef __cplusplus
}
diff --git a/include/xmlsec/transforms.h b/include/xmlsec/transforms.h
index 384a627e..1e398997 100644
--- a/include/xmlsec/transforms.h
+++ b/include/xmlsec/transforms.h
@@ -41,15 +41,15 @@ typedef enum _xmlSecTransformStatus {
* AES transforms
*/
#ifndef XMLSEC_NO_AES
-extern xmlSecTransformId xmlSecEncAes128Cbc;
-extern xmlSecTransformId xmlSecEncAes192Cbc;
-extern xmlSecTransformId xmlSecEncAes256Cbc;
-extern xmlSecTransformId xmlSecKWAes128;
-extern xmlSecTransformId xmlSecKWAes192;
-extern xmlSecTransformId xmlSecKWAes256;
-extern xmlSecKeyId xmlSecAesKey;
-
-int xmlSecAesKeyGenerate (xmlSecKeyPtr key,
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncAes128Cbc;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncAes192Cbc;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncAes256Cbc;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecKWAes128;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecKWAes192;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecKWAes256;
+XMLSEC_EXPORT_VAR xmlSecKeyId xmlSecAesKey;
+
+XMLSEC_EXPORT int xmlSecAesKeyGenerate (xmlSecKeyPtr key,
const unsigned char *buf,
size_t size);
#endif /* XMLSEC_NO_AES */
@@ -58,33 +58,34 @@ int xmlSecAesKeyGenerate (xmlSecKeyPtr key,
* Base64 Transform
*/
#define XMLSEC_BASE64_LINESIZE 64
-extern xmlSecTransformId xmlSecEncBase64Encode;
-extern xmlSecTransformId xmlSecEncBase64Decode;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncBase64Encode;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncBase64Decode;
-void xmlSecBase64EncodeSetLineSize (xmlSecTransformPtr transform,
+XMLSEC_EXPORT void xmlSecBase64EncodeSetLineSize(xmlSecTransformPtr transform,
size_t lineSize);
/**
* C14N transforms
*/
-extern xmlSecTransformId xmlSecC14NInclusive;
-extern xmlSecTransformId xmlSecC14NInclusiveWithComments;
-extern xmlSecTransformId xmlSecC14NExclusive;
-extern xmlSecTransformId xmlSecC14NExclusiveWithComments;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecC14NInclusive;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecC14NInclusiveWithComments;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecC14NExclusive;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecC14NExclusiveWithComments;
-int xmlSecC14NExclAddInclNamespaces (xmlNodePtr transformNode,
+XMLSEC_EXPORT int xmlSecC14NExclAddInclNamespaces
+ (xmlNodePtr transformNode,
const xmlChar *prefixList);
/**
* DES transform
*/
#ifndef XMLSEC_NO_DES
-extern xmlSecTransformId xmlSecEncDes3Cbc;
-extern xmlSecTransformId xmlSecKWDes3Cbc;
-extern xmlSecKeyId xmlSecDesKey;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncDes3Cbc;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecKWDes3Cbc;
+XMLSEC_EXPORT_VAR xmlSecKeyId xmlSecDesKey;
-int xmlSecDesKeyGenerate (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecDesKeyGenerate (xmlSecKeyPtr key,
const unsigned char *buf,
size_t size);
#endif /* XMLSEC_NO_DES */
@@ -95,51 +96,51 @@ int xmlSecDesKeyGenerate (xmlSecKeyPtr key,
#ifndef XMLSEC_NO_DSA
#include <openssl/dsa.h>
-extern xmlSecTransformId xmlSecSignDsaSha1;
-extern xmlSecKeyId xmlSecDsaKey;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecSignDsaSha1;
+XMLSEC_EXPORT_VAR xmlSecKeyId xmlSecDsaKey;
-int xmlSecDsaKeyGenerate (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecDsaKeyGenerate (xmlSecKeyPtr key,
DSA *dsa);
#endif /* XMLSEC_NO_DSA */
/**
* Enveloped transform
*/
-extern xmlSecTransformId xmlSecTransformEnveloped;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecTransformEnveloped;
/**
* HMAC transforms
*/
#ifndef XMLSEC_NO_HMAC
-extern xmlSecTransformId xmlSecMacHmacSha1;
-extern xmlSecTransformId xmlSecMacHmacRipeMd160;
-extern xmlSecTransformId xmlSecMacHmacMd5;
-extern xmlSecKeyId xmlSecHmacKey;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecMacHmacSha1;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecMacHmacRipeMd160;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecMacHmacMd5;
+XMLSEC_EXPORT_VAR xmlSecKeyId xmlSecHmacKey;
-int xmlSecHmacKeyGenerate (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecHmacKeyGenerate (xmlSecKeyPtr key,
const unsigned char *buf,
size_t size);
-int xmlSecHmacAddOutputLength (xmlNodePtr transformNode,
+XMLSEC_EXPORT int xmlSecHmacAddOutputLength(xmlNodePtr transformNode,
size_t bitsLen);
#endif /* XMLSEC_NO_HMAC */
#ifndef XMLSEC_NO_RIPEMD160
-extern xmlSecTransformId xmlSecDigestRipemd160;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecDigestRipemd160;
#endif /* XMLSEC_NO_RIPEMD160 */
/**
* RSA transforms
*/
#ifndef XMLSEC_NO_RSA
-extern xmlSecTransformId xmlSecSignRsaSha1;
-extern xmlSecTransformId xmlSecEncRsaPkcs1;
-extern xmlSecTransformId xmlSecEncRsaOaep;
-extern xmlSecKeyId xmlSecRsaKey;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecSignRsaSha1;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncRsaPkcs1;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecEncRsaOaep;
+XMLSEC_EXPORT_VAR xmlSecKeyId xmlSecRsaKey;
-int xmlSecRsaKeyGenerate (xmlSecKeyPtr key,
+XMLSEC_EXPORT int xmlSecRsaKeyGenerate (xmlSecKeyPtr key,
RSA *rsa);
-int xmlSecEncRsaOaepAddParam (xmlNodePtr transformNode,
+XMLSEC_EXPORT int xmlSecEncRsaOaepAddParam(xmlNodePtr transformNode,
const unsigned char *buf,
size_t size);
#endif /* XMLSEC_NO_RSA */
@@ -149,13 +150,30 @@ int xmlSecEncRsaOaepAddParam (xmlNodePtr transformNode,
* SHA1 transform
*/
#ifndef XMLSEC_NO_SHA1
-extern xmlSecTransformId xmlSecDigestSha1;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecDigestSha1;
#endif /* XMLSEC_NO_SHA1 */
/**
- * XPath transform */
-extern xmlSecTransformId xmlSecTransformXPath;
-int xmlSecTransformXPathAdd (xmlNodePtr transformNode,
+ * XPath transform
+ */
+typedef enum _xmlSecXPath2TransformType {
+ xmlSecXPathTransformUnknown = 0,
+ xmlSecXPathTransformIntersect,
+ xmlSecXPathTransformSubtract,
+ xmlSecXPathTransformUnion
+} xmlSecXPath2TransformType;
+
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecTransformXPath;
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecTransformXPath2;
+#ifndef XMLSEC_NO_XPATHALT
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecXPathAlt;
+#endif /* XMLSEC_NO_XPATHALT */
+
+XMLSEC_EXPORT int xmlSecTransformXPathAdd (xmlNodePtr transformNode,
+ const xmlChar *expression,
+ const xmlChar **namespaces);
+XMLSEC_EXPORT int xmlSecTransformXPath2Add(xmlNodePtr transformNode,
+ xmlSecXPath2TransformType type,
const xmlChar *expression,
const xmlChar **namespaces);
@@ -163,8 +181,8 @@ int xmlSecTransformXPathAdd (xmlNodePtr transformNode,
* XSLT transform
*/
#ifndef XMLSEC_NO_XSLT
-extern xmlSecTransformId xmlSecTransformXslt;
-int xmlSecTransformXsltAdd (xmlNodePtr transformNode,
+XMLSEC_EXPORT_VAR xmlSecTransformId xmlSecTransformXslt;
+XMLSEC_EXPORT int xmlSecTransformXsltAdd (xmlNodePtr transformNode,
const xmlChar *xslt);
#endif /* XMLSEC_NO_XSLT */
diff --git a/include/xmlsec/version.h b/include/xmlsec/version.h
new file mode 100644
index 00000000..706fde02
--- /dev/null
+++ b/include/xmlsec/version.h
@@ -0,0 +1,30 @@
+/**
+ * XMLSec library
+ *
+ * Version information
+ *
+ * See Copyright for the status of this software.
+ *
+ * Author: Aleksey Sanin <aleksey@aleksey.com>
+ */
+#ifndef __XMLSEC_VERSION_H__
+#define __XMLSEC_VERSION_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define XMLSEC_VERSION "0.0.6"
+#define XMLSEC_VERSION_MAJOR 0
+#define XMLSEC_VERSION_MINOR 0
+#define XMLSEC_VERSION_SUBMINOR 6
+
+#define XMLSEC_VERSION_INFO "0:6:0"
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __XMLSEC_VERSION_H__ */
+
diff --git a/include/xmlsec/x509.h b/include/xmlsec/x509.h
index 15988bf8..20d0acb6 100644
--- a/include/xmlsec/x509.h
+++ b/include/xmlsec/x509.h
@@ -28,45 +28,45 @@ extern "C" {
typedef struct _xmlSecX509Data *xmlSecX509DataPtr;
typedef struct _xmlSecX509Store *xmlSecX509StorePtr;
-xmlSecX509DataPtr xmlSecX509DataCreate (void);
-void xmlSecX509DataDestroy (xmlSecX509DataPtr x509Data);
-size_t xmlSecX509DataGetCertsNumber (xmlSecX509DataPtr x509Data);
-size_t xmlSecX509DataGetCrlsNumber (xmlSecX509DataPtr x509Data);
-int xmlSecX509DataReadDerCert (xmlSecX509DataPtr x509Data,
- xmlChar *buf,
- size_t size,
- int base64);
-xmlChar* xmlSecX509DataWriteDerCert (xmlSecX509DataPtr x509Data,
- int pos);
-int xmlSecX509DataReadDerCrl (xmlSecX509DataPtr x509Data,
- xmlChar *buf,
- size_t size,
- int base64);
-xmlChar* xmlSecX509DataWriteDerCrl (xmlSecX509DataPtr x509Data,
- int pos);
-int xmlSecX509DataReadPemCert (xmlSecX509DataPtr x509Data,
- const char *filename);
-xmlSecX509DataPtr xmlSecX509DataDup (xmlSecX509DataPtr x509Data);
-xmlSecKeyPtr xmlSecX509DataCreateKey (xmlSecX509DataPtr x509Data);
-void xmlSecX509DataDebugDump (xmlSecX509DataPtr x509Data,
- FILE *output);
+XMLSEC_EXPORT xmlSecX509DataPtr xmlSecX509DataCreate (void);
+XMLSEC_EXPORT void xmlSecX509DataDestroy (xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT size_t xmlSecX509DataGetCertsNumber (xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT size_t xmlSecX509DataGetCrlsNumber (xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT int xmlSecX509DataReadDerCert (xmlSecX509DataPtr x509Data,
+ xmlChar *buf,
+ size_t size,
+ int base64);
+XMLSEC_EXPORT xmlChar* xmlSecX509DataWriteDerCert (xmlSecX509DataPtr x509Data,
+ int pos);
+XMLSEC_EXPORT int xmlSecX509DataReadDerCrl (xmlSecX509DataPtr x509Data,
+ xmlChar *buf,
+ size_t size,
+ int base64);
+XMLSEC_EXPORT xmlChar* xmlSecX509DataWriteDerCrl (xmlSecX509DataPtr x509Data,
+ int pos);
+XMLSEC_EXPORT int xmlSecX509DataReadPemCert (xmlSecX509DataPtr x509Data,
+ const char *filename);
+XMLSEC_EXPORT xmlSecX509DataPtr xmlSecX509DataDup (xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT xmlSecKeyPtr xmlSecX509DataCreateKey (xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT void xmlSecX509DataDebugDump (xmlSecX509DataPtr x509Data,
+ FILE *output);
-xmlSecX509StorePtr xmlSecX509StoreCreate (void);
-void xmlSecX509StoreDestroy (xmlSecX509StorePtr store);
-xmlSecX509DataPtr xmlSecX509StoreFind (xmlSecX509StorePtr store,
- xmlChar *subjectName,
- xmlChar *issuerName,
- xmlChar *issuerSerial,
- xmlChar *skit,
- xmlSecX509DataPtr x509Data);
-int xmlSecX509StoreVerify (xmlSecX509StorePtr store,
- xmlSecX509DataPtr x509Data);
-int xmlSecX509StoreLoadPemCert (xmlSecX509StorePtr store,
- const char *filename,
- int trusted);
-int xmlSecX509StoreAddCertsDir (xmlSecX509StorePtr store,
- const char *path);
+XMLSEC_EXPORT xmlSecX509StorePtr xmlSecX509StoreCreate (void);
+XMLSEC_EXPORT void xmlSecX509StoreDestroy (xmlSecX509StorePtr store);
+XMLSEC_EXPORT xmlSecX509DataPtr xmlSecX509StoreFind (xmlSecX509StorePtr store,
+ xmlChar *subjectName,
+ xmlChar *issuerName,
+ xmlChar *issuerSerial,
+ xmlChar *skit,
+ xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT int xmlSecX509StoreVerify (xmlSecX509StorePtr store,
+ xmlSecX509DataPtr x509Data);
+XMLSEC_EXPORT int xmlSecX509StoreLoadPemCert (xmlSecX509StorePtr store,
+ const char *filename,
+ int trusted);
+XMLSEC_EXPORT int xmlSecX509StoreAddCertsDir (xmlSecX509StorePtr store,
+ const char *path);
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/xmlsec/xmldsig.h b/include/xmlsec/xmldsig.h
index 1f262fba..80455159 100644
--- a/include/xmlsec/xmldsig.h
+++ b/include/xmlsec/xmldsig.h
@@ -49,6 +49,7 @@ typedef struct _xmlSecDSigCtx {
* just before digesting
* (ignored if processManifest is 0)
*/
+ int fakeSignatures; /* for performance testing only! */
} xmlSecDSigCtx;
/**
@@ -95,40 +96,40 @@ typedef struct _xmlSecReferenceResult {
/**
* DSig context methods
*/
-xmlSecDSigCtxPtr xmlSecDSigCtxCreate (xmlSecKeysMngrPtr keysMngr);
-void xmlSecDSigCtxDestroy (xmlSecDSigCtxPtr ctx);
+XMLSEC_EXPORT xmlSecDSigCtxPtr xmlSecDSigCtxCreate (xmlSecKeysMngrPtr keysMngr);
+XMLSEC_EXPORT void xmlSecDSigCtxDestroy (xmlSecDSigCtxPtr ctx);
/**
* Creating DSig template
*/
-xmlNodePtr xmlSecSignatureCreate (const xmlChar *id);
-void xmlSecSignatureDestroy (xmlNodePtr signNode);
-xmlNodePtr xmlSecSignatureAddSignedInfo (xmlNodePtr signNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecSignatureCreate (const xmlChar *id);
+XMLSEC_EXPORT void xmlSecSignatureDestroy (xmlNodePtr signNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecSignatureAddSignedInfo (xmlNodePtr signNode,
const xmlChar *id);
-xmlNodePtr xmlSecSignatureAddKeyInfo (xmlNodePtr signNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecSignatureAddKeyInfo (xmlNodePtr signNode,
const xmlChar *id);
-xmlNodePtr xmlSecSignatureAddObject (xmlNodePtr signNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecSignatureAddObject (xmlNodePtr signNode,
const xmlChar *id,
const xmlChar *mimeType,
const xmlChar *encoding);
-xmlNodePtr xmlSecSignedInfoAddC14NMethod (xmlNodePtr signedInfoNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecSignedInfoAddC14NMethod (xmlNodePtr signedInfoNode,
xmlSecTransformId encMethod);
-xmlNodePtr xmlSecSignedInfoAddSignMethod (xmlNodePtr signedInfoNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecSignedInfoAddSignMethod (xmlNodePtr signedInfoNode,
xmlSecTransformId encMethod);
-xmlNodePtr xmlSecSignedInfoAddReference (xmlNodePtr signedInfoNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecSignedInfoAddReference (xmlNodePtr signedInfoNode,
const xmlChar *id,
const xmlChar *uri,
const xmlChar *type);
-xmlNodePtr xmlSecReferenceAddDigestMethod (xmlNodePtr refNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecReferenceAddDigestMethod (xmlNodePtr refNode,
xmlSecTransformId digestMethod);
-xmlNodePtr xmlSecReferenceAddTransform (xmlNodePtr refNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecReferenceAddTransform (xmlNodePtr refNode,
xmlSecTransformId transform);
-xmlNodePtr xmlSecObjectAddSignProperties (xmlNodePtr objectNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecObjectAddSignProperties (xmlNodePtr objectNode,
const xmlChar *id,
const xmlChar *target);
-xmlNodePtr xmlSecObjectAddManifest (xmlNodePtr objectNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecObjectAddManifest (xmlNodePtr objectNode,
const xmlChar *id);
-xmlNodePtr xmlSecManifestAddReference (xmlNodePtr manifestNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecManifestAddReference (xmlNodePtr manifestNode,
const xmlChar *id,
const xmlChar *uri,
const xmlChar *type);
@@ -136,12 +137,12 @@ xmlNodePtr xmlSecManifestAddReference (xmlNodePtr manifestNode,
/**
* DSig generation/validation
*/
-int xmlSecDSigValidate (xmlSecDSigCtxPtr ctx,
+XMLSEC_EXPORT int xmlSecDSigValidate (xmlSecDSigCtxPtr ctx,
void *context,
xmlSecKeyPtr key,
xmlNodePtr signNode,
xmlSecDSigResultPtr *result);
-int xmlSecDSigGenerate (xmlSecDSigCtxPtr ctx,
+XMLSEC_EXPORT int xmlSecDSigGenerate (xmlSecDSigCtxPtr ctx,
void *context,
xmlSecKeyPtr key,
xmlNodePtr signNode,
@@ -149,15 +150,14 @@ int xmlSecDSigGenerate (xmlSecDSigCtxPtr ctx,
/**
* DSig results methods
*/
-xmlSecDSigResultPtr xmlSecDSigResultCreate (const xmlSecDSigCtxPtr ctx,
+XMLSEC_EXPORT xmlSecDSigResultPtr xmlSecDSigResultCreate (xmlSecDSigCtxPtr ctx,
void *context,
xmlNodePtr signNode,
int sign);
-void xmlSecDSigResultDestroy (xmlSecDSigResultPtr result);
-void xmlSecDSigResultDebugDump (xmlSecDSigResultPtr result,
+XMLSEC_EXPORT void xmlSecDSigResultDestroy (xmlSecDSigResultPtr result);
+XMLSEC_EXPORT void xmlSecDSigResultDebugDump (xmlSecDSigResultPtr result,
FILE *output);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/xmlsec/xmlenc.h b/include/xmlsec/xmlenc.h
index b95b0e1c..a578544f 100644
--- a/include/xmlsec/xmlenc.h
+++ b/include/xmlsec/xmlenc.h
@@ -29,8 +29,8 @@ extern "C" {
typedef struct _xmlSecEncCtx *xmlSecEncCtxPtr;
typedef struct _xmlSecEncResult *xmlSecEncResultPtr;
-extern const xmlChar xmlSecEncTypeElement[]; /* "http://www.w3.org/2001/04/xmlenc#Element"; */
-extern const xmlChar xmlSecEncTypeContent[]; /* "http://www.w3.org/2001/04/xmlenc#Content"; */
+XMLSEC_EXPORT_VAR const xmlChar xmlSecEncTypeElement[]; /* "http://www.w3.org/2001/04/xmlenc#Element"; */
+XMLSEC_EXPORT_VAR const xmlChar xmlSecEncTypeContent[]; /* "http://www.w3.org/2001/04/xmlenc#Content"; */
/**
* XML Encrypiton context
@@ -66,27 +66,27 @@ typedef struct _xmlSecEncResult {
/**
* XML Encrypiton context methods
*/
-xmlSecEncCtxPtr xmlSecEncCtxCreate (xmlSecKeysMngrPtr keysMngr);
-void xmlSecEncCtxDestroy (xmlSecEncCtxPtr ctx);
+XMLSEC_EXPORT xmlSecEncCtxPtr xmlSecEncCtxCreate (xmlSecKeysMngrPtr keysMngr);
+XMLSEC_EXPORT void xmlSecEncCtxDestroy (xmlSecEncCtxPtr ctx);
/**
* Encryption
*/
-int xmlSecEncryptMemory (xmlSecEncCtxPtr ctx,
+XMLSEC_EXPORT int xmlSecEncryptMemory (xmlSecEncCtxPtr ctx,
void *context,
xmlSecKeyPtr key,
xmlNodePtr encNode,
const unsigned char *buf,
size_t size,
xmlSecEncResultPtr *result);
-int xmlSecEncryptUri (xmlSecEncCtxPtr ctx,
+XMLSEC_EXPORT int xmlSecEncryptUri (xmlSecEncCtxPtr ctx,
void *context,
xmlSecKeyPtr key,
xmlNodePtr encNode,
const char *uri,
xmlSecEncResultPtr *result);
-int xmlSecEncryptXmlNode (xmlSecEncCtxPtr ctx,
+XMLSEC_EXPORT int xmlSecEncryptXmlNode (xmlSecEncCtxPtr ctx,
void *context,
xmlSecKeyPtr key,
xmlNodePtr encNode,
@@ -95,7 +95,7 @@ int xmlSecEncryptXmlNode (xmlSecEncCtxPtr ctx,
/**
* Decryption
*/
-int xmlSecDecrypt (xmlSecEncCtxPtr ctx,
+XMLSEC_EXPORT int xmlSecDecrypt (xmlSecEncCtxPtr ctx,
void *context,
xmlSecKeyPtr key,
xmlNodePtr encDataNode,
@@ -103,34 +103,38 @@ int xmlSecDecrypt (xmlSecEncCtxPtr ctx,
/**
* XML Enc Result
*/
-xmlSecEncResultPtr xmlSecEncResultCreate (xmlSecEncCtxPtr ctx,
+XMLSEC_EXPORT xmlSecEncResultPtr xmlSecEncResultCreate (xmlSecEncCtxPtr ctx,
void *context,
int encrypt,
xmlNodePtr node);
-void xmlSecEncResultDestroy (xmlSecEncResultPtr result);
-void xmlSecEncResultDebugDump (xmlSecEncResultPtr result,
+XMLSEC_EXPORT void xmlSecEncResultDestroy (xmlSecEncResultPtr result);
+XMLSEC_EXPORT void xmlSecEncResultDebugDump(xmlSecEncResultPtr result,
FILE *output);
/**
* Encryption Template
*/
-xmlNodePtr xmlSecEncDataCreate (const xmlChar *id,
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataCreate (const xmlChar *id,
const xmlChar *type,
const xmlChar *mimeType,
const xmlChar *encoding);
-void xmlSecEncDataDestroy (xmlNodePtr encNode);
-xmlNodePtr xmlSecEncDataAddEncMethod (xmlNodePtr encNode,
+XMLSEC_EXPORT void xmlSecEncDataDestroy (xmlNodePtr encNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataAddEncMethod(xmlNodePtr encNode,
xmlSecTransformId encMethod);
-xmlNodePtr xmlSecEncDataAddKeyInfo (xmlNodePtr encNode);
-xmlNodePtr xmlSecEncDataAddEncProperties (xmlNodePtr encNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataAddKeyInfo (xmlNodePtr encNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataAddEncProperties
+ (xmlNodePtr encNode,
const xmlChar *id);
-xmlNodePtr xmlSecEncDataAddEncProperty (xmlNodePtr encNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataAddEncProperty
+ (xmlNodePtr encNode,
const xmlChar *id,
const xmlChar *target);
-xmlNodePtr xmlSecEncDataAddCipherValue (xmlNodePtr encNode);
-xmlNodePtr xmlSecEncDataAddCipherReference (xmlNodePtr encNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataAddCipherValue
+ (xmlNodePtr encNode);
+XMLSEC_EXPORT xmlNodePtr xmlSecEncDataAddCipherReference
+ (xmlNodePtr encNode,
const xmlChar *uri);
-xmlNodePtr xmlSecCipherReferenceAddTransform(xmlNodePtr encNode,
+XMLSEC_EXPORT xmlNodePtr xmlSecCipherReferenceAddTransform(xmlNodePtr encNode,
xmlSecTransformId transform);
#ifdef __cplusplus
diff --git a/include/xmlsec/xmlsec.h b/include/xmlsec/xmlsec.h
index 76b44ed9..1546b892 100644
--- a/include/xmlsec/xmlsec.h
+++ b/include/xmlsec/xmlsec.h
@@ -17,18 +17,36 @@ extern "C" {
#include <xmlsec/version.h>
+#ifndef XMLSEC_EXPORT
+#if defined(_MSC_VER)
+#if defined(IN_XMLSEC)
+#define XMLSEC_EXPORT __declspec(dllexport) extern
+#define XMLSEC_EXPORT_VAR extern
+#else /* defined(IN_XMLSEC) */
+#define XMLSEC_EXPORT extern
+#define XMLSEC_EXPORT_VAR __declspec(dllimport) extern
+#endif /* defined(IN_XMLSEC) */
+#else /* defined(_MSC_VER) */
+#define XMLSEC_EXPORT
+#define XMLSEC_EXPORT_VAR extern
+#endif /* defined(_MSC_VER) */
+#endif /* defined(_MSC_VER) */
+
+
/* XMLDSig namespace */
-extern const xmlChar xmlSecDSigNs[];
+XMLSEC_EXPORT_VAR const xmlChar xmlSecDSigNs[];
/* XMLEnc namespace */
-extern const xmlChar xmlSecEncNs[];
+XMLSEC_EXPORT_VAR const xmlChar xmlSecEncNs[];
/* XMLSec namespace */
-extern const xmlChar xmlSecNs[];
+XMLSEC_EXPORT_VAR const xmlChar xmlSecNs[];
+/* XPath2 transform namespace */
+XMLSEC_EXPORT_VAR const xmlChar xmlSecXPath2[];
-void xmlSecInit (void);
-void xmlSecShutdown (void);
+XMLSEC_EXPORT void xmlSecInit (void);
+XMLSEC_EXPORT void xmlSecShutdown (void);
#define xmlSecIsHex(c) \
@@ -59,9 +77,12 @@ void xmlSecShutdown (void);
#define ATTRIBUTE_UNUSED
#endif
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __XMLSEC_H__ */
+
diff --git a/include/xmlsec/xmltree.h b/include/xmlsec/xmltree.h
index 527d7aee..60b6ea36 100644
--- a/include/xmlsec/xmltree.h
+++ b/include/xmlsec/xmltree.h
@@ -19,48 +19,51 @@ extern "C" {
#include <xmlsec/xmlsec.h>
-xmlDocPtr xmlSecParseFile (const char *filename);
-xmlDocPtr xmlSecParseMemory (const unsigned char *buffer,
+XMLSEC_EXPORT xmlDocPtr xmlSecParseFile (const char *filename);
+XMLSEC_EXPORT xmlDocPtr xmlSecParseMemory (const unsigned char *buffer,
size_t size,
int recovery);
-xmlDocPtr xmlSecParseMemoryExt (const unsigned char *prefix,
+XMLSEC_EXPORT xmlDocPtr xmlSecParseMemoryExt (const unsigned char *prefix,
size_t prefixSize,
const unsigned char *buffer,
size_t bufferSize,
const unsigned char *postfix,
size_t postfixSize);
-int xmlSecCheckNodeName (const xmlNodePtr cur,
+XMLSEC_EXPORT int xmlSecCheckNodeName (const xmlNodePtr cur,
const xmlChar *name,
const xmlChar *ns);
-xmlNodePtr xmlSecGetNextElementNode (xmlNodePtr cur);
-xmlNodePtr xmlSecFindChild (const xmlNodePtr parent,
+XMLSEC_EXPORT xmlNodePtr xmlSecGetNextElementNode(xmlNodePtr cur);
+XMLSEC_EXPORT xmlNodePtr xmlSecFindChild (const xmlNodePtr parent,
const xmlChar *name,
const xmlChar *ns);
-xmlNodePtr xmlSecFindNode (const xmlNodePtr parent,
+XMLSEC_EXPORT xmlNodePtr xmlSecFindParent (const xmlNodePtr cur,
+ const xmlChar *name,
+ const xmlChar *ns);
+XMLSEC_EXPORT xmlNodePtr xmlSecFindNode (const xmlNodePtr parent,
const xmlChar *name,
const xmlChar *ns);
-xmlNodePtr xmlSecFindNodeById (const xmlNodePtr parent,
+XMLSEC_EXPORT xmlNodePtr xmlSecFindNodeById (const xmlNodePtr parent,
const xmlChar *id);
-xmlNodeSetPtr xmlSecGetChildNodeSet (const xmlNodePtr parent,
+XMLSEC_EXPORT xmlNodeSetPtr xmlSecGetChildNodeSet (const xmlNodePtr parent,
xmlNodeSetPtr nodeSet,
int withComments);
-xmlNodePtr xmlSecAddChild (xmlNodePtr parent,
+XMLSEC_EXPORT xmlNodePtr xmlSecAddChild (xmlNodePtr parent,
const xmlChar *name,
const xmlChar *ns);
-xmlNodePtr xmlSecAddNextSibling (xmlNodePtr node,
+XMLSEC_EXPORT xmlNodePtr xmlSecAddNextSibling (xmlNodePtr node,
const xmlChar *name,
const xmlChar *ns);
-xmlNodePtr xmlSecAddPrevSibling (xmlNodePtr node,
+XMLSEC_EXPORT xmlNodePtr xmlSecAddPrevSibling (xmlNodePtr node,
const xmlChar *name,
const xmlChar *ns);
-int xmlSecReplaceNode (xmlNodePtr node,
+XMLSEC_EXPORT int xmlSecReplaceNode (xmlNodePtr node,
xmlNodePtr newNode);
-int xmlSecReplaceContent (xmlNodePtr node,
+XMLSEC_EXPORT int xmlSecReplaceContent (xmlNodePtr node,
xmlNodePtr newNode);
-int xmlSecReplaceNodeBuffer (xmlNodePtr node,
+XMLSEC_EXPORT int xmlSecReplaceNodeBuffer (xmlNodePtr node,
const unsigned char *buffer,
size_t size);
diff --git a/include/xmlsec/xpath.h b/include/xmlsec/xpath.h
index 55324093..118b89d8 100644
--- a/include/xmlsec/xpath.h
+++ b/include/xmlsec/xpath.h
@@ -18,8 +18,8 @@ extern "C" {
#include <xmlsec/xmlsec.h>
-void xmlSecXPathHereFunction (xmlXPathParserContextPtr ctxt,
- int nargs);
+XMLSEC_EXPORT void xmlSecXPathHereFunction (xmlXPathParserContextPtr ctxt,
+ int nargs);
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/src/Makefile.am b/src/Makefile.am
index 3b37c34e..66defb96 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,6 +14,7 @@ libxmlsec_la_SOURCES =\
xmlsec.c \
xmltree.c \
bn.c \
+debug.c \
transforms.c \
keys.c \
keyinfo.c \
@@ -38,6 +39,7 @@ xmldsig.c \
des.c \
aes.c \
xmlenc.c \
+xpathalt.c \
$(NULL)
diff --git a/src/base64.c b/src/base64.c
index d1f57857..8c08e100 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -83,7 +83,7 @@ static int xmlSecBase64CtxDecode (xmlSecBase64CtxPtr ctx);
-static xmlSecTransformPtr xmlSecBase64Create (const xmlSecTransformId id);
+static xmlSecTransformPtr xmlSecBase64Create (xmlSecTransformId id);
static void xmlSecBase64Destroy (xmlSecTransformPtr transform);
static int xmlSecBase64Update (xmlSecCipherTransformPtr transform,
const unsigned char *buf,
@@ -184,7 +184,7 @@ xmlSecBase64EncodeSetLineSize(xmlSecTransformPtr transform, size_t lineSize) {
* if an error occurs.
*/
static xmlSecTransformPtr
-xmlSecBase64Create(const xmlSecTransformId id) {
+xmlSecBase64Create(xmlSecTransformId id) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecBase64Create";
xmlSecCipherTransformPtr cipher;
int encode;
diff --git a/src/debug.c b/src/debug.c
new file mode 100644
index 00000000..7dc9aec6
--- /dev/null
+++ b/src/debug.c
@@ -0,0 +1,42 @@
+/**
+ * XMLSec library
+ *
+ *
+ * See Copyright for the status of this software.
+ *
+ * Author: Aleksey Sanin <aleksey@aleksey.com>
+ */
+#include "globals.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include <libxml/tree.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/debug.h>
+
+static clock_t totalTime = 0;
+static clock_t startTime = 0;
+
+void
+xmlSecTimerInit(void) {
+ totalTime = 0;
+}
+
+void
+xmlSecTimerStart(void) {
+ startTime = clock();
+}
+
+void
+xmlSecTimerEnd(void) {
+ totalTime += clock() - startTime;
+}
+
+double
+xmlSecTimerGet(void) {
+ return((double)totalTime / (CLOCKS_PER_SEC / 1000));
+}
+
diff --git a/src/dsa.c b/src/dsa.c
index f0791bfb..f7d8e30c 100644
--- a/src/dsa.c
+++ b/src/dsa.c
@@ -107,7 +107,7 @@ xmlSecTransformId xmlSecSignDsaSha1 = (xmlSecTransformId)&xmlSecSignDsaSha1Id;
#define XMLSEC_DSA_SHA1_HALF_DIGEST_SIZE 20
-#define xmlSecDsaKey( k ) ((DSA*)(( k )->keyData))
+#define xmlSecGetDsaKey( k ) ((DSA*)(( k )->keyData))
/**
* DSA transform
@@ -396,7 +396,7 @@ xmlSecSignDsaSha1AddKey (xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
}
digest = (xmlSecDigestTransformPtr)transform;
- if(xmlSecDsaKey(key) == NULL) {
+ if(xmlSecGetDsaKey(key) == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: key dsa data is null\n",
@@ -405,7 +405,7 @@ xmlSecSignDsaSha1AddKey (xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
return(-1);
}
- dsa = xmlSecDsaDup(xmlSecDsaKey(key));
+ dsa = xmlSecDsaDup(xmlSecGetDsaKey(key));
if(dsa == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -439,8 +439,11 @@ DSA* xmlSecDsaDup(DSA *dsa) {
return(NULL);
}
- /* todo: increment reference counter nstead of coping */
-
+ /* increment reference counter instead of coping */
+#ifdef XMLSEC_OPENSSL097
+ DSA_up_ref(dsa);
+ newDsa = dsa;
+#else /* XMLSEC_OPENSSL097 */
newDsa = DSA_new();
if(newDsa == NULL) {
#ifdef XMLSEC_DEBUG
@@ -466,6 +469,7 @@ DSA* xmlSecDsaDup(DSA *dsa) {
if(dsa->pub_key != NULL) {
newDsa->pub_key = BN_dup(dsa->pub_key);
}
+#endif /* XMLSEC_OPENSSL097 */
return(newDsa);
}
@@ -521,8 +525,8 @@ xmlSecDsaKeyDestroy(xmlSecKeyPtr key) {
return;
}
- if(xmlSecDsaKey(key) != NULL) {
- DSA_free(xmlSecDsaKey(key));
+ if(xmlSecGetDsaKey(key) != NULL) {
+ DSA_free(xmlSecGetDsaKey(key));
}
memset(key, 0, sizeof(struct _xmlSecKey));
xmlFree(key);
@@ -552,8 +556,8 @@ xmlSecDsaKeyDuplicate(xmlSecKeyPtr key) {
return(NULL);
}
- if(xmlSecDsaKey(key) != NULL) {
- newKey->keyData = xmlSecDsaDup(xmlSecDsaKey(key));
+ if(xmlSecGetDsaKey(key) != NULL) {
+ newKey->keyData = xmlSecDsaDup(xmlSecGetDsaKey(key));
if(newKey->keyData == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -563,7 +567,7 @@ xmlSecDsaKeyDuplicate(xmlSecKeyPtr key) {
xmlSecKeyDestroy(newKey);
return(NULL);
}
- if(xmlSecDsaKey(newKey)->priv_key != NULL) {
+ if(xmlSecGetDsaKey(newKey)->priv_key != NULL) {
newKey->type = xmlSecKeyTypePrivate;
} else {
newKey->type = xmlSecKeyTypePublic;
@@ -628,8 +632,8 @@ xmlSecDsaKeyGenerate(xmlSecKeyPtr key, DSA *dsa) {
}
- if(xmlSecDsaKey(key) != NULL) {
- DSA_free(xmlSecDsaKey(key));
+ if(xmlSecGetDsaKey(key) != NULL) {
+ DSA_free(xmlSecGetDsaKey(key));
}
key->keyData = dsa;
if(dsa->priv_key != NULL) {
@@ -860,8 +864,8 @@ xmlSecDsaKeyRead(xmlSecKeyPtr key, xmlNodePtr node) {
return(-1);
}
- if(xmlSecDsaKey(key) != NULL) {
- DSA_free(xmlSecDsaKey(key));
+ if(xmlSecGetDsaKey(key) != NULL) {
+ DSA_free(xmlSecGetDsaKey(key));
}
key->keyData = dsa;
if(privateKey) {
@@ -905,7 +909,7 @@ xmlSecDsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecDsaKey(key)->p, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetDsaKey(key)->p, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -925,7 +929,7 @@ xmlSecDsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecDsaKey(key)->q, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetDsaKey(key)->q, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -945,7 +949,7 @@ xmlSecDsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecDsaKey(key)->g, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetDsaKey(key)->g, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -967,7 +971,7 @@ xmlSecDsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecDsaKey(key)->priv_key, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetDsaKey(key)->priv_key, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -988,7 +992,7 @@ xmlSecDsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecDsaKey(key)->pub_key, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetDsaKey(key)->pub_key, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
diff --git a/src/enveloped.c b/src/enveloped.c
index b06f4495..43fcd74f 100644
--- a/src/enveloped.c
+++ b/src/enveloped.c
@@ -171,6 +171,7 @@ xmlSecTransformEnvelopedReadNode(xmlSecTransformPtr transform, xmlNodePtr transf
* MUST produce output in exactly the same manner as the XPath transform
* parameterized by the XPath expression above.
*/
+#ifdef XMLSEC_NO_OPT_ENVELOPED
static int
xmlSecTransformEnvelopedExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
xmlDocPtr *doc, xmlNodeSetPtr *nodes) {
@@ -263,4 +264,115 @@ xmlSecTransformEnvelopedExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDo
xmlXPathFreeObject(xpath);
return(0);
}
+#else /* XMLSEC_NO_OPT_ENVELOPED */
+
+static xmlNodeSetPtr xmlSecEnvelopedRemoveTree (xmlNodeSetPtr nodes,
+ xmlNodePtr cur);
+static int
+xmlSecTransformEnvelopedExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
+ xmlDocPtr *doc, xmlNodeSetPtr *nodes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformEnvelopedExecute";
+ int allocated = 0;
+ xmlSecXmlTransformPtr xmlTransform;
+ xmlNodePtr signature;
+
+ if(!xmlSecTransformCheckId(transform, xmlSecTransformEnveloped) ||
+ (nodes == NULL) || (doc == NULL) || ((*doc) == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transform is invalid or something else is null\n",
+ func);
+#endif
+ return(-1);
+ }
+ xmlTransform = (xmlSecXmlTransformPtr)transform;
+
+ if(((*doc) != ctxDoc) || (xmlTransform->here == NULL) ||
+ (xmlTransform->here->doc != (*doc))) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: enveloped transform works only on the same document\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ signature = xmlSecFindParent(xmlTransform->here, BAD_CAST "Signature", xmlSecDSigNs);
+ if(signature == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: \"Signature\" node is not found\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ if((*nodes) == NULL) {
+ xmlNodeSetPtr tmp;
+ xmlNodePtr cur;
+
+ for(cur = (*doc)->children; cur != NULL; cur = cur->next) {
+ tmp = xmlSecGetChildNodeSet(cur, (*nodes), 1);
+ if(tmp == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to create nodes set\n",
+ func);
+#endif
+ if((*nodes) != NULL) {
+ xmlXPathFreeNodeSet(*nodes);
+ }
+ return(-1);
+ }
+ (*nodes) = tmp;
+ }
+ allocated = 1;
+ }
+
+ if(xmlSecEnvelopedRemoveTree((*nodes), signature) == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: operation failed\n",
+ func);
+#endif
+ if(allocated) {
+ xmlXPathFreeNodeSet(*nodes);
+ }
+ return(-1);
+
+ }
+ return(0);
+}
+
+static xmlNodeSetPtr
+xmlSecEnvelopedRemoveTree(xmlNodeSetPtr nodes, xmlNodePtr cur) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecEnvelopedRemoveTree";
+
+ if((nodes == NULL) || (cur == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: nodes or cur is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ xmlXPathNodeSetDel(nodes, cur);
+ if(cur->type == XML_ELEMENT_NODE) {
+ for(cur = cur->children; cur != NULL; cur = cur->next) {
+ if(xmlSecEnvelopedRemoveTree(nodes, cur) == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: children failed\n",
+ func);
+#endif
+ return(NULL);
+ }
+ }
+ }
+ return(nodes);
+}
+
+#endif /* XMLSEC_NO_OPT_ENVELOPED */
+
diff --git a/src/io.c b/src/io.c
index bce8cf15..9e6b3a44 100644
--- a/src/io.c
+++ b/src/io.c
@@ -12,7 +12,9 @@
#include <stdlib.h>
#include <string.h>
+#include <libxml/uri.h>
#include <libxml/tree.h>
+#include <libxml/xmlIO.h>
#ifdef LIBXML_HTTP_ENABLED
#include <libxml/nanohttp.h>
@@ -30,14 +32,30 @@
#include <xmlsec/io.h>
+
+/*
+ * Input I/O callback sets
+ */
+typedef struct _xmlSecInputCallback {
+ xmlInputMatchCallback matchcallback;
+ xmlInputOpenCallback opencallback;
+ xmlInputReadCallback readcallback;
+ xmlInputCloseCallback closecallback;
+} xmlSecInputCallback, *xmlSecInputCallbackPtr;
+
+#define MAX_INPUT_CALLBACK 15
+
+static xmlSecInputCallback xmlSecInputCallbackTable[MAX_INPUT_CALLBACK];
+static int xmlSecInputCallbackNr = 0;
+static int xmlSecInputCallbackInitialized = 0;
+
+
+
static xmlSecTransformPtr xmlSecInputUriTransformCreate (xmlSecTransformId id);
static void xmlSecInputUriTransformDestroy (xmlSecTransformPtr transform);
static int xmlSecInputUriTransformRead (xmlSecBinTransformPtr transform,
unsigned char *buf,
size_t size);
-static int xmlSecFileRead (FILE *f,
- unsigned char *buf,
- size_t size);
static const struct _xmlSecBinTransformId xmlSecInputUriTransformId = {
/* same as xmlSecTransformId */
@@ -61,97 +79,16 @@ static const struct _xmlSecBinTransformId xmlSecInputUriTransformId = {
};
xmlSecTransformId xmlSecInputUri = (xmlSecTransformId)&xmlSecInputUriTransformId;
-typedef struct _xmlSecInputUriTransform {
- /* same as for xmlSecTransform */
- xmlSecBinTransformId id;
- xmlSecTransformStatus status;
- int dontDestroy;
- void *data;
-
- /* xmlSecBinTransform specific */
- int encode;
- int finished;
- xmlSecBinTransformPtr next;
- xmlSecBinTransformPtr prev;
- void *binData;
-
- /* xmlSecInputUriTransform specific */
- xmlSecInputUriTransformReadCallback readInputUri;
- xmlSecInputUriTransformCloseCallback closeInputUri;
-} xmlSecInputUriTransform, *xmlSecInputUriTransformPtr;
-
-
-/**
- * xmlSecInputUriTransformOpen:
- *
- */
-int
-xmlSecInputUriTransformOpen(xmlSecTransformPtr transform, const char *uri) {
- static const char func[] ATTRIBUTE_UNUSED = "xmlSecInputUriTransformOpen";
- xmlSecInputUriTransformPtr t;
-
- if(!xmlSecTransformCheckId(transform, xmlSecInputUri) || (uri == NULL)) {
-#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: transform is invalid or uri == NULL\n",
- func);
-#endif
- return(-1);
- }
-
- t = (xmlSecInputUriTransformPtr)transform;
- /* todo: add an ability to use custom protocol handlers */
-#ifdef LIBXML_HTTP_ENABLED
- if(strncmp(uri, "http://", 7) == 0) {
- t->data = xmlNanoHTTPOpen(uri, NULL);
- t->readInputUri = (xmlSecInputUriTransformReadCallback)xmlNanoHTTPRead;
- t->closeInputUri = (xmlSecInputUriTransformCloseCallback)xmlNanoHTTPClose;
- } else
-#endif /* LIBXML_HTTP_ENABLED */
-
-#ifdef LIBXML_FTP_ENABLED
- if(strncmp(uri, "ftp://", 6) == 0) {
- t->data = xmlNanoFTPOpen(uri);
- t->readInputUri = (xmlSecInputUriTransformReadCallback)xmlNanoFTPRead;
- t->closeInputUri = (xmlSecInputUriTransformCloseCallback)xmlNanoFTPClose;
- } else
-#endif /* LIBXML_FTP_ENABLED */
-
- {
- FILE *fd;
- const char *path = NULL;
-
- /* try to open local file */
- if(strncmp(uri, "file://localhost", 16) == 0) {
- path = &uri[16];
- } else if(strncmp(uri, "file:///", 8) == 0) {
-#if defined (_WIN32) && !defined(__CYGWIN__)
- path = &uri[8];
-#else
- path = &uri[7];
-#endif
- } else {
- path = uri;
- }
-#if defined(WIN32) || defined (__CYGWIN__)
- fd = fopen(path, "rb");
-#else
- fd = fopen(path, "r");
-#endif /* WIN32 */
- t->data = fd;
- t->readInputUri = (xmlSecInputUriTransformReadCallback)xmlSecFileRead;
- t->closeInputUri = (xmlSecInputUriTransformCloseCallback)fclose;
- }
-
- if(t->data == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "%s: unable to open file \"%s\"\n",
- func, uri);
- return(-1);
- }
-
- return(0);
-}
+#define xmlSecInputUriTransformReadClbk( t ) \
+ ( ( (xmlSecTransformCheckId(t, xmlSecInputUri)) && \
+ ( (t)->binData != NULL ) ) ? \
+ ((xmlSecInputCallbackPtr)(t)->binData)->readcallback : \
+ NULL )
+#define xmlSecInputUriTransformCloseClbk( t ) \
+ ( ( (xmlSecTransformCheckId(t, xmlSecInputUri)) && \
+ ( (t)->binData != NULL ) ) ? \
+ ((xmlSecInputCallbackPtr)(t)->binData)->closecallback : \
+ NULL )
/**
* xmlSecInputUriTransformCreate:
@@ -162,7 +99,7 @@ xmlSecInputUriTransformOpen(xmlSecTransformPtr transform, const char *uri) {
static xmlSecTransformPtr
xmlSecInputUriTransformCreate(xmlSecTransformId id) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecInputUriTransformCreate";
- xmlSecInputUriTransformPtr ptr;
+ xmlSecBinTransformPtr ptr;
if((id == NULL) || (id != xmlSecInputUri)){
#ifdef XMLSEC_DEBUG
@@ -174,18 +111,18 @@ xmlSecInputUriTransformCreate(xmlSecTransformId id) {
}
/*
- * Allocate a new xmlSecInputUriTransform and fill the fields.
+ * Allocate a new xmlSecBinTransform and fill the fields.
*/
- ptr = (xmlSecInputUriTransformPtr) xmlMalloc(sizeof(xmlSecInputUriTransform));
+ ptr = (xmlSecBinTransformPtr) xmlMalloc(sizeof(xmlSecBinTransform));
if(ptr == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
- "%s: xmlSecInputUriTransform malloc failed\n",
+ "%s: xmlSecBinTransform malloc failed\n",
func);
#endif
return(NULL);
}
- memset(ptr, 0, sizeof(xmlSecInputUriTransform));
+ memset(ptr, 0, sizeof(xmlSecBinTransform));
ptr->id = (xmlSecBinTransformId)id;
return((xmlSecTransformPtr)ptr);
@@ -200,7 +137,7 @@ xmlSecInputUriTransformCreate(xmlSecTransformId id) {
static void
xmlSecInputUriTransformDestroy(xmlSecTransformPtr transform) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecInputUriTransformDestroy";
- xmlSecInputUriTransformPtr t;
+ xmlSecBinTransformPtr t;
if(!xmlSecTransformCheckId(transform, xmlSecInputUri)) {
#ifdef XMLSEC_DEBUG
@@ -211,15 +148,85 @@ xmlSecInputUriTransformDestroy(xmlSecTransformPtr transform) {
return;
}
- t = (xmlSecInputUriTransformPtr)transform;
- if(t->closeInputUri) {
- t->closeInputUri(t->data);
+ t = (xmlSecBinTransformPtr)transform;
+ if((t->data != NULL) && (xmlSecInputUriTransformCloseClbk(t) != NULL)) {
+ xmlSecInputUriTransformCloseClbk(t)(t->data);
}
- memset(t, 0, sizeof(xmlSecInputUriTransform));
+ memset(t, 0, sizeof(xmlSecBinTransform));
xmlFree(t);
}
/**
+ * xmlSecInputUriTransformOpen:
+ *
+ */
+int
+xmlSecInputUriTransformOpen(xmlSecTransformPtr transform, const char *uri) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecInputUriTransformOpen";
+ xmlSecBinTransformPtr t;
+ int i;
+ char *unescaped;
+
+ if(!xmlSecTransformCheckId(transform, xmlSecInputUri) || (uri == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transform is invalid or uri == NULL\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ t = (xmlSecBinTransformPtr)transform;
+ /* todo: add an ability to use custom protocol handlers */
+
+ /*
+ * Try to find one of the input accept method accepting that scheme
+ * Go in reverse to give precedence to user defined handlers.
+ * try with an unescaped version of the uri
+ */
+ unescaped = xmlURIUnescapeString(uri, 0, NULL);
+ if (unescaped != NULL) {
+ for (i = xmlSecInputCallbackNr - 1;i >= 0;i--) {
+ if ((xmlSecInputCallbackTable[i].matchcallback != NULL) &&
+ (xmlSecInputCallbackTable[i].matchcallback(unescaped) != 0)) {
+ t->data = xmlSecInputCallbackTable[i].opencallback(unescaped);
+ if (t->data != NULL) {
+ t->binData = &(xmlSecInputCallbackTable[i]);
+ break;
+ }
+ }
+ }
+ xmlFree(unescaped);
+ }
+
+ /*
+ * If this failed try with a non-escaped uri this may be a strange
+ * filename
+ */
+ if (t->data == NULL) {
+ for (i = xmlSecInputCallbackNr - 1;i >= 0;i--) {
+ if ((xmlSecInputCallbackTable[i].matchcallback != NULL) &&
+ (xmlSecInputCallbackTable[i].matchcallback(uri) != 0)) {
+ t->data = xmlSecInputCallbackTable[i].opencallback(uri);
+ if (t->data != NULL) {
+ t->binData = &(xmlSecInputCallbackTable[i]);
+ break;
+ }
+ }
+ }
+ }
+
+ if(t->data == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unable to open file \"%s\"\n",
+ func, uri);
+ return(-1);
+ }
+
+ return(0);
+}
+
+/**
* xmlSecInputUriTransformRead:
* @transform:
* @buf:
@@ -231,7 +238,8 @@ static int
xmlSecInputUriTransformRead(xmlSecBinTransformPtr transform,
unsigned char *buf, size_t size) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecInputUriTransformRead";
- xmlSecInputUriTransformPtr t;
+ xmlSecBinTransformPtr t;
+ int ret;
if(!xmlSecTransformCheckId(transform, xmlSecInputUri)) {
#ifdef XMLSEC_DEBUG
@@ -242,11 +250,9 @@ xmlSecInputUriTransformRead(xmlSecBinTransformPtr transform,
return(-1);
}
- t = (xmlSecInputUriTransformPtr)transform;
- if(t->readInputUri) {
- int ret;
-
- ret = t->readInputUri(t->data, buf, size);
+ t = (xmlSecBinTransformPtr)transform;
+ if((t->data != NULL) && (xmlSecInputUriTransformReadClbk(t) != NULL)) {
+ ret = xmlSecInputUriTransformReadClbk(t)(t->data, (char*)buf, (int)size);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -260,38 +266,15 @@ xmlSecInputUriTransformRead(xmlSecBinTransformPtr transform,
return(0);
}
-/**
- * xmlSecFileRead:
- * @f:
- * @buf:
- * @size:
- *
- * Reads data from local file
- */
-static int
-xmlSecFileRead(FILE *f, unsigned char *buf, size_t size) {
- static const char func[] ATTRIBUTE_UNUSED = "xmlSecFileRead";
-
- if(f == NULL) {
-#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: file descriptor is null\n",
- func);
-#endif
- return(-1);
- }
- return (fread(buf, sizeof(unsigned char), size, f));
-}
-
-
void
-xmlSecIOInit(void) {
+xmlSecIOInit(void) {
#ifdef LIBXML_HTTP_ENABLED
xmlNanoHTTPInit();
#endif /* LIBXML_HTTP_ENABLED */
#ifdef LIBXML_FTP_ENABLED
xmlNanoFTPInit();
#endif /* LIBXML_FTP_ENABLED */
+ xmlSecRegisterDefaultInputCallbacks();
}
void
@@ -302,12 +285,84 @@ xmlSecIOShutdown(void) {
#ifdef LIBXML_FTP_ENABLED
xmlNanoFTPCleanup();
#endif /* LIBXML_FTP_ENABLED */
+ xmlSecCleanupInputCallbacks();
}
+/**
+ * xmlSecCleanupInputCallbacks:
+ *
+ * clears the entire input callback table. this includes the
+ * compiled-in I/O.
+ */
+void
+xmlSecCleanupInputCallbacks(void)
+{
+ int i;
+
+ if (!xmlSecInputCallbackInitialized)
+ return;
+
+ for (i = xmlSecInputCallbackNr - 1; i >= 0; i--) {
+ xmlSecInputCallbackTable[i].matchcallback = NULL;
+ xmlSecInputCallbackTable[i].opencallback = NULL;
+ xmlSecInputCallbackTable[i].readcallback = NULL;
+ xmlSecInputCallbackTable[i].closecallback = NULL;
+ }
+
+ xmlSecInputCallbackNr = 0;
+}
+
+/**
+ * xmlSecRegisterDefaultInputCallbacks:
+ *
+ * Registers the default compiled-in I/O handlers.
+ */
+void
+xmlSecRegisterDefaultInputCallbacks(void) {
+ if (xmlSecInputCallbackInitialized)
+ return;
+
+ xmlSecRegisterInputCallbacks(xmlFileMatch, xmlFileOpen,
+ xmlFileRead, xmlFileClose);
+#ifdef LIBXML_HTTP_ENABLED
+ xmlSecRegisterInputCallbacks(xmlIOHTTPMatch, xmlIOHTTPOpen,
+ xmlIOHTTPRead, xmlIOHTTPClose);
+#endif /* LIBXML_HTTP_ENABLED */
+
+#ifdef LIBXML_FTP_ENABLED
+ xmlSecRegisterInputCallbacks(xmlIOFTPMatch, xmlIOFTPOpen,
+ xmlIOFTPRead, xmlIOFTPClose);
+#endif /* LIBXML_FTP_ENABLED */
+ xmlSecInputCallbackInitialized = 1;
+}
+/**
+ * xmlSecRegisterInputCallbacks:
+ * @matchFunc: the xmlInputMatchCallback
+ * @openFunc: the xmlInputOpenCallback
+ * @readFunc: the xmlInputReadCallback
+ * @closeFunc: the xmlInputCloseCallback
+ *
+ * Register a new set of I/O callback for handling parser input.
+ *
+ * Returns the registered handler number or -1 in case of error
+ */
+int
+xmlSecRegisterInputCallbacks(xmlInputMatchCallback matchFunc,
+ xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc,
+ xmlInputCloseCallback closeFunc) {
+ if (xmlSecInputCallbackNr >= MAX_INPUT_CALLBACK) {
+ return(-1);
+ }
+ xmlSecInputCallbackTable[xmlSecInputCallbackNr].matchcallback = matchFunc;
+ xmlSecInputCallbackTable[xmlSecInputCallbackNr].opencallback = openFunc;
+ xmlSecInputCallbackTable[xmlSecInputCallbackNr].readcallback = readFunc;
+ xmlSecInputCallbackTable[xmlSecInputCallbackNr].closecallback = closeFunc;
+ return(xmlSecInputCallbackNr++);
+}
diff --git a/src/keysmngr.c b/src/keysmngr.c
index 429f79b4..d4261cb4 100644
--- a/src/keysmngr.c
+++ b/src/keysmngr.c
@@ -280,7 +280,7 @@ xmlSecSimpleKeysMngrLoad(xmlSecKeysMngrPtr mngr, const char *uri, int strict) {
return(-1);
}
- memset(&keysMngr, 0, sizeof(keysMngr));
+ memcpy(&keysMngr, mngr, sizeof(keysMngr));
keysMngr.allowedOrigins = xmlSecKeyOriginAll;
cur = xmlSecGetNextElementNode(root->children);
while(xmlSecCheckNodeName(cur, BAD_CAST "KeyInfo", xmlSecDSigNs)) {
diff --git a/src/rsa.c b/src/rsa.c
index 6d2adc4c..23a41f6d 100644
--- a/src/rsa.c
+++ b/src/rsa.c
@@ -31,6 +31,7 @@
#include <xmlsec/digests.h>
#include <xmlsec/buffered.h>
#include <xmlsec/base64.h>
+#include <xmlsec/debug.h>
/**
@@ -183,7 +184,7 @@ xmlSecTransformId xmlSecEncRsaOaep = (xmlSecTransformId)&xmlSecEncRsaOaepId;
-#define xmlSecRsaKey( k ) ((RSA*)(( k )->keyData))
+#define xmlSecGetRsaKey( k ) ((RSA*)(( k )->keyData))
/**
* RSA-SHA1 transform
@@ -433,7 +434,7 @@ xmlSecSignRsaSha1AddKey (xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
}
digest = (xmlSecDigestTransformPtr)transform;
- if(xmlSecRsaKey(key) == NULL) {
+ if(xmlSecGetRsaKey(key) == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: key rsa data is null\n",
@@ -442,7 +443,7 @@ xmlSecSignRsaSha1AddKey (xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
return(-1);
}
- rsa = RSA_new();
+ rsa = xmlSecRsaDup(xmlSecGetRsaKey(key));
if(rsa == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -452,16 +453,6 @@ xmlSecSignRsaSha1AddKey (xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
return(-1);
}
- if(xmlSecRsaKey(key)->n != NULL) {
- rsa->n = BN_dup(xmlSecRsaKey(key)->n);
- }
- if(xmlSecRsaKey(key)->e != NULL) {
- rsa->e = BN_dup(xmlSecRsaKey(key)->e);
- }
- if(xmlSecRsaKey(key)->d != NULL) {
- rsa->d = BN_dup(xmlSecRsaKey(key)->d);
- }
-
digestBuf = xmlMalloc(sizeof(unsigned char) * RSA_size(rsa));
if(digestBuf == NULL) {
#ifdef XMLSEC_DEBUG
@@ -504,7 +495,11 @@ RSA* xmlSecRsaDup(RSA *rsa) {
return(NULL);
}
- /* todo: increment reference counter nstead of coping */
+ /* increment reference counter instead of coping if possible */
+#ifdef XMLSEC_OPENSSL097
+ RSA_up_ref(rsa);
+ newRsa = rsa;
+#else /* XMLSEC_OPENSSL097 */
newRsa = RSA_new();
if(newRsa == NULL) {
@@ -525,6 +520,7 @@ RSA* xmlSecRsaDup(RSA *rsa) {
if(rsa->d != NULL) {
newRsa->d = BN_dup(rsa->d);
}
+#endif /* XMLSEC_OPENSSL097 */
return(newRsa);
}
@@ -580,8 +576,8 @@ xmlSecRsaKeyDestroy(xmlSecKeyPtr key) {
return;
}
- if(xmlSecRsaKey(key) != NULL) {
- RSA_free(xmlSecRsaKey(key));
+ if(xmlSecGetRsaKey(key) != NULL) {
+ RSA_free(xmlSecGetRsaKey(key));
}
memset(key, 0, sizeof(struct _xmlSecKey));
@@ -612,8 +608,8 @@ xmlSecRsaKeyDuplicate(xmlSecKeyPtr key) {
return(NULL);
}
- if(xmlSecRsaKey(key) != NULL) {
- newKey->keyData = xmlSecRsaDup(xmlSecRsaKey(key));
+ if(xmlSecGetRsaKey(key) != NULL) {
+ newKey->keyData = xmlSecRsaDup(xmlSecGetRsaKey(key));
if(newKey->keyData == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -623,7 +619,7 @@ xmlSecRsaKeyDuplicate(xmlSecKeyPtr key) {
xmlSecKeyDestroy(newKey);
return(NULL);
}
- if(xmlSecRsaKey(newKey)->d != NULL) {
+ if(xmlSecGetRsaKey(newKey)->d != NULL) {
newKey->type = xmlSecKeyTypePrivate;
} else {
newKey->type = xmlSecKeyTypePublic;
@@ -673,8 +669,8 @@ xmlSecRsaKeyGenerate(xmlSecKeyPtr key, RSA *rsa) {
}
}
- if(xmlSecRsaKey(key) != NULL) {
- RSA_free(xmlSecRsaKey(key));
+ if(xmlSecGetRsaKey(key) != NULL) {
+ RSA_free(xmlSecGetRsaKey(key));
}
key->keyData = rsa;
if(rsa->d != NULL) {
@@ -822,8 +818,8 @@ xmlSecRsaKeyRead(xmlSecKeyPtr key, xmlNodePtr node) {
return(-1);
}
- if(xmlSecRsaKey(key) != NULL) {
- RSA_free(xmlSecRsaKey(key));
+ if(xmlSecGetRsaKey(key) != NULL) {
+ RSA_free(xmlSecGetRsaKey(key));
}
key->keyData = rsa;
if(privateKey) {
@@ -867,7 +863,7 @@ xmlSecRsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecRsaKey(key)->n, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetRsaKey(key)->n, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -887,7 +883,7 @@ xmlSecRsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecRsaKey(key)->e, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetRsaKey(key)->e, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -909,7 +905,7 @@ xmlSecRsaKeyWrite(xmlSecKeyPtr key, xmlSecKeyType type, xmlNodePtr parent) {
#endif
return(-1);
}
- ret = xmlSecNodeSetBNValue(cur, xmlSecRsaKey(key)->d, 1);
+ ret = xmlSecNodeSetBNValue(cur, xmlSecGetRsaKey(key)->d, 1);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -1002,7 +998,7 @@ xmlSecRsaPkcs1AddKey(xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
}
buffered = (xmlSecBufferedTransformPtr)transform;
- if(xmlSecRsaKey(key) == NULL) {
+ if(xmlSecGetRsaKey(key) == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: key rsa data is null\n",
@@ -1011,7 +1007,7 @@ xmlSecRsaPkcs1AddKey(xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
return(-1);
}
- rsa = xmlSecRsaDup(xmlSecRsaKey(key));
+ rsa = xmlSecRsaDup(xmlSecGetRsaKey(key));
if(rsa == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -1237,7 +1233,7 @@ xmlSecRsaOaepAddKey(xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
}
buffered = (xmlSecBufferedTransformPtr)transform;
- if(xmlSecRsaKey(key) == NULL) {
+ if(xmlSecGetRsaKey(key) == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: key rsa data is null\n",
@@ -1246,7 +1242,7 @@ xmlSecRsaOaepAddKey(xmlSecBinTransformPtr transform, xmlSecKeyPtr key) {
return(-1);
}
- rsa = xmlSecRsaDup(xmlSecRsaKey(key));
+ rsa = xmlSecRsaDup(xmlSecGetRsaKey(key));
if(rsa == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
diff --git a/src/transforms.c b/src/transforms.c
index 9b9783f4..d9d5c459 100644
--- a/src/transforms.c
+++ b/src/transforms.c
@@ -44,8 +44,7 @@ static int xmlSecTransformPreBase64Decode(const xmlNodePtr node, const xmlNodeSe
*/
void xmlSecTransformsInit(void) {
int i = 0;
-
-
+
/* encoding */
xmlSecAllTransforms[i++] = xmlSecEncBase64Encode;
xmlSecAllTransforms[i++] = xmlSecEncBase64Decode;
@@ -83,6 +82,7 @@ void xmlSecTransformsInit(void) {
/* XML transforms */
xmlSecAllTransforms[i++] = xmlSecTransformEnveloped;
xmlSecAllTransforms[i++] = xmlSecTransformXPath;
+ xmlSecAllTransforms[i++] = xmlSecTransformXPath2;
#ifndef XMLSEC_NO_XSLT
xmlSecAllTransforms[i++] = xmlSecTransformXslt;
@@ -112,6 +112,10 @@ void xmlSecTransformsInit(void) {
xmlSecAllTransforms[i++] = xmlSecKWAes192;
xmlSecAllTransforms[i++] = xmlSecKWAes256;
#endif /* XMLSEC_NO_DES */
+
+#ifndef XMLSEC_NO_XPATHALT
+ xmlSecAllTransforms[i++] = xmlSecXPathAlt;
+#endif /* XMLSEC_NO_XPATHALT */
/* Input/memory buffer */
xmlSecAllTransforms[i++] = xmlSecInputUri;
diff --git a/src/xmldsig.c b/src/xmldsig.c
index e06f9af0..f70ee5d5 100644
--- a/src/xmldsig.c
+++ b/src/xmldsig.c
@@ -78,6 +78,7 @@ static int xmlSecManifestRead (xmlNodePtr manifestNode,
int sign,
xmlSecDSigResultPtr result);
+
/**
* Creating DSig template
*/
@@ -1428,7 +1429,7 @@ xmlSecSignedInfoCalculate(xmlNodePtr signedInfoNode, int sign,
/*
* if requested then insert a memory buffer to capture the digest data
*/
- if(result->ctx->storeSignatures) {
+ if(result->ctx->storeSignatures || result->ctx->fakeSignatures) {
memBuffer = xmlSecTransformCreate(xmlSecMemBuf, 0, 1);
if(memBuffer == NULL) {
#ifdef XMLSEC_DEBUG
@@ -1449,48 +1450,51 @@ xmlSecSignedInfoCalculate(xmlNodePtr signedInfoNode, int sign,
}
}
- ret = xmlSecTransformStateUpdate(state, signMethod);
- if(ret < 0){
+ if(!(result->ctx->fakeSignatures)) {
+ ret = xmlSecTransformStateUpdate(state, signMethod);
+ if(ret < 0){
#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: failed to add sign method\n",
- func);
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to add sign method\n",
+ func);
#endif
- goto done;
- }
-
- ret = xmlSecTransformStateFinal(state, xmlSecTransformResultBinary);
- if(ret < 0) {
-#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: failed to finalize transforms\n",
- func);
-#endif
- goto done;
- }
-
- if(sign) {
- ret = xmlSecDigestSignNode(signMethod, signatureValueNode, 1);
+ goto done;
+ }
+ ret = xmlSecTransformStateFinal(state, xmlSecTransformResultBinary);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
- "%s: failed to sign node\n",
+ "%s: failed to finalize transforms\n",
func);
#endif
- goto done;
+ goto done;
}
- } else {
- ret = xmlSecDigestVerifyNode(signMethod, signatureValueNode);
- if(ret < 0) {
+
+ if(sign) {
+ ret = xmlSecDigestSignNode(signMethod, signatureValueNode, 1);
+ if(ret < 0) {
#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: failed to verify node\n",
- func);
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to sign node\n",
+ func);
#endif
- goto done;
+ goto done;
+ }
+ } else {
+ ret = xmlSecDigestVerifyNode(signMethod, signatureValueNode);
+ if(ret < 0) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to verify node\n",
+ func);
+#endif
+ goto done;
+ }
}
+ result->result = signMethod->status;
+ } else {
+ result->result = xmlSecTransformStatusOk; /* in "fake" mode we always ok */
}
- result->result = signMethod->status;
if(memBuffer != NULL) {
result->buffer = xmlSecMemBufTransformGetBuffer(memBuffer, 1);
diff --git a/src/xmlsec.c b/src/xmlsec.c
index b50f25c3..142b7750 100644
--- a/src/xmlsec.c
+++ b/src/xmlsec.c
@@ -23,6 +23,7 @@
const xmlChar xmlSecDSigNs[] = "http://www.w3.org/2000/09/xmldsig#";
const xmlChar xmlSecEncNs[] = "http://www.w3.org/2001/04/xmlenc#";
const xmlChar xmlSecNs[] = "http://www.aleksey.com/xmlsec/2002";
+const xmlChar xmlSecXPath2[] = "http://www.w3.org/2002/04/xmldsig-filter2";
void
diff --git a/src/xmltree.c b/src/xmltree.c
index d6128f85..cdfa06cb 100644
--- a/src/xmltree.c
+++ b/src/xmltree.c
@@ -259,6 +259,27 @@ xmlSecFindChild(const xmlNodePtr parent, const xmlChar *name, const xmlChar *ns)
return(NULL);
}
+xmlNodePtr
+xmlSecFindParent(const xmlNodePtr cur, const xmlChar *name, const xmlChar *ns) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecFindParent";
+
+ if((cur == NULL) || (name == NULL)){
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: the node or name is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ if(xmlSecCheckNodeName(cur, name, ns)) {
+ return(cur);
+ } else if(cur->parent != NULL) {
+ return(xmlSecFindParent(cur->parent, name, ns));
+ }
+ return(NULL);
+}
+
xmlNodePtr
xmlSecFindNode(const xmlNodePtr parent, const xmlChar *name, const xmlChar *ns) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecFindChild";
@@ -318,13 +339,15 @@ xmlSecFindNodeById(const xmlNodePtr parent, const xmlChar *id) {
if(cur->type == XML_ELEMENT_NODE) {
xmlChar* attr;
xmlNodePtr ret;
-
+
attr = xmlGetProp(cur, BAD_CAST "Id");
- if(xmlStrEqual(id, attr)) {
+ if(attr != NULL) {
+ if(xmlStrEqual(id, attr)) {
+ xmlFree(attr);
+ return(cur);
+ }
xmlFree(attr);
- return(cur);
}
- xmlFree(attr);
if(cur->children != NULL) {
ret = xmlSecFindNodeById(cur->children, id);
@@ -351,6 +374,7 @@ xmlNodeSetPtr
xmlSecGetChildNodeSet(const xmlNodePtr parent, xmlNodeSetPtr nodeSet, int withComments) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecGetChildNodeSet";
xmlNodePtr cur;
+ xmlNsPtr ns;
xmlAttrPtr attr;
if(parent == NULL) {
@@ -378,30 +402,37 @@ xmlSecGetChildNodeSet(const xmlNodePtr parent, xmlNodeSetPtr nodeSet, int withCo
switch(parent->type) {
case XML_COMMENT_NODE:
if(!withComments) return(nodeSet);
- xmlXPathNodeSetAddUnique(nodeSet, parent);
+ xmlXPathNodeSetAdd(nodeSet, parent);
return(nodeSet);
case XML_ELEMENT_NODE:
- xmlXPathNodeSetAddUnique(nodeSet, parent);
+ xmlXPathNodeSetAdd(nodeSet, parent);
+
+ /* add all attrs */
+ attr = parent->properties;
+ while (attr != NULL) {
+ xmlXPathNodeSetAdd(nodeSet, (xmlNodePtr)attr);
+ attr = attr->next;
+ }
+
+ /* add namespaces */
+ for (ns = parent->nsDef; ns != NULL; ns = ns->next) {
+ xmlXPathNodeSetAddNs(nodeSet, parent, ns);
+ }
+
break;
case XML_TEXT_NODE:
- xmlXPathNodeSetAddUnique(nodeSet, parent);
+ xmlXPathNodeSetAdd(nodeSet, parent);
return(nodeSet);
case XML_PI_NODE:
- xmlXPathNodeSetAddUnique(nodeSet, parent);
+ xmlXPathNodeSetAdd(nodeSet, parent);
return(nodeSet);
default:
return(nodeSet);
}
-
- /* add all attrs */
- attr = parent->properties;
- while (attr != NULL) {
- xmlXPathNodeSetAddUnique(nodeSet, (xmlNodePtr)attr);
- attr = attr->next;
- }
- cur = parent->children;
+
/* add all childrens */
+ cur = parent->children;
while(cur != NULL) {
nodeSet = xmlSecGetChildNodeSet(cur, nodeSet, withComments);
if(nodeSet == NULL) {
@@ -422,7 +453,7 @@ xmlSecGetChildNodeSet(const xmlNodePtr parent, xmlNodeSetPtr nodeSet, int withCo
/**
* xmlSecCheckNodeName:
* @cur:
- * @name:
+dis * @name:
* @ns:
*
* Checks that the node has a given name and a given namespace href
diff --git a/src/xpath.c b/src/xpath.c
index 5717b025..5bb34362 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -23,17 +23,23 @@
#include <xmlsec/transformsInternal.h>
#include <xmlsec/xpath.h>
+
/* XPath transform */
-typedef struct _xmlSecXPathTransformData {
+typedef struct _xmlSecXPathData {
xmlChar *xpathExpr;
xmlChar **xpathNamespaces;
size_t size;
-} xmlSecXPathTransformData, *xmlSecXPathTransformDataPtr;
+
+ /* XPath2 transform specific */
+ int xpath2;
+ xmlSecXPath2TransformType type;
+} xmlSecXPathData, *xmlSecXPathDataPtr;
-static xmlSecXPathTransformDataPtr xmlSecXPathTransformDataCreate (void);
-static void xmlSecXPathTransformDataDestroy (xmlSecXPathTransformDataPtr data);
-static xmlSecXPathTransformDataPtr xmlSecXPathTransformDataRead (const xmlNodePtr node);
+static xmlSecXPathDataPtr xmlSecXPathDataCreate (int xpath2);
+static void xmlSecXPathDataDestroy (xmlSecXPathDataPtr data);
+static xmlSecXPathDataPtr xmlSecXPathDataRead (const xmlNodePtr node,
+ int xpath2);
static xmlSecTransformPtr xmlSecTransformXPathCreate (xmlSecTransformId id);
static void xmlSecTransformXPathDestroy (xmlSecTransformPtr transform);
@@ -44,13 +50,30 @@ static int xmlSecTransformXPathExecute (xmlSecXmlTransformPtr transform,
xmlDocPtr *doc,
xmlNodeSetPtr *nodes);
+static xmlNodeSetPtr xmlSecXPathGetNodes (xmlDocPtr doc,
+ xmlNodeSetPtr src,
+ xmlNodeSetPtr xpathRes);
+static xmlNodeSetPtr xmlSecXPath2IntersectGetNodes (xmlDocPtr doc,
+ xmlNodeSetPtr src,
+ xmlNodeSetPtr xpathRes);
+static xmlNodeSetPtr xmlSecXPath2SubtractGetNodes (xmlDocPtr doc,
+ xmlNodeSetPtr src,
+ xmlNodeSetPtr xpathRes);
+static xmlNodeSetPtr xmlSecXPath2UnionGetNodes (xmlDocPtr doc,
+ xmlNodeSetPtr src,
+ xmlNodeSetPtr xpathRes);
+static xmlNodeSetPtr xmlSecXPath2SubtractFromDoc (xmlNodePtr cur,
+ xmlNodeSetPtr nodes,
+ xmlNodeSetPtr exclude);
+static xmlNodeSetPtr xmlSecXPath2AddSubtrees (xmlNodeSetPtr nodes);
+static void xmlSecNodeSetDebugDump (xmlNodeSetPtr nodes,
+ FILE *output);
struct _xmlSecXmlTransformId xmlSecTransformXPathId = {
/* same as xmlSecTransformId */
xmlSecTransformTypeXml, /* xmlSecTransformType type; */
xmlSecUsageDSigTransform, /* xmlSecTransformUsage usage; */
- BAD_CAST "http://www.w3.org/TR/1999/REC-xpath-19991116",
- /* const xmlChar *href; */
+ BAD_CAST "http://www.w3.org/TR/1999/REC-xpath-19991116", /* const xmlChar *href; */
xmlSecTransformXPathCreate, /* xmlSecTransformCreateMethod create; */
xmlSecTransformXPathDestroy, /* xmlSecTransformDestroyMethod destroy; */
@@ -59,9 +82,24 @@ struct _xmlSecXmlTransformId xmlSecTransformXPathId = {
/* xmlTransform info */
xmlSecTransformXPathExecute /* xmlSecXmlTransformExecuteMethod executeXml; */
};
-
xmlSecTransformId xmlSecTransformXPath = (xmlSecTransformId)(&xmlSecTransformXPathId);
+struct _xmlSecXmlTransformId xmlSecTransformXPath2Id = {
+ /* same as xmlSecTransformId */
+ xmlSecTransformTypeXml, /* xmlSecTransformType type; */
+ xmlSecUsageDSigTransform, /* xmlSecTransformUsage usage; */
+ BAD_CAST "http://www.w3.org/2002/04/xmldsig-filter2", /* const xmlChar *href; */
+
+ xmlSecTransformXPathCreate, /* xmlSecTransformCreateMethod create; */
+ xmlSecTransformXPathDestroy, /* xmlSecTransformDestroyMethod destroy; */
+ xmlSecTransformXPathReadNode, /* xmlSecTransformReadNodeMethod read; */
+
+ /* xmlTransform info */
+ xmlSecTransformXPathExecute /* xmlSecXmlTransformExecuteMethod executeXml; */
+};
+xmlSecTransformId xmlSecTransformXPath2 = (xmlSecTransformId)(&xmlSecTransformXPath2Id);
+
+
static const xmlChar xpathPattern[] = "(//. | //@* | //namespace::*)[%s]";
/**
@@ -94,7 +132,7 @@ xmlSecTransformXPathCreate(xmlSecTransformId id) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPathCreate";
xmlSecXmlTransformPtr xmlTransform;
- if(id != xmlSecTransformXPath){
+ if((id != xmlSecTransformXPath) && (id != xmlSecTransformXPath2)) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: id is not recognized\n",
@@ -113,7 +151,7 @@ xmlSecTransformXPathCreate(xmlSecTransformId id) {
return(NULL);
}
memset(xmlTransform, 0, sizeof(struct _xmlSecXmlTransform));
- xmlTransform->id = (xmlSecXmlTransformId)xmlSecTransformXPath;
+ xmlTransform->id = (xmlSecXmlTransformId)id;
return((xmlSecTransformPtr)xmlTransform);
}
@@ -127,9 +165,10 @@ static void
xmlSecTransformXPathDestroy(xmlSecTransformPtr transform) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPathDestroy";
xmlSecXmlTransformPtr xmlTransform;
- xmlSecXPathTransformDataPtr data;
+ xmlSecXPathDataPtr data;
- if(!xmlSecTransformCheckId(transform, xmlSecTransformXPath)) {
+ if(!xmlSecTransformCheckId(transform, xmlSecTransformXPath) &&
+ !xmlSecTransformCheckId(transform, xmlSecTransformXPath2)) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: transform is invalid or transformNode is null\n",
@@ -138,10 +177,10 @@ xmlSecTransformXPathDestroy(xmlSecTransformPtr transform) {
return;
}
xmlTransform = (xmlSecXmlTransformPtr)transform;
- data = (xmlSecXPathTransformDataPtr)xmlTransform->xmlData;
+ data = (xmlSecXPathDataPtr)xmlTransform->xmlData;
if(data != NULL) {
- xmlSecXPathTransformDataDestroy(data);
+ xmlSecXPathDataDestroy(data);
}
memset(xmlTransform, 0, sizeof(struct _xmlSecXmlTransform));
xmlFree(xmlTransform);
@@ -158,9 +197,10 @@ static int
xmlSecTransformXPathReadNode(xmlSecTransformPtr transform, xmlNodePtr transformNode) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPathReadNode";
xmlSecXmlTransformPtr xmlTransform;
- xmlSecXPathTransformDataPtr data;
-
- if(!xmlSecTransformCheckId(transform, xmlSecTransformXPath) ||
+ xmlSecXPathDataPtr data;
+
+ if((!xmlSecTransformCheckId(transform, xmlSecTransformXPath) &&
+ !xmlSecTransformCheckId(transform, xmlSecTransformXPath2)) ||
(transformNode == NULL)) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -170,8 +210,10 @@ xmlSecTransformXPathReadNode(xmlSecTransformPtr transform, xmlNodePtr transformN
return(-1);
}
xmlTransform = (xmlSecXmlTransformPtr)transform;
-
- data = xmlSecXPathTransformDataRead(transformNode);
+
+
+ data = xmlSecXPathDataRead(transformNode,
+ xmlSecTransformCheckId(transform, xmlSecTransformXPath2));
if(data == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -182,7 +224,7 @@ xmlSecTransformXPathReadNode(xmlSecTransformPtr transform, xmlNodePtr transformN
}
if(xmlTransform->xmlData != NULL) {
- xmlSecXPathTransformDataDestroy((xmlSecXPathTransformDataPtr)xmlTransform->xmlData);
+ xmlSecXPathDataDestroy((xmlSecXPathDataPtr)xmlTransform->xmlData);
}
xmlTransform->xmlData = data;
xmlTransform->here = transformNode;
@@ -200,7 +242,7 @@ xmlSecTransformXPathReadNode(xmlSecTransformPtr transform, xmlNodePtr transformN
int
xmlSecTransformXPathAdd(xmlNodePtr transformNode, const xmlChar *expression,
const xmlChar **namespaces) {
- static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPathAddExpression";
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPathAdd";
xmlNodePtr xpathNode;
if((transformNode == NULL) || (expression == NULL)) {
@@ -272,6 +314,100 @@ xmlSecTransformXPathAdd(xmlNodePtr transformNode, const xmlChar *expression,
return(0);
}
+int
+xmlSecTransformXPath2Add(xmlNodePtr transformNode, xmlSecXPath2TransformType type,
+ const xmlChar *expression, const xmlChar **namespaces) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPath2Add";
+ xmlNodePtr xpathNode;
+
+ if((transformNode == NULL) || (expression == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transformNode or expression is null\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ xpathNode = xmlSecFindChild(transformNode, BAD_CAST "XPath", xmlSecXPath2);
+ if(xpathNode != NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: XPath node is already present\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ xpathNode = xmlSecAddChild(transformNode, BAD_CAST "XPath", xmlSecXPath2);
+ if(xpathNode == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to create XPath node\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ switch(type) {
+ case xmlSecXPathTransformIntersect:
+ xmlSetProp(xpathNode, BAD_CAST "Filter", BAD_CAST "intersect");
+ break;
+ case xmlSecXPathTransformSubtract:
+ xmlSetProp(xpathNode, BAD_CAST "Filter", BAD_CAST "subtract");
+ break;
+ case xmlSecXPathTransformUnion:
+ xmlSetProp(xpathNode, BAD_CAST "Filter", BAD_CAST "union");
+ break;
+ default:
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unknown type %d\n",
+ func, type);
+#endif
+ return(-1);
+ }
+
+ xmlNodeSetContent(xpathNode, expression);
+ if(namespaces != NULL) {
+ xmlNsPtr ns;
+ const xmlChar *prefix;
+ const xmlChar *href;
+ const xmlChar **ptr;
+
+ ptr = namespaces;
+ while((*ptr) != NULL) {
+ if(xmlStrEqual(BAD_CAST "#default", (*ptr))) {
+ prefix = NULL;
+ } else {
+ prefix = (*ptr);
+ }
+ if((++ptr) == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unexpected end of namespaces list\n",
+ func);
+#endif
+ return(-1);
+ }
+ href = *(ptr++);
+
+ ns = xmlNewNs(xpathNode, href, prefix);
+ if(ns == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to add namespace (%s=%s)\n",
+ func,
+ ((prefix != NULL) ? (char*)prefix : "null"), href);
+#endif
+ return(-1);
+ }
+ }
+ }
+ return(0);
+}
+
+
/**
* xmlSecTransformXPathExecute
* @transform:
@@ -284,13 +420,14 @@ static int
xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
xmlDocPtr *doc, xmlNodeSetPtr *nodes) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXPathExecute";
- xmlChar *expr;
+ xmlChar *expr = NULL;
xmlSecXmlTransformPtr xmlTransform;
- xmlSecXPathTransformDataPtr data;
+ xmlSecXPathDataPtr data;
xmlXPathObjectPtr xpath;
xmlXPathContextPtr ctx;
- if(!xmlSecTransformCheckId(transform, xmlSecTransformXPath) ||
+ if((!xmlSecTransformCheckId(transform, xmlSecTransformXPath) &&
+ !xmlSecTransformCheckId(transform, xmlSecTransformXPath2)) ||
(nodes == NULL) || (doc == NULL) || ((*doc) == NULL)) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -300,7 +437,7 @@ xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
return(-1);
}
xmlTransform = (xmlSecXmlTransformPtr)transform;
- data = (xmlSecXPathTransformDataPtr)xmlTransform->xmlData;
+ data = (xmlSecXPathDataPtr)xmlTransform->xmlData;
if((data == NULL) || (data->xpathExpr == NULL)) {
#ifdef XMLSEC_DEBUG
@@ -311,20 +448,6 @@ xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
return(-1);
}
- /**
- * Create full XPath expression
- */
- expr = (xmlChar*) xmlMalloc(sizeof(xmlChar) *
- (xmlStrlen(data->xpathExpr) + xmlStrlen(xpathPattern) + 1));
- if(expr == NULL) {
-#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: failed to allocate xpath expr buffer\n",
- func);
-#endif
- return(-1);
- }
- sprintf((char*) expr, (char*) xpathPattern, data->xpathExpr);
/**
* Create XPath context
@@ -336,7 +459,6 @@ xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
"%s: xpath context is null\n",
func);
#endif
- xmlFree(expr);
return(-1);
}
@@ -353,12 +475,12 @@ xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
if(data->xpathNamespaces != NULL) {
xmlChar *prefix;
xmlChar *href;
- size_t i;
+ int i;
- for(i = 0; i + 1 < data->size;) {
- prefix = (data->xpathNamespaces)[i++];
- href = (data->xpathNamespaces)[i++];
- if(xmlXPathRegisterNs(ctx, prefix, href) != 0) {
+ for(i = data->size - 1; i > 0; ) {
+ href = (data->xpathNamespaces)[i--];
+ prefix = (data->xpathNamespaces)[i--];
+ if((prefix != NULL) && (xmlXPathRegisterNs(ctx, prefix, href) != 0)) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: unable to register NS with prefix=\"%s\" and href=\"%s\"\n",
@@ -366,37 +488,103 @@ xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
((prefix != NULL) ? (char*)prefix : "null"),
((href != NULL) ? (char*)href : "null"));
#endif
- xmlFree(expr);
xmlXPathFreeContext(ctx);
return(-1);
}
}
}
+ /**
+ * Create full XPath expression
+ */
+ if(!data->xpath2) {
+ expr = (xmlChar*) xmlMalloc(sizeof(xmlChar) *
+ (xmlStrlen(data->xpathExpr) + xmlStrlen(xpathPattern) + 1));
+ if(expr == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to allocate xpath expr buffer\n",
+ func);
+#endif
+ return(-1);
+ }
+ sprintf((char*) expr, (char*) xpathPattern, data->xpathExpr);
+ }
+
/*
* Evaluate xpath
*/
- xpath = xmlXPathEvalExpression(expr, ctx);
+ xpath = xmlXPathEvalExpression((data->xpath2) ? data->xpathExpr : expr, ctx);
if(xpath == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"xmlSecXPathTransformRead: xpath eval failed\n",
func);
#endif
- xmlFree(expr);
+ if(expr != NULL) {
+ xmlFree(expr);
+ }
xmlXPathFreeContext(ctx);
return(-1);
}
/* free everything we do not need */
- xmlFree(expr);
+ if(expr != NULL) {
+ xmlFree(expr);
+ }
xmlXPathFreeContext(ctx);
-
- if((*nodes) != NULL) {
- (*nodes) = xmlXPathIntersection((*nodes), xpath->nodesetval);
+
+ if(data->xpath2) {
+ /*
+ fprintf(stderr, "Source and XPath result:\n");
+ xmlSecNodeSetDebugDump(*nodes, stderr);
+ xmlSecNodeSetDebugDump(xpath->nodesetval, stderr);
+ */
+
+ /* add the subtrees */
+ if(xmlSecXPath2AddSubtrees(xpath->nodesetval) == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to add subtrees\n",
+ func);
+#endif
+ xmlXPathFreeObject(xpath);
+ return(-1);
+ }
+
+ /*
+ fprintf(stderr, "Adding subtrees:\n");
+ xmlSecNodeSetDebugDump(xpath->nodesetval, stderr);
+ */
+
+ switch(data->type) {
+ case xmlSecXPathTransformIntersect:
+ (*nodes) = xmlSecXPath2IntersectGetNodes((*doc), (*nodes), xpath->nodesetval);
+ break;
+ case xmlSecXPathTransformSubtract:
+ (*nodes) = xmlSecXPath2SubtractGetNodes((*doc), (*nodes), xpath->nodesetval);
+ break;
+ case xmlSecXPathTransformUnion:
+ (*nodes) = xmlSecXPath2UnionGetNodes((*doc), (*nodes), xpath->nodesetval);
+ break;
+ default:
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unknown xpath2 type %d\n",
+ func, data->xpath2);
+#endif
+ xmlXPathFreeObject(xpath);
+ return(-1);
+ }
+
+ /*
+ fprintf(stderr, "Operation result (%d):\n", data->type);
+ xmlSecNodeSetDebugDump(*nodes, stderr);
+ */
} else {
- (*nodes) = xmlXPathNodeSetMerge(NULL, xpath->nodesetval);
+ (*nodes) = xmlSecXPathGetNodes((*doc), (*nodes), xpath->nodesetval);
}
+
if((*nodes) == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
@@ -411,44 +599,204 @@ xmlSecTransformXPathExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
return(0);
}
+static xmlNodeSetPtr
+xmlSecXPath2AddSubtrees(xmlNodeSetPtr nodes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPath2AddSubtrees";
+ int i, l;
+
+ if(nodes == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: nodes is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ l = xmlXPathNodeSetGetLength(nodes);
+ for(i = 0; i < l; ++i) {
+ if(xmlSecGetChildNodeSet(xmlXPathNodeSetItem(nodes, i), nodes, 1) == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to add nodes\n",
+ func);
+#endif
+ return(NULL);
+ }
+ }
+ return(nodes);
+}
+
+static xmlNodeSetPtr
+xmlSecXPathGetNodes(xmlDocPtr doc, xmlNodeSetPtr src, xmlNodeSetPtr xpathRes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathGetNodes";
+
+ if((doc == NULL) || (xpathRes == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: doc or xpathRes is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ return( (src != NULL) ? xmlXPathIntersection(src, xpathRes) :
+ xmlXPathNodeSetMerge(NULL, xpathRes));
+}
+
+static xmlNodeSetPtr
+xmlSecXPath2IntersectGetNodes(xmlDocPtr doc, xmlNodeSetPtr src, xmlNodeSetPtr xpathRes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPath2IntersectGetNodes";
+
+ if((doc == NULL) || (xpathRes == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: doc or xpathRes is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ return( (src != NULL) ? xmlXPathIntersection(src, xpathRes) :
+ xmlXPathNodeSetMerge(NULL, xpathRes));
+}
+
+
+static xmlNodeSetPtr
+xmlSecXPath2SubtractGetNodes(xmlDocPtr doc, xmlNodeSetPtr src, xmlNodeSetPtr xpathRes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPath2SubtractGetNodes";
+
+ if((doc == NULL) || (xpathRes == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: doc or xpathRes is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ return((src != NULL) ? xmlXPathDifference(src, xpathRes) :
+ xmlSecXPath2SubtractFromDoc(xmlDocGetRootElement(doc), NULL, xpathRes));
+}
+
+static xmlNodeSetPtr
+xmlSecXPath2UnionGetNodes(xmlDocPtr doc, xmlNodeSetPtr src, xmlNodeSetPtr xpathRes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPath2UnionGetNodes";
+ xmlNodeSetPtr ret;
+
+ if((doc == NULL) || (xpathRes == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: doc or xpathRes is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ ret = xmlXPathNodeSetMerge(NULL, xpathRes);
+ if(ret == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to duplicate nodes set\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ return(xmlXPathNodeSetMerge(ret, src));
+}
+
+static xmlNodeSetPtr
+xmlSecXPath2SubtractFromDoc(xmlNodePtr cur, xmlNodeSetPtr nodes, xmlNodeSetPtr exclude) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPath2SubtractFromDoc";
+ int allocated = 0;
+
+ if((cur == NULL) || (exclude == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: cur or exclude is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ if(nodes == NULL) {
+ nodes = xmlXPathNodeSetCreate(NULL);
+ if(nodes == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to create nodes set\n",
+ func);
+#endif
+ return(NULL);
+ }
+ allocated = 1;
+ }
+
+ /* we are operating on the subtrees! */
+ if(!xmlXPathNodeSetContains(exclude, cur)) {
+ xmlXPathNodeSetAdd(nodes, cur);
+
+ if(cur->type == XML_ELEMENT_NODE) {
+ cur = cur->children;
+ while(cur != NULL) {
+ if(xmlSecXPath2SubtractFromDoc(cur, nodes, exclude) == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to get childs\n",
+ func);
+#endif
+ if(allocated) {
+ xmlXPathFreeNodeSet(nodes);
+ }
+ return(NULL);
+ }
+ }
+ cur = cur->next;
+ }
+ }
+ return(nodes);
+}
+
/**
* XPath Transform Data
*/
/**
- * xmlSecXPathTransformDataCreate:
+ * xmlSecXPathDataCreate:
*
*
*
*/
-xmlSecXPathTransformDataPtr
-xmlSecXPathTransformDataCreate(void) {
- static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathTransformDataCreate";
- xmlSecXPathTransformDataPtr data;
+xmlSecXPathDataPtr
+xmlSecXPathDataCreate(int xpath2) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathDataCreate";
+ xmlSecXPathDataPtr data;
- data = (xmlSecXPathTransformDataPtr) xmlMalloc(sizeof(xmlSecXPathTransformData));
+ data = (xmlSecXPathDataPtr) xmlMalloc(sizeof(xmlSecXPathData));
if(data == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
- "%s: failed to allocate xmlSecXPathTransformData \n",
+ "%s: failed to allocate xmlSecXPathData \n",
func);
#endif
return(NULL);
}
- memset(data, 0, sizeof(xmlSecXPathTransformData));
+ memset(data, 0, sizeof(xmlSecXPathData));
+ data->xpath2 = xpath2;
return(data);
}
/**
- * @xmlSecXPathTransformDataDestroy:
+ * @xmlSecXPathDataDestroy:
* @data
*
*
*/
void
-xmlSecXPathTransformDataDestroy(xmlSecXPathTransformDataPtr data) {
- static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathTransformDataDestroy";
+xmlSecXPathDataDestroy(xmlSecXPathDataPtr data) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathDataDestroy";
if(data == NULL) {
#ifdef XMLSEC_DEBUG
@@ -472,21 +820,24 @@ xmlSecXPathTransformDataDestroy(xmlSecXPathTransformDataPtr data) {
memset(data->xpathNamespaces, 0, sizeof(xmlChar*) * (data->size));
xmlFree(data->xpathNamespaces);
}
- memset(data, 0, sizeof(xmlSecXPathTransformData));
+ memset(data, 0, sizeof(xmlSecXPathData));
xmlFree(data);
}
/**
- * xmlSecXPathTransformDataRead
+ * xmlSecXPathDataRead
* @node
*
*
*/
-xmlSecXPathTransformDataPtr
-xmlSecXPathTransformDataRead(const xmlNodePtr node) {
- static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathTransformDataRead";
- xmlSecXPathTransformDataPtr data;
+xmlSecXPathDataPtr
+xmlSecXPathDataRead(const xmlNodePtr node, int xpath2) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathDataRead";
+ const xmlChar *nodeName = (xpath2) ? BAD_CAST "XPath" : BAD_CAST "XPath";
+ const xmlChar *nodeNs = (xpath2) ? xmlSecXPath2 : xmlSecDSigNs;
+ xmlSecXPathDataPtr data;
xmlNodePtr cur;
+ xmlNodePtr tmp;
xmlNsPtr ns;
size_t count;
@@ -499,11 +850,11 @@ xmlSecXPathTransformDataRead(const xmlNodePtr node) {
return(NULL);
}
- data = xmlSecXPathTransformDataCreate();
+ data = xmlSecXPathDataCreate(xpath2);
if(data == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
- "%s: failed to create xmlSecXPathTransformData \n",
+ "%s: failed to create xmlSecXPathData \n",
func);
#endif
return(NULL);
@@ -511,13 +862,13 @@ xmlSecXPathTransformDataRead(const xmlNodePtr node) {
cur = xmlSecGetNextElementNode(node->children);
/* There is only one required node XPath*/
- if((cur == NULL) || (!xmlSecCheckNodeName(cur, BAD_CAST "XPath", xmlSecDSigNs))) {
+ if((cur == NULL) || (!xmlSecCheckNodeName(cur, nodeName, nodeNs))) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: required element \"XPath\" missed\n",
func);
#endif
- xmlSecXPathTransformDataDestroy(data);
+ xmlSecXPathDataDestroy(data);
return(NULL);
}
@@ -528,16 +879,51 @@ xmlSecXPathTransformDataRead(const xmlNodePtr node) {
"%s: failed to get xpath expression from ndoe\n",
func);
#endif
- xmlSecXPathTransformDataDestroy(data);
+ xmlSecXPathDataDestroy(data);
return(NULL);
}
-
+
+ if(xpath2) {
+ xmlChar *type;
+
+ type = xmlGetProp(cur, BAD_CAST "Filter");
+ if(type == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: \"Filter\" is not specified for XPath2 transform\n",
+ func);
+#endif
+ xmlSecXPathDataDestroy(data);
+ return(NULL);
+ }
+
+ if(xmlStrEqual(type, BAD_CAST "intersect")) {
+ data->type = xmlSecXPathTransformIntersect;
+ } else if(xmlStrEqual(type, BAD_CAST "subtract")) {
+ data->type = xmlSecXPathTransformSubtract;
+ } else if(xmlStrEqual(type, BAD_CAST "union")) {
+ data->type = xmlSecXPathTransformUnion;
+ } else {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: \"Filter\" type \"%s\" is unkown\n",
+ func, type);
+#endif
+ xmlFree(type);
+ xmlSecXPathDataDestroy(data);
+ return(NULL);
+ }
+ xmlFree(type);
+ }
+
/* how many namespaces we have? */
- ns = cur->nsDef;
count = 0;
- while(ns != NULL) {
- ++count;
- ns = ns->next;
+ for(tmp = cur; tmp != NULL; tmp = tmp->parent) {
+ ns = tmp->nsDef;
+ while(ns != NULL) {
+ ++count;
+ ns = ns->next;
+ }
}
data->xpathNamespaces = (xmlChar**)xmlMalloc(sizeof(xmlChar*) * (2 * count));
@@ -547,27 +933,30 @@ xmlSecXPathTransformDataRead(const xmlNodePtr node) {
"%s: failed to create namespace list\n",
func);
#endif
- xmlSecXPathTransformDataDestroy(data);
+ xmlSecXPathDataDestroy(data);
return(NULL);
}
data->size = 2 * count;
memset(data->xpathNamespaces, 0, sizeof(xmlChar*) * (data->size));
- ns = cur->nsDef;
count = 0;
- while((ns != NULL) && (count < data->size)){
- if(ns->prefix != NULL) {
- data->xpathNamespaces[count++] = xmlStrdup(ns->prefix);
- } else {
- data->xpathNamespaces[count++] = NULL;
- }
- if(ns->href != NULL) {
- data->xpathNamespaces[count++] = xmlStrdup(ns->href);
- } else {
- data->xpathNamespaces[count++] = NULL;
+ for(tmp = cur; tmp != NULL; tmp = tmp->parent) {
+ ns = tmp->nsDef;
+ while((ns != NULL) && (count < data->size)){
+ if(ns->prefix != NULL) {
+ data->xpathNamespaces[count++] = xmlStrdup(ns->prefix);
+ } else {
+ data->xpathNamespaces[count++] = NULL;
+ }
+ if(ns->href != NULL) {
+ data->xpathNamespaces[count++] = xmlStrdup(ns->href);
+ } else {
+ data->xpathNamespaces[count++] = NULL;
+ }
+ ns = ns->next;
}
- ns = ns->next;
}
+
cur = xmlSecGetNextElementNode(cur->next);
if(cur != NULL) {
@@ -576,10 +965,36 @@ xmlSecXPathTransformDataRead(const xmlNodePtr node) {
"%s: unexpected node found\n",
func);
#endif
- xmlSecXPathTransformDataDestroy(data);
+ xmlSecXPathDataDestroy(data);
return(NULL);
}
return(data);
}
+static void
+xmlSecNodeSetDebugDump(xmlNodeSetPtr nodes, FILE *output) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecNodeSetDebugDump";
+ int i, l;
+ xmlNodePtr cur;
+
+ if((nodes == NULL) || (output == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: nodes or output is null\n",
+ func);
+#endif
+ return;
+ }
+
+ fprintf(output, "== Nodes set\n");
+ l = xmlXPathNodeSetGetLength(nodes);
+ for(i = 0; i < l; ++i) {
+ cur = xmlXPathNodeSetItem(nodes, i);
+ fprintf(output, "%d: %s\n", cur->type,
+ (cur->name) ? cur->name : BAD_CAST "null");
+ }
+}
+
+
+
diff --git a/src/xpathalt.c b/src/xpathalt.c
new file mode 100644
index 00000000..38f3891f
--- /dev/null
+++ b/src/xpathalt.c
@@ -0,0 +1,623 @@
+/**
+ * XMLSec library
+ *
+ * XPath transform
+ *
+ * See Copyright for the status of this software.
+ *
+ * Author: Aleksey Sanin <aleksey@aleksey.com>
+ */
+#include "globals.h"
+
+#ifndef XMLSEC_NO_XPATHALT
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/xmltree.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/transforms.h>
+#include <xmlsec/transformsInternal.h>
+#include <xmlsec/xpath.h>
+
+static void xmlSecNodeSetDebugDump (xmlNodeSetPtr nodes,
+ FILE *output);
+
+
+static xmlSecTransformPtr xmlSecXPathAltCreate (xmlSecTransformId id);
+static void xmlSecXPathAltDestroy (xmlSecTransformPtr transform);
+static int xmlSecXPathAltReadNode (xmlSecTransformPtr transform,
+ xmlNodePtr transformNode);
+static int xmlSecXPathAltExecute (xmlSecXmlTransformPtr transform,
+ xmlDocPtr ctxDoc,
+ xmlDocPtr *doc,
+ xmlNodeSetPtr *nodes);
+
+struct _xmlSecXmlTransformId xmlSecXPathAltId = {
+ /* same as xmlSecTransformId */
+ xmlSecTransformTypeXml, /* xmlSecTransformType type; */
+ xmlSecUsageDSigTransform, /* xmlSecTransformUsage usage; */
+ BAD_CAST "http://www.nue.et-inf.uni-siegen.de/~geuer-pollmann/#xpathFilter", /* const xmlChar *href; */
+
+ xmlSecXPathAltCreate, /* xmlSecTransformCreateMethod create; */
+ xmlSecXPathAltDestroy, /* xmlSecTransformDestroyMethod destroy; */
+ xmlSecXPathAltReadNode, /* xmlSecTransformReadNodeMethod read; */
+
+ /* xmlTransform info */
+ xmlSecXPathAltExecute /* xmlSecXmlTransformExecuteMethod executeXml; */
+};
+xmlSecTransformId xmlSecXPathAlt = (xmlSecTransformId)(&xmlSecXPathAltId);
+
+
+static xmlNodeSetPtr xmlSecXPathAltAddNodes (xmlNodeSetPtr nodes,
+ xmlNodePtr cur,
+ xmlNodePtr here,
+ xmlDocPtr ctxDoc,
+ xmlDocPtr doc);
+static int xmlSecXPathAltWalkTheTree (xmlNodeSetPtr nodes,
+ xmlNodePtr cur,
+ xmlNodeSetPtr includeSet,
+ xmlNodeSetPtr excludeSet,
+ xmlNodeSetPtr includeSearchSet,
+ xmlNodeSetPtr excludeSearchSet,
+ int mode);
+static int xmlSecXPathAltAddNode (xmlNodeSetPtr nodes,
+ xmlNodePtr cur,
+ xmlNodeSetPtr includeSet,
+ xmlNodeSetPtr excludeSet,
+ xmlNodeSetPtr includeSearchSet,
+ xmlNodeSetPtr excludeSearchSet,
+ int mode);
+
+static const xmlChar xmlSecXPathAltNs[] = "http://www.nue.et-inf.uni-siegen.de/~geuer-pollmann/#xpathFilter";
+
+/**
+ * XPathAlt transform
+ */
+/**
+ * xmlSecXPathAltCreate
+ * @id
+ *
+ *
+ */
+static xmlSecTransformPtr
+xmlSecXPathAltCreate(xmlSecTransformId id) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathAltCreate";
+ xmlSecXmlTransformPtr xmlTransform;
+
+ if((id != xmlSecXPathAlt)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: id is not recognized\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ xmlTransform = (xmlSecXmlTransformPtr)xmlMalloc(sizeof(struct _xmlSecXmlTransform));
+ if(xmlTransform == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to allocate struct _xmlSecXmlTransform \n",
+ func);
+#endif
+ return(NULL);
+ }
+ memset(xmlTransform, 0, sizeof(struct _xmlSecXmlTransform));
+ xmlTransform->id = (xmlSecXmlTransformId)id;
+
+ return((xmlSecTransformPtr)xmlTransform);
+}
+
+/**
+ * xmlSecXPathAltDestroy
+ * @transform:
+ *
+ *
+ */
+static void
+xmlSecXPathAltDestroy(xmlSecTransformPtr transform) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathAltDestroy";
+ xmlSecXmlTransformPtr xmlTransform;
+
+ if(!xmlSecTransformCheckId(transform, xmlSecXPathAlt)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transform is invalid or transformNode is null\n",
+ func);
+#endif
+ return;
+ }
+ xmlTransform = (xmlSecXmlTransformPtr)transform;
+
+ memset(xmlTransform, 0, sizeof(struct _xmlSecXmlTransform));
+ xmlFree(xmlTransform);
+}
+
+/**
+ * xmlSecXPathAltReadNode
+ * @transform:
+ * @transformNode:
+ *
+ * http://www.w3.org/TR/xmldsig-core/#sec-XPath
+ */
+static int
+xmlSecXPathAltReadNode(xmlSecTransformPtr transform, xmlNodePtr transformNode) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathAltReadNode";
+ xmlSecXmlTransformPtr xmlTransform;
+ xmlNodePtr cur;
+
+ if((!xmlSecTransformCheckId(transform, xmlSecXPathAlt)) ||
+ (transformNode == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transform is invalid or transformNode is null\n",
+ func);
+#endif
+ return(-1);
+ }
+ xmlTransform = (xmlSecXmlTransformPtr)transform;
+ xmlTransform->here = transformNode;
+
+ cur = xmlSecGetNextElementNode(transformNode->children);
+ if((cur == NULL) || (!xmlSecCheckNodeName(cur, BAD_CAST "XPathAlternative", xmlSecXPathAltNs))) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: required element \"XPathAlternative\" missed\n",
+ func);
+#endif
+ return(-1);
+ }
+ xmlTransform->xmlData = cur;
+
+ cur = xmlSecGetNextElementNode(cur->next);
+ if(cur != NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unexpected node found \"%s\"\n",
+ func, cur->name);
+#endif
+ return(-1);
+ }
+
+ return(0);
+}
+
+/**
+ * xmlSecXPathAltExecute
+ * @transform:
+ * @ctxDoc:
+ * @doc:
+ * @nodes:
+ *
+ */
+static int
+xmlSecXPathAltExecute(xmlSecXmlTransformPtr transform, xmlDocPtr ctxDoc,
+ xmlDocPtr *doc, xmlNodeSetPtr *nodes) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathAltExecute";
+ xmlSecXmlTransformPtr xmlTransform;
+ xmlNodeSetPtr includeSet = NULL;
+ xmlNodeSetPtr excludeSet = NULL;
+ xmlNodeSetPtr includeSearchSet = NULL;
+ xmlNodeSetPtr excludeSearchSet = NULL;
+ xmlNodeSetPtr tmp;
+ xmlNodePtr cur;
+ xmlChar *prop;
+ int res = -1;
+ int mode = 1;
+
+ if((!xmlSecTransformCheckId(transform, xmlSecXPathAlt)) ||
+ (nodes == NULL) || (doc == NULL) || ((*doc) == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transform is invalid or something else is null\n",
+ func);
+#endif
+ return(-1);
+ }
+ xmlTransform = (xmlSecXmlTransformPtr)transform;
+
+ if(xmlTransform->here == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: transform node is null\n",
+ func);
+#endif
+ goto done;
+ }
+
+ /* create nodes */
+ cur = xmlSecGetNextElementNode(((xmlNodePtr)xmlTransform->xmlData)->children);
+ while(cur != NULL) {
+ if(xmlSecCheckNodeName(cur, BAD_CAST "Include", xmlSecXPathAltNs)) {
+ tmp = xmlSecXPathAltAddNodes(includeSet, cur, xmlTransform->here, ctxDoc, *doc);
+ if(tmp == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to get Include nodes\n",
+ func);
+#endif
+ goto done;
+ }
+ includeSet = tmp;
+ } else if(xmlSecCheckNodeName(cur, BAD_CAST "Exclude", xmlSecXPathAltNs)) {
+ tmp = xmlSecXPathAltAddNodes(excludeSet, cur, xmlTransform->here, ctxDoc, *doc);
+ if(tmp == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to get Exclude nodes\n",
+ func);
+#endif
+ goto done;
+ }
+ excludeSet = tmp;
+ } else if(xmlSecCheckNodeName(cur, BAD_CAST "IncludeButSearch", xmlSecXPathAltNs)) {
+ tmp = xmlSecXPathAltAddNodes(includeSearchSet, cur, xmlTransform->here, ctxDoc, *doc);
+ if(tmp == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to get IncludeButSearch nodes\n",
+ func);
+#endif
+ goto done;
+ }
+ includeSearchSet = tmp;
+ } else if(xmlSecCheckNodeName(cur, BAD_CAST "ExcludeButSearch", xmlSecXPathAltNs)) {
+ tmp = xmlSecXPathAltAddNodes(excludeSearchSet, cur, xmlTransform->here, ctxDoc, *doc);
+ if(tmp == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to get ExcludeButSearch nodes\n",
+ func);
+#endif
+ goto done;
+ }
+ excludeSearchSet = tmp;
+ } else {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unknown node \"%s\"\n",
+ func, cur->name);
+#endif
+ goto done;
+ }
+ cur = xmlSecGetNextElementNode(cur->next);
+ }
+
+/*
+ fprintf(stderr, "=Include set\n");
+ xmlSecNodeSetDebugDump(includeSet, stderr);
+ fprintf(stderr, "=Exclude set\n");
+ xmlSecNodeSetDebugDump(excludeSet, stderr);
+ fprintf(stderr, "=Include Search set\n");
+ xmlSecNodeSetDebugDump(includeSearchSet, stderr);
+ fprintf(stderr, "=Exclude Search set\n");
+ xmlSecNodeSetDebugDump(excludeSearchSet, stderr);
+*/
+
+ /* read IncludeSlashPolicy */
+ cur = xmlDocGetRootElement(*doc);
+ prop = xmlGetProp(cur, BAD_CAST "IncludeSlashPolicy");
+ if((prop != NULL) && (xmlStrEqual(prop, BAD_CAST "true"))) {
+ tmp = xmlXPathNodeSetCreate(cur);
+ mode = 1;
+ xmlFree(prop);
+ } else if((prop != NULL)) {
+ tmp = xmlXPathNodeSetCreate(NULL);
+ mode = 0;
+ xmlFree(prop);
+ } else {
+ /* todo: error>? */
+ tmp = xmlXPathNodeSetCreate(NULL);
+ mode = 0;
+ }
+ if(tmp == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to create nodes set\n",
+ func);
+#endif
+ goto done;
+ }
+
+ res = xmlSecXPathAltWalkTheTree(tmp, cur, includeSet, excludeSet, includeSearchSet,
+ excludeSearchSet, mode);
+ if(res < 0) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: tree walk failed\n",
+ func);
+#endif
+ xmlXPathFreeNodeSet(tmp);
+ goto done;
+ }
+
+/*
+ fprintf(stderr, "=Result set\n");
+ xmlSecNodeSetDebugDump(tmp, stderr);
+*/
+
+ (*nodes) = xmlXPathIntersection((*nodes), tmp);
+ xmlXPathFreeNodeSet(tmp);
+
+ res = 0;
+
+done:
+ if(includeSet != NULL) {
+ xmlXPathFreeNodeSet(includeSet);
+ }
+ if(excludeSet != NULL) {
+ xmlXPathFreeNodeSet(excludeSet);
+ }
+ if(includeSearchSet != NULL) {
+ xmlXPathFreeNodeSet(includeSearchSet);
+ }
+ if(excludeSearchSet != NULL) {
+ xmlXPathFreeNodeSet(excludeSearchSet);
+ }
+ return(res);
+}
+
+static xmlNodeSetPtr
+xmlSecXPathAltAddNodes(xmlNodeSetPtr nodes, xmlNodePtr cur,
+ xmlNodePtr here, xmlDocPtr ctxDoc, xmlDocPtr doc) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecXPathAltAddNodes";
+ xmlChar *expr;
+ xmlXPathObjectPtr xpath;
+ xmlXPathContextPtr ctx;
+ xmlNodeSetPtr res;
+ xmlNodePtr tmp;
+ xmlNsPtr ns;
+
+ if(doc == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: doc is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ /**
+ * Create XPath context
+ */
+ ctx = xmlXPathNewContext(doc);
+ if(ctx == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: xpath context is null\n",
+ func);
+#endif
+ return(NULL);
+ }
+
+ /* function here() works only in he same document */
+ if(doc == ctxDoc) {
+ xmlXPathRegisterFunc(ctx, (xmlChar *)"here", xmlSecXPathHereFunction);
+ ctx->here = here;
+ ctx->xptr = 1;
+ }
+
+ /* register namespaces */
+ for(tmp = cur; tmp != NULL; tmp = tmp->parent) {
+ for(ns = tmp->nsDef; ns != NULL; ns = ns->next){
+ if((ns->prefix != NULL) && (xmlXPathRegisterNs(ctx, ns->prefix, ns->href) != 0)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: unable to register NS with prefix=\"%s\" and href=\"%s\"\n",
+ func,
+ ((ns->prefix != NULL) ? (char*)ns->prefix : "null"),
+ ((ns->href != NULL) ? (char*)ns->href : "null"));
+#endif
+ xmlXPathFreeContext(ctx);
+ return(NULL);
+ }
+ }
+ }
+
+ expr = xmlNodeGetContent(cur);
+ if(expr == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed to get node content\n",
+ func);
+#endif
+ xmlXPathFreeContext(ctx);
+ return(NULL);
+ }
+
+ /*
+ * Evaluate xpath
+ */
+ xpath = xmlXPathEvalExpression(expr, ctx);
+ if(xpath == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: xpath eval failed\n",
+ func);
+#endif
+ xmlFree(expr);
+ xmlXPathFreeContext(ctx);
+ return(NULL);
+ }
+
+ if(xpath->nodesetval != NULL) {
+ res = xmlXPathNodeSetMerge(nodes, xpath->nodesetval);
+ if(res == NULL) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s nodes set merge failed\n",
+ func);
+#endif
+ xmlFree(expr);
+ xmlXPathFreeObject(xpath);
+ xmlXPathFreeContext(ctx);
+ return(NULL);
+ }
+ } else {
+ res = nodes;
+ }
+
+ /* free everything */
+ xmlFree(expr);
+ xmlXPathFreeContext(ctx);
+ xmlXPathFreeObject(xpath);
+ return(res);
+}
+
+
+static int
+xmlSecXPathAltWalkTheTree(xmlNodeSetPtr nodes, xmlNodePtr cur,
+ xmlNodeSetPtr includeSet, xmlNodeSetPtr excludeSet,
+ xmlNodeSetPtr includeSearchSet, xmlNodeSetPtr excludeSearchSet,
+ int mode) {
+ static const char func[] = "xmlSecXPathAltWalkTheTree";
+ int ret;
+
+ if((nodes == NULL) || (cur == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: nodes or cur is null\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ ret = 0;
+ for(cur = cur->children; cur != NULL; cur = cur->next) {
+ if((includeSet != NULL) && xmlXPathNodeSetContains(includeSet, cur)) {
+ /* add all nodes from subtree */
+ xmlSecGetChildNodeSet(cur, nodes, 1);
+ } else if((excludeSet != NULL) && xmlXPathNodeSetContains(excludeSet, cur)) {
+ /* do nothing */
+ } else if((includeSearchSet != NULL) && xmlXPathNodeSetContains(includeSearchSet, cur)) {
+ ret = xmlSecXPathAltAddNode(nodes, cur, includeSet, excludeSet,
+ includeSearchSet, excludeSearchSet, 1);
+ if(ret >= 0) {
+ ret = xmlSecXPathAltWalkTheTree(nodes, cur, includeSet, excludeSet,
+ includeSearchSet, excludeSearchSet,
+ 1);
+ }
+ } else if((excludeSearchSet != NULL) && xmlXPathNodeSetContains(excludeSearchSet, cur)) {
+ ret = xmlSecXPathAltAddNode(nodes, cur, includeSet, excludeSet,
+ includeSearchSet, excludeSearchSet, 0);
+ if(ret >= 0) {
+ ret = xmlSecXPathAltWalkTheTree(nodes, cur, includeSet, excludeSet,
+ includeSearchSet, excludeSearchSet,
+ 0);
+ }
+ } else {
+ ret = xmlSecXPathAltAddNode(nodes, cur, includeSet, excludeSet,
+ includeSearchSet, excludeSearchSet, mode);
+ if(ret >= 0) {
+ ret = xmlSecXPathAltWalkTheTree(nodes, cur, includeSet, excludeSet,
+ includeSearchSet, excludeSearchSet,
+ mode);
+ }
+ }
+
+ if(ret < 0) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: failed\n",
+ func);
+#endif
+ return(-1);
+ }
+ }
+
+ return(0);
+}
+
+static int
+xmlSecXPathAltAddNode(xmlNodeSetPtr nodes, xmlNodePtr cur,
+ xmlNodeSetPtr includeSet, xmlNodeSetPtr excludeSet,
+ xmlNodeSetPtr includeSearchSet, xmlNodeSetPtr excludeSearchSet,
+ int mode) {
+
+ static const char func[] = "xmlSecXPathAltWalkTheTree";
+ int include;
+ int exclude;
+ xmlNsPtr ns;
+ xmlAttrPtr attr;
+
+ if((nodes == NULL) || (cur == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: nodes or cur is null\n",
+ func);
+#endif
+ return(-1);
+ }
+
+ if(mode) {
+ xmlXPathNodeSetAdd(nodes, cur);
+ }
+
+ /* add all attrs */
+ attr = cur->properties;
+ while (attr != NULL) {
+ include = ((includeSet != NULL) &&
+ xmlXPathNodeSetContains(includeSet, (xmlNodePtr)attr)) ||
+ ((includeSearchSet != NULL) &&
+ xmlXPathNodeSetContains(includeSearchSet, (xmlNodePtr)attr));
+ exclude = ((excludeSet != NULL) &&
+ xmlXPathNodeSetContains(excludeSet, (xmlNodePtr)attr)) ||
+ ((excludeSearchSet != NULL) &&
+ xmlXPathNodeSetContains(excludeSearchSet, (xmlNodePtr)attr));
+
+ if((mode && !exclude) || include) {
+ xmlXPathNodeSetAdd(nodes, (xmlNodePtr)attr);
+ }
+ attr = attr->next;
+ }
+
+ /* add namespaces */
+ for (ns = cur->nsDef; ns != NULL; ns = ns->next) {
+ include = ((includeSet != NULL) &&
+ xmlXPathNodeSetContains(includeSet, (xmlNodePtr)ns)) ||
+ ((includeSearchSet != NULL) &&
+ xmlXPathNodeSetContains(includeSearchSet, (xmlNodePtr)ns));
+ exclude = ((excludeSet != NULL) &&
+ xmlXPathNodeSetContains(excludeSet, (xmlNodePtr)ns)) ||
+ ((excludeSearchSet != NULL) &&
+ xmlXPathNodeSetContains(excludeSearchSet, (xmlNodePtr)ns));
+ if((mode && !exclude) || include) {
+ xmlXPathNodeSetAddNs(nodes, cur, ns);
+ }
+ }
+ return(0);
+}
+
+
+static void
+xmlSecNodeSetDebugDump(xmlNodeSetPtr nodes, FILE *output) {
+ static const char func[] ATTRIBUTE_UNUSED = "xmlSecNodeSetDebugDump";
+ int i, l;
+ xmlNodePtr cur;
+
+ if((nodes == NULL) || (output == NULL)) {
+#ifdef XMLSEC_DEBUG
+ xmlGenericError(xmlGenericErrorContext,
+ "%s: nodes or output is null\n",
+ func);
+#endif
+ return;
+ }
+
+ fprintf(output, "== Nodes set\n");
+ l = xmlXPathNodeSetGetLength(nodes);
+ for(i = 0; i < l; ++i) {
+ cur = xmlXPathNodeSetItem(nodes, i);
+ fprintf(output, "%d: %s\n", cur->type,
+ (cur->name) ? cur->name : BAD_CAST "null");
+ }
+}
+
+#endif /* XMLSEC_NO_XPATHALT */
+
diff --git a/src/xslt.c b/src/xslt.c
index dfe2724c..c4379420 100644
--- a/src/xslt.c
+++ b/src/xslt.c
@@ -40,7 +40,6 @@
#include <string.h>
#include <libxml/tree.h>
-#include <libxml/c14n.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
@@ -395,10 +394,8 @@ static int
xmlSecTransformXsltReadNode(xmlSecTransformPtr transform, xmlNodePtr transformNode) {
static const char func[] ATTRIBUTE_UNUSED = "xmlSecTransformXsltReadNode";
xmlSecBinTransformPtr xsltTransform;
- xmlNodeSetPtr nodes = NULL;
- xmlOutputBufferPtr output = NULL;
+ xmlBufferPtr buffer;
xmlNodePtr cur;
- int ret;
if(!xmlSecTransformCheckId(transform, xmlSecTransformXslt) ||
(transformNode == NULL)) {
@@ -410,55 +407,28 @@ xmlSecTransformXsltReadNode(xmlSecTransformPtr transform, xmlNodePtr transformNo
return(-1);
}
xsltTransform = (xmlSecBinTransformPtr)transform;
-
- cur = transformNode->children;
- while(cur != NULL) {
- /* we use c14n to get all namespaces */
- nodes = xmlSecGetChildNodeSet(cur, nodes, 1);
- if(nodes == NULL) {
-#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: failed to get transform node childs\n",
- func);
-#endif
- return(-1);
- }
- cur = cur->next;
- }
-
- output = xmlAllocOutputBuffer(NULL);
- if(output == NULL) {
+
+ buffer = xmlBufferCreate();
+ if(buffer == NULL) {
#ifdef XMLSEC_DEBUG
xmlGenericError(xmlGenericErrorContext,
"%s: failed to allocate output buffer\n",
func);
#endif
- xmlXPathFreeNodeSet(nodes);
return(-1);
}
- ret = xmlC14NDocSaveTo(transformNode->doc, nodes, 0, NULL, 1, output);
- if(ret < 0) {
-#ifdef XMLSEC_DEBUG
- xmlGenericError(xmlGenericErrorContext,
- "%s: failed to dump the node\n",
- func);
-#endif
- xmlOutputBufferClose(output);
- xmlXPathFreeNodeSet(nodes);
- return(-1);
+ cur = transformNode->children;
+ while(cur != NULL) {
+ xmlNodeDump(buffer, cur->doc, cur, 0, 0);
+ cur = cur->next;
}
if(xsltTransform->binData != NULL) {
xmlBufferEmpty((xmlBufferPtr)xsltTransform->binData);
xmlBufferFree((xmlBufferPtr)(xsltTransform->data));
}
- xsltTransform->binData = output->buffer;
- output->buffer = NULL;
-
-
- xmlXPathFreeNodeSet(nodes);
- xmlOutputBufferClose(output);
+ xsltTransform->binData = buffer;
return(0);
}
@@ -524,7 +494,6 @@ xmlSecTransformXsltExecute(xmlBufferPtr buffer, xmlBufferPtr xslt) {
goto done;
}
-
docXslt = xmlSecParseMemory(xmlBufferContent(xslt), xmlBufferLength(xslt), 1);
if(docXslt == NULL) {
#ifdef XMLSEC_DEBUG
@@ -569,7 +538,7 @@ xmlSecTransformXsltExecute(xmlBufferPtr buffer, xmlBufferPtr xslt) {
#endif
goto done;
}
-
+
ret = xsltSaveResultTo(output, docRes, cur);
if(ret < 0) {
#ifdef XMLSEC_DEBUG
diff --git a/tests/01-geuerp-xfilter2/xpath2filterOmitComments.tmpl b/tests/01-geuerp-xfilter2/xpath2filterOmitComments.tmpl
new file mode 100644
index 00000000..b54a5f7b
--- /dev/null
+++ b/tests/01-geuerp-xfilter2/xpath2filterOmitComments.tmpl
@@ -0,0 +1,49 @@
+<Document>
+ <ToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ <NotToBeSigned>
+ <ReallyToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ </ReallyToBeSigned>
+ </NotToBeSigned>
+ </ToBeSigned>
+ <ToBeSigned>
+ <Data></Data>
+ <NotToBeSigned>
+ <Data></Data>
+ </NotToBeSigned>
+ </ToBeSigned>
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"></ds:SignatureMethod>
+<ds:Reference URI="">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="intersect">
+//ToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="subtract">
+//NotToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="union">
+//ReallyToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue></ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue></ds:SignatureValue>
+<ds:KeyInfo>
+<ds:KeyName>test-hmac-sha1</ds:KeyName>
+</ds:KeyInfo>
+</ds:Signature>
+</Document> \ No newline at end of file
diff --git a/tests/01-geuerp-xfilter2/xpath2filterOmitComments.xml b/tests/01-geuerp-xfilter2/xpath2filterOmitComments.xml
new file mode 100644
index 00000000..0cfd74ec
--- /dev/null
+++ b/tests/01-geuerp-xfilter2/xpath2filterOmitComments.xml
@@ -0,0 +1,49 @@
+<Document>
+ <ToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ <NotToBeSigned>
+ <ReallyToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ </ReallyToBeSigned>
+ </NotToBeSigned>
+ </ToBeSigned>
+ <ToBeSigned>
+ <Data></Data>
+ <NotToBeSigned>
+ <Data></Data>
+ </NotToBeSigned>
+ </ToBeSigned>
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"></ds:SignatureMethod>
+<ds:Reference URI="">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="intersect">
+//ToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="subtract">
+//NotToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="union">
+//ReallyToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>fYOT32q8tu2q8QBximRTopkGFAM=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>7BeqHEYVknT9VuJn27D/YwL/UZo=</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:KeyName>test-hmac-sha1</ds:KeyName>
+</ds:KeyInfo>
+</ds:Signature>
+</Document> \ No newline at end of file
diff --git a/tests/01-geuerp-xfilter2/xpath2filterWithComments.tmpl b/tests/01-geuerp-xfilter2/xpath2filterWithComments.tmpl
new file mode 100644
index 00000000..6186a9a0
--- /dev/null
+++ b/tests/01-geuerp-xfilter2/xpath2filterWithComments.tmpl
@@ -0,0 +1,50 @@
+<Document>
+ <ToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ <NotToBeSigned>
+ <ReallyToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ </ReallyToBeSigned>
+ </NotToBeSigned>
+ </ToBeSigned>
+ <ToBeSigned>
+ <Data></Data>
+ <NotToBeSigned>
+ <Data></Data>
+ </NotToBeSigned>
+ </ToBeSigned>
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"></ds:SignatureMethod>
+<ds:Reference URI="">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="intersect">
+//ToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="subtract">
+//NotToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="union">
+//ReallyToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>zyVVYItyOgm1KmkYVapBXXEHlLc=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>9hCB+9RRKYeGE/YhfzdnEWf0WrY=</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:KeyName>test-hmac-sha1</ds:KeyName>
+</ds:KeyInfo>
+</ds:Signature>
+</Document> \ No newline at end of file
diff --git a/tests/01-geuerp-xfilter2/xpath2filterWithComments.xml b/tests/01-geuerp-xfilter2/xpath2filterWithComments.xml
new file mode 100644
index 00000000..6186a9a0
--- /dev/null
+++ b/tests/01-geuerp-xfilter2/xpath2filterWithComments.xml
@@ -0,0 +1,50 @@
+<Document>
+ <ToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ <NotToBeSigned>
+ <ReallyToBeSigned>
+ <!-- comment -->
+ <Data></Data>
+ </ReallyToBeSigned>
+ </NotToBeSigned>
+ </ToBeSigned>
+ <ToBeSigned>
+ <Data></Data>
+ <NotToBeSigned>
+ <Data></Data>
+ </NotToBeSigned>
+ </ToBeSigned>
+<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"></ds:SignatureMethod>
+<ds:Reference URI="">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="intersect">
+//ToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="subtract">
+//NotToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/2002/04/xmldsig-filter2">
+<dsig-xpath:XPath xmlns:dsig-xpath="http://www.w3.org/2002/04/xmldsig-filter2" Filter="union">
+//ReallyToBeSigned
+</dsig-xpath:XPath>
+</ds:Transform>
+<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
+<ds:DigestValue>zyVVYItyOgm1KmkYVapBXXEHlLc=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>9hCB+9RRKYeGE/YhfzdnEWf0WrY=</ds:SignatureValue>
+<ds:KeyInfo>
+<ds:KeyName>test-hmac-sha1</ds:KeyName>
+</ds:KeyInfo>
+</ds:Signature>
+</Document> \ No newline at end of file
diff --git a/tests/01-phaos-xmlenc-3/Readme.txt b/tests/01-phaos-xmlenc-3/Readme.txt
index a15707e3..5d11ee2d 100644
--- a/tests/01-phaos-xmlenc-3/Readme.txt
+++ b/tests/01-phaos-xmlenc-3/Readme.txt
@@ -1,52 +1,52 @@
-This directory contains the following files:
-
- Readme.txt -- This file.
-
- payment.xml -- A sample XML file.
-
- key.txt -- Keys for decrypting the encrypted XML files enc-*-*-*-*.xml.
-
- dh-priv-key.der
- -- Diffie-Hellman private key encoded in PKCS#8 PrivateKeyInfo formate.
- This key can be used to decrypt the files enc-*-*-ka-dh.xml.
- rsa-priv-key.der
- -- RSA private key encoded in PKCS#8 PrivateKeyInfo formate.
- This key can be used to decrypt the files enc-*-*-kt-*.xml.
-
- enc-*-*-*-*.xml
- -- XML document obtained by encrypting and replacing part of the
- sample payment.xml. The data encryption key is in turn
- encrypted.
-
- Each file has the form: enc-A-B-C-D.xml, where:
-
- A indicates the type of the data encrypted. This includes:
-
- element = The CreditCard element.
- content = The content of the CreditCard element
- (multiple elements).
- text = The content of the Number element (text node).
-
- B indicates the data encryption algorithm.
-
- C indicates the key encryption protocols:
- kt = key transport
- kw = key wrap
- ka = key agreement
-
- D indicates the key encryption algorithm.
-
-bad-*-enc-*-*-*-*.xml
- -- some "screw-up" samples
-
-The sample encrypted XML files are produced from Phaos XML toolkit.
-
-Jiandong Guo
-Phaos Technology
-http://www.phaos.com
-
-jguo@phaos.com
-
-
-
-
+This directory contains the following files:
+
+ Readme.txt -- This file.
+
+ payment.xml -- A sample XML file.
+
+ key.txt -- Keys for decrypting the encrypted XML files enc-*-*-*-*.xml.
+
+ dh-priv-key.der
+ -- Diffie-Hellman private key encoded in PKCS#8 PrivateKeyInfo formate.
+ This key can be used to decrypt the files enc-*-*-ka-dh.xml.
+ rsa-priv-key.der
+ -- RSA private key encoded in PKCS#8 PrivateKeyInfo formate.
+ This key can be used to decrypt the files enc-*-*-kt-*.xml.
+
+ enc-*-*-*-*.xml
+ -- XML document obtained by encrypting and replacing part of the
+ sample payment.xml. The data encryption key is in turn
+ encrypted.
+
+ Each file has the form: enc-A-B-C-D.xml, where:
+
+ A indicates the type of the data encrypted. This includes:
+
+ element = The CreditCard element.
+ content = The content of the CreditCard element
+ (multiple elements).
+ text = The content of the Number element (text node).
+
+ B indicates the data encryption algorithm.
+
+ C indicates the key encryption protocols:
+ kt = key transport
+ kw = key wrap
+ ka = key agreement
+
+ D indicates the key encryption algorithm.
+
+bad-*-enc-*-*-*-*.xml
+ -- some "screw-up" samples
+
+The sample encrypted XML files are produced from Phaos XML toolkit.
+
+Jiandong Guo
+Phaos Technology
+http://www.phaos.com
+
+jguo@phaos.com
+
+
+
+
diff --git a/tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml b/tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml
index e8f0541b..b7156579 100644
--- a/tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml
+++ b/tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-tripledes-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>HgVuHoXxBQWD9fvi0gt9TanywZ5lJokM/12fcMG6gRoMjsCPulH+4A==</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- yUMIHkj5EETckjZ59fpda4+m4YLCrkJsnuRz+Q3e5sP+VvHKRH1kdeGkXw3kYURV
- JM3nQjGl2egW80oUxSykQD2F9iDoIjNhLSgIbyuse64oo/5/v9IiaUpSvrAocwLP
- AzFIUmOrxmIagAkRGDOeMR8tdHLD6g84dQj4O/aGfwhL/2wUo/l+7onrbmsd6pVI
- fjNyvXm+eITuyUnkDTHrCR+dfb2sHaQ3g3McgyfP6ZjI/L50SPJZ/w==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-tripledes-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>HgVuHoXxBQWD9fvi0gt9TanywZ5lJokM/12fcMG6gRoMjsCPulH+4A==</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ yUMIHkj5EETckjZ59fpda4+m4YLCrkJsnuRz+Q3e5sP+VvHKRH1kdeGkXw3kYURV
+ JM3nQjGl2egW80oUxSykQD2F9iDoIjNhLSgIbyuse64oo/5/v9IiaUpSvrAocwLP
+ AzFIUmOrxmIagAkRGDOeMR8tdHLD6g84dQj4O/aGfwhL/2wUo/l+7onrbmsd6pVI
+ fjNyvXm+eITuyUnkDTHrCR+dfb2sHaQ3g3McgyfP6ZjI/L50SPJZ/w==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/dh-priv-key.der b/tests/01-phaos-xmlenc-3/dh-priv-key.der
index 6aaa277b..8af4f0ac 100644
--- a/tests/01-phaos-xmlenc-3/dh-priv-key.der
+++ b/tests/01-phaos-xmlenc-3/dh-priv-key.der
Binary files differ
diff --git a/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml b/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml
index 0ddbcf1a..4771f01d 100644
--- a/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml
+++ b/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes192-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>5+GpVUQNTAT3uY8pPedEg/PpftiX+fJsTCun+fgmIz0=</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- QBWlf/iYDXKbBWf0Pu3Bgzt5oLBwIs4NKPb/I0SxDYVnDc34i7tZG5UzHlztsWlX
- udfbIW9l7k5WVdy9bfXZWrp6sXamBedUQTrr+z4v4u2jWaUyqEioLe7h36QeoU23
- QvkOzRO9AiWm/QCCzePZ3Frp4LM9lXOE
- </CipherValue>
- </CipherData>
- </EncryptedData>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes192-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>5+GpVUQNTAT3uY8pPedEg/PpftiX+fJsTCun+fgmIz0=</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ QBWlf/iYDXKbBWf0Pu3Bgzt5oLBwIs4NKPb/I0SxDYVnDc34i7tZG5UzHlztsWlX
+ udfbIW9l7k5WVdy9bfXZWrp6sXamBedUQTrr+z4v4u2jWaUyqEioLe7h36QeoU23
+ QvkOzRO9AiWm/QCCzePZ3Frp4LM9lXOE
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml b/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml
index c05c1adc..7958d57d 100644
--- a/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml
+++ b/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-3des-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>/PZvvn42E9dmMUZ8KCY6B5XtLaaIaG4X5YNDwgV5Vlo=</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- rINpr0HonGcKnnf/vYx8N3gnd+1rb+zwH1vnfjyt+bOoSU72w/QqniT71/GxtFFx
- gwE0/arABVa1r8/PMRerWqyParMnpwIRq6dzQHKb5SqiqFEYPRZhytTGZFXN39oG
- YZkSINOli5paMwTWrq6hDSPRozKvfEqhuI0VgZU4OLM=
- </CipherValue>
- </CipherData>
- </EncryptedData>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-3des-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>/PZvvn42E9dmMUZ8KCY6B5XtLaaIaG4X5YNDwgV5Vlo=</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ rINpr0HonGcKnnf/vYx8N3gnd+1rb+zwH1vnfjyt+bOoSU72w/QqniT71/GxtFFx
+ gwE0/arABVa1r8/PMRerWqyParMnpwIRq6dzQHKb5SqiqFEYPRZhytTGZFXN39oG
+ YZkSINOli5paMwTWrq6hDSPRozKvfEqhuI0VgZU4OLM=
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml b/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml
index 2d28a973..86a787be 100644
--- a/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml
+++ b/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes256-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>IbnoS1cvuIFIGB46jj1V1FGftc92irrCwcC7BoBvxwQ=</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- /RDTbL2ce9Ca+2GS0FLJbFMXcpEvDLlW5RnpeKLe+pIO1lNpxsi40/tsqCVauD66
- FOCaXkKPcQYaeHVtD4jnE/OHZYFVJ8zS8z4I7nDg44R1e9ZJ9xN3kAEub1T2MdeK
- SVxPrhksHOWTwxFbPul9YRaNsrmi9a0XN4ggudJu+Rw=
- </CipherValue>
- </CipherData>
- </EncryptedData>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes256-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>IbnoS1cvuIFIGB46jj1V1FGftc92irrCwcC7BoBvxwQ=</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ /RDTbL2ce9Ca+2GS0FLJbFMXcpEvDLlW5RnpeKLe+pIO1lNpxsi40/tsqCVauD66
+ FOCaXkKPcQYaeHVtD4jnE/OHZYFVJ8zS8z4I7nDg44R1e9ZJ9xN3kAEub1T2MdeK
+ SVxPrhksHOWTwxFbPul9YRaNsrmi9a0XN4ggudJu+Rw=
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml b/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml
index 83d3667e..3f77c81b 100644
--- a/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml
+++ b/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:RetrievalMethod Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey" URI="#EK"/>
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
- MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIG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yos9jZZNniRxEtl6tLce2ReSVah+y8Lb3
- 3xSNSm+O9k2B42yP3Osrj175KNMSMLLM2ZuA0iq28aP7v7DmtDY7VNp0n+O4nJUM
- Eyy4RO0jmtXctt3jUfpCmGkqy42/LG6F5h1kluyfszjHvi/9lD5LEkCl2Y/3az+j
- 2vLuuXM45z6ef14Dlgsh7eJtqp3bRT0Tpp4JvBWMiuDZaV1zUcZq7q80lNMvXucb
- mSrSmlXn2lWPttfTrcjXrw==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- p5MMs6F765jIUqOj5rH1vAro0Rx4/PLIoEOXCOWaEGbEdCHh0m86zifozutcmoBA
- xy1SuxmJjtFDO32f/bpuDhdzFDgLrlVIcXrNeHGgken6NryC2n1NdGS9CiYsyaPF
- B5CWEkx3Prtbak6S20z3XZTJltOdoqzeNOn8/IDavLA=
- </CipherValue>
- </CipherData>
- </EncryptedData>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:RetrievalMethod Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey" URI="#EK"/>
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509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AQL4kvb4wsiUsM1EkPptcBQsym
+ OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
+ WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
+ p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
+ O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
+ kKO/vB9Ay64Rt88XbLnnGns=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ Vc7VOXgJDlw/oQ0hOvIaBKsGiOwyvIArzkhd2W7mZBQyeFlkJlxZQdnPGGg4kJE9
+ EGWeMWQZ0XavJy+xA9Z+PlIFqkpPHUXyos9jZZNniRxEtl6tLce2ReSVah+y8Lb3
+ 3xSNSm+O9k2B42yP3Osrj175KNMSMLLM2ZuA0iq28aP7v7DmtDY7VNp0n+O4nJUM
+ Eyy4RO0jmtXctt3jUfpCmGkqy42/LG6F5h1kluyfszjHvi/9lD5LEkCl2Y/3az+j
+ 2vLuuXM45z6ef14Dlgsh7eJtqp3bRT0Tpp4JvBWMiuDZaV1zUcZq7q80lNMvXucb
+ mSrSmlXn2lWPttfTrcjXrw==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ p5MMs6F765jIUqOj5rH1vAro0Rx4/PLIoEOXCOWaEGbEdCHh0m86zifozutcmoBA
+ xy1SuxmJjtFDO32f/bpuDhdzFDgLrlVIcXrNeHGgken6NryC2n1NdGS9CiYsyaPF
+ B5CWEkx3Prtbak6S20z3XZTJltOdoqzeNOn8/IDavLA=
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml b/tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml
index 18f69b15..ec75a1a7 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
- <KA-Nonce>YWJjZGU=</KA-Nonce>
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
- <OriginatorKeyInfo>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIEjDCCA/WgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzAyMjUwNDBaFw0xMDAxMDEwNTAwMDBaMIGMMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEOMAwGA1UEChMFUGhhb3MxFDASBgNV
- BAsTC0hlYWQgT2ZmaWNlMRcwFQYDVQQDEw5ESCBUZXN0IENsaWVudDEdMBsGCSqG
- SIb3DQE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k7inq87PnR1PWuHAm0A+C9E
- GPDSphFaPWO5LQTNflJ0l9IGjcNFGrJX0imWrjM2q6bGYz0ZK4cJhcX12YZOjR52
- TZh3cy6yAJG470i65nlz5/3ESWFHsMO0COrDi/Ca5RfMrYGcc8hrydzFlT1zqMFa
- 1yuqQKVsGwXcMBwDFgCZ/hqLAtBi6dyv6Ky+OfXfXgJBPhQCAgNPA4GFAAKBgQCM
- KtnMyjT9G1LKTZoN7rHwIO08D5j1YYIscsQDc+q4ny5WEFo+wEmOqxGcE9JrRdeb
- it6cT8F7TWWzeDJUyaXFEi4E1panCBCL1crqS/HbY8VH/zzhT+5L232LchsoYa1p
- dqxxLHW8RrOax4RLVrcIOPcW4x3Ggk0ANYQhR6kNmqNNMEswDwYDVR0PAQH/BAUD
- AwcIADAZBgNVHREEEjAQgQ50ZWNoQHBoYW9zLm9yZzAdBgNVHQ4EFgQUHddBJmfV
- 6MD3FTbVmHcLFN6QFAcwDQYJKoZIhvcNAQEEBQADgYEAKZl9P/ZmIrwHp3BTfBHl
- eFBk9CbhK14FObMGWSkfjqipb5snXBPE3uPBrvP1StisPRsK/y1OZfcjjkA6ht0j
- YWp9lohNDTlc/NOKGOQSCpntqr+wQhc6l16jezqR7sKv2eHBFGs0V7HCrEe2mTP4
- rDa/YKrmL5K6S9GSF27rx40=
- </ds:X509Certificate>
- </ds:X509Data>
- </RecipientKeyInfo>
- </AgreementMethod>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- BsIAtHyqE+foVEU2B8EoSAErEMjuunlXygmu+BC6SN+mYGFEsQ/frVzgiKBo2yRe
- bbnuUqAwDx03wS4zqmW5lD1C6bm/9tUSSv8HcNr7vRqrx3tRQ51y6y5xRbhjK6Zi
- vKHDXwZpxY4CnhfUwbtTSZisjNn/eV6UYxZdz2zmTxAJXAPI1dVFiPdqhljXhlDE
- tVAt/1f+//u1D782NMCuPVUt09Mtbf0pcFJhtoCmx84NVT3XwK+2Tg==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
+ <KA-Nonce>YWJjZGU=</KA-Nonce>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ <OriginatorKeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIEjDCCA/WgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzAyMjUwNDBaFw0xMDAxMDEwNTAwMDBaMIGMMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEOMAwGA1UEChMFUGhhb3MxFDASBgNV
+ BAsTC0hlYWQgT2ZmaWNlMRcwFQYDVQQDEw5ESCBUZXN0IENsaWVudDEdMBsGCSqG
+ SIb3DQEJARYOdGVjaEBwaGFvcy5vcmcwggJDMIIBuAYHKoZIzj4CATCCAasCgYEA
+ uavat7i6NOpnRObdx7Gz38h8xkgmv20XUaj1JjfvMAQfQFMHeshGhY2Q0mwvJ1Of
+ X/kZ4cMbSYUywh3WAY6zQs8W2uxg8GeduCLebNQG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/Ca5RfMrYGcc8hrydzFlT1zqMFa
+ 1yuqQKVsGwXcMBwDFgCZ/hqLAtBi6dyv6Ky+OfXfXgJBPhQCAgNPA4GFAAKBgQCM
+ KtnMyjT9G1LKTZoN7rHwIO08D5j1YYIscsQDc+q4ny5WEFo+wEmOqxGcE9JrRdeb
+ it6cT8F7TWWzeDJUyaXFEi4E1panCBCL1crqS/HbY8VH/zzhT+5L232LchsoYa1p
+ dqxxLHW8RrOax4RLVrcIOPcW4x3Ggk0ANYQhR6kNmqNNMEswDwYDVR0PAQH/BAUD
+ AwcIADAZBgNVHREEEjAQgQ50ZWNoQHBoYW9zLm9yZzAdBgNVHQ4EFgQUHddBJmfV
+ 6MD3FTbVmHcLFN6QFAcwDQYJKoZIhvcNAQEEBQADgYEAKZl9P/ZmIrwHp3BTfBHl
+ eFBk9CbhK14FObMGWSkfjqipb5snXBPE3uPBrvP1StisPRsK/y1OZfcjjkA6ht0j
+ YWp9lohNDTlc/NOKGOQSCpntqr+wQhc6l16jezqR7sKv2eHBFGs0V7HCrEe2mTP4
+ rDa/YKrmL5K6S9GSF27rx40=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </RecipientKeyInfo>
+ </AgreementMethod>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ BsIAtHyqE+foVEU2B8EoSAErEMjuunlXygmu+BC6SN+mYGFEsQ/frVzgiKBo2yRe
+ bbnuUqAwDx03wS4zqmW5lD1C6bm/9tUSSv8HcNr7vRqrx3tRQ51y6y5xRbhjK6Zi
+ vKHDXwZpxY4CnhfUwbtTSZisjNn/eV6UYxZdz2zmTxAJXAPI1dVFiPdqhljXhlDE
+ tVAt/1f+//u1D782NMCuPVUt09Mtbf0pcFJhtoCmx84NVT3XwK+2Tg==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml
index 8d900d9b..2772fbd7 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml
@@ -1,61 +1,61 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
- MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
- BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIB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HKzBmSjjgKkk
- xFcFVdiPT/XAhEZcuvkOyLMYgPN55slcnRzckOEq6zOcu8Ww6/2dG0a0TRioFeHW
- ecqmW8jawxxOVnVVSdDNlqwYWpM+2XxgYuSifsDwkwaNwVAM/xXgj05ZPr49powT
- 1nZJ5cARCmW5zLh6aNpQng==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- LBisCaY4C+s7h8LjVpi8++dCzxxM2P7jR+rw+W0bVZz/YNfG9Q4Id/GkTlcYP/aT
- WNJfNVhip8KD6QiQqjsRkaF81w8Uam1lVXz8X2Gc6Rsx5L7j+1OblmB6VLPuIwBJ
- wImjNiEX4RhrS4TfxF/zIq0sLT2DCHdHI752VCnZ8ulVKDnamCZUvT95YqlcCYnc
- VWAOV5fYH3YvtZ6S/zpTEKW79dnGQZL8od5aJsRrid5fq49X/5KtMw==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNV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+ WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
+ p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
+ O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
+ kKO/vB9Ay64Rt88XbLnnGns=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ bYDE3XSjELiEW/rX08ZQUcG1dK1l1uSw14EKhIHbwrM8DFZKF4fBaPXxG/91mkOA
+ cs3q0LZESrqHGVrm9UvqL48utkNrR56ud60FhIgSBgdKE/9qTMjrSCX1Vw7xfhJH
+ Fc4tD3vjhALLaO3SUT8esPQKPK4gEWYMNzdpyNQuD0mrLiQ/SnHuHKzBmSjjgKkk
+ xFcFVdiPT/XAhEZcuvkOyLMYgPN55slcnRzckOEq6zOcu8Ww6/2dG0a0TRioFeHW
+ ecqmW8jawxxOVnVVSdDNlqwYWpM+2XxgYuSifsDwkwaNwVAM/xXgj05ZPr49powT
+ 1nZJ5cARCmW5zLh6aNpQng==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ LBisCaY4C+s7h8LjVpi8++dCzxxM2P7jR+rw+W0bVZz/YNfG9Q4Id/GkTlcYP/aT
+ WNJfNVhip8KD6QiQqjsRkaF81w8Uam1lVXz8X2Gc6Rsx5L7j+1OblmB6VLPuIwBJ
+ wImjNiEX4RhrS4TfxF/zIq0sLT2DCHdHI752VCnZ8ulVKDnamCZUvT95YqlcCYnc
+ VWAOV5fYH3YvtZ6S/zpTEKW79dnGQZL8od5aJsRrid5fq49X/5KtMw==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml
index 0bbf0ae3..2cce7a18 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
- </EncryptionMethod>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBM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0JPSfv75/8M+O2O/xi+8N1b9KT94a4l1D1Q65hnX6F00t+wAWZSkcDUoD/y2/E
- RKGUyuQwsG6l58e4MwYpmDI4RhHrUYLCQBacAehqVZhwNxv99L7ANsqrZJoT7N0k
- ER9MbmuIZGb4qisLDfZtzIGKKUUiA3ARfQny4MUxFovSmVUF2OjqSBXUVV/PjMLi
- fVTVyqCMv08YwmM4abj33tKOEMtiZqAa09lUIpnCUzq2IAShSRNBzWIHe+ndoB6G
- 2p6ufk0TuRidwdQZkZwTW/2PjK1x7KejaqADWaOIImKhSBMpGzkVfDuv8aAFXOtf
- +LV67Ov6hJAt7FB65tE9Hg==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- kY6scZxpyRXQbaDZp+LbuvSFYgmI3pQrfsrCVt3/9sZzpeUTPXJEatQ5KPOXYpJC
- Gid01h/T8PIezic0Ooz/jU+r3kYMKesMYiXin4CXTZYcGhd0TjmOd4kg1vlhE8kt
- WLC7JDzFLPAqXbOug3ghmWunFiUETbGJaF5V4AHIoZrYP+RS3DTLgJcATuDeWyOd
- ueqnLefXiCDNqgSTsK4OyNlX0fpUJgKbL+Mhf5vsqxyIqDsS/p6cRA==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
+ </EncryptionMethod>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
+ MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
+ BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
+ AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
+ Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7GLXj45iqd03XjsFNTdjy4OIOgf7J
+ xMG7z+hEB1LT2swTs10GILFWPByRl3/BEsnekLZdoqNoJrvnttVkxgu3x80Ji3/A
+ ZD8Ub/kBGOSPyu6pn3OdnMTc5q4r1qUe985lQzCZvCMw6AoGeCyJodNu2MbveNeH
+ +YPjRgLCQfzvOFRq+9qMtE8XfUJZdNhPZhgdsOGf8uJauTcIHbAyw7BhxPy6RikW
+ W5yiWUmBya+7t4y1TQJzham/0y0zU3TAA7b/rDrU7xmNPwIDAQABoyQwIjAPBgNV
+ HRMBAf8EBTADAQH/MA8GA1UdDwEB/wQFAwMHBgAwDQYJKoZIhvcNAQEEBQADggEB
+ ADELWZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
+ OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
+ WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
+ p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
+ O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
+ kKO/vB9Ay64Rt88XbLnnGns=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ ZF0JPSfv75/8M+O2O/xi+8N1b9KT94a4l1D1Q65hnX6F00t+wAWZSkcDUoD/y2/E
+ RKGUyuQwsG6l58e4MwYpmDI4RhHrUYLCQBacAehqVZhwNxv99L7ANsqrZJoT7N0k
+ ER9MbmuIZGb4qisLDfZtzIGKKUUiA3ARfQny4MUxFovSmVUF2OjqSBXUVV/PjMLi
+ fVTVyqCMv08YwmM4abj33tKOEMtiZqAa09lUIpnCUzq2IAShSRNBzWIHe+ndoB6G
+ 2p6ufk0TuRidwdQZkZwTW/2PjK1x7KejaqADWaOIImKhSBMpGzkVfDuv8aAFXOtf
+ +LV67Ov6hJAt7FB65tE9Hg==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ kY6scZxpyRXQbaDZp+LbuvSFYgmI3pQrfsrCVt3/9sZzpeUTPXJEatQ5KPOXYpJC
+ Gid01h/T8PIezic0Ooz/jU+r3kYMKesMYiXin4CXTZYcGhd0TjmOd4kg1vlhE8kt
+ WLC7JDzFLPAqXbOug3ghmWunFiUETbGJaF5V4AHIoZrYP+RS3DTLgJcATuDeWyOd
+ ueqnLefXiCDNqgSTsK4OyNlX0fpUJgKbL+Mhf5vsqxyIqDsS/p6cRA==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml
index dd628364..29c97303 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
- <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
- </EncryptionMethod>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgN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LUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- Y97gGuJRx1Vt31KHkKJfJCh/7XSSQxMH8rF+GAlnEMd4fq8+sL92XBMtLiLiNeWC
- VNaiBorxZrqIW9xPAcOdvN1v1QIxlhf8LtiFyBMWKQm9i61t64cJC2ZRCdT8nPxy
- Qt+fvUXGpLn0LA4cHyMukeLPO4EUQY8whunVXkuSgTKjJICxYKF8HNYsHUr1/fyy
- QL2PW1/UfyEpSBJAZMg+TQFuBSCbAuWbFK2AgSupV5NIppBNU/eRhArReeuAgzSu
- nY9dX1ofdZs8GzvuV8tfcBHzT/h59MPYMxl4sZrl/0NeMQ0ewZhX3yygebgyzZNP
- 4TB4QzQZHRoXNIPUs0vkfA==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- 3Bg5VZK+B/FETt4rT4baIJ4jFKBraqxPnltaSNC672NTcMxBlWG5omCGsbL31gAe
- BDNelmi+3OmqhPLYYsbNOSl6O7YKoP6JvbXVcUcwWwsjEt9Fm6PTrTMy+vp+bgFM
- J8L0WCwyPXnCl/DJS99eaGSG518ynfM/cEmDUINFatT8PX55B4Pd+o1BWkmVxg+E
- jOgiai7L35HCOTpiBwLUUErvvulujk9iFW5ZvqkgIDLOlDLfx4/V9A==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
+ <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
+ </EncryptionMethod>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
+ MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
+ BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
+ AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHx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NIppBNU/eRhArReeuAgzSu
+ nY9dX1ofdZs8GzvuV8tfcBHzT/h59MPYMxl4sZrl/0NeMQ0ewZhX3yygebgyzZNP
+ 4TB4QzQZHRoXNIPUs0vkfA==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ 3Bg5VZK+B/FETt4rT4baIJ4jFKBraqxPnltaSNC672NTcMxBlWG5omCGsbL31gAe
+ BDNelmi+3OmqhPLYYsbNOSl6O7YKoP6JvbXVcUcwWwsjEt9Fm6PTrTMy+vp+bgFM
+ J8L0WCwyPXnCl/DJS99eaGSG518ynfM/cEmDUINFatT8PX55B4Pd+o1BWkmVxg+E
+ jOgiai7L35HCOTpiBwLUUErvvulujk9iFW5ZvqkgIDLOlDLfx4/V9A==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml
index b41ba48f..3cdc2a1b 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
- <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
- </EncryptionMethod>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
- MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
- BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
- AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
- Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7GLXj45iqd03XjsFNTdjy4OIOgf7J
- xMG7z+hEB1LT2swTs10GILFWPByRl3/BEsnekLZdoqNoJrvnttVkxgu3x80Ji3/A
- ZD8Ub/kBGOSPyu6pn3OdnMTc5q4r1qUe985lQzCZvCMw6AoGeCyJodNu2MbveNeH
- +YPjRgLCQfzvOFRq+9qMtE8XfUJZdNhPZhgdsOGf8uJauTcIHbAyw7BhxPy6RikW
- W5yiWUmBya+7t4y1TQJzham/0y0zU3TAA7b/rDrU7xmNPwIDAQABoyQwIjAPBgNV
- HRMBAf8EBTADAQH/MA8GA1UdDwEB/wQFAwMHBgAwDQYJKoZIhvcNAQEEBQADggEB
- ADELWZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
- OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
- WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- bJVDvrtv578zcv3L/pK2YCCJtvMTDupUJB5+ZNlr6QjWolttow3QRrYHXj/W00SX
- lGMdqRuJOkn575Xq3PHO1smO5cxWl5j7sTzVSAkzx/Z5xqiMhrFV+lBWOA/vp437
- mEyGUxDrlE3E2NwvKCn8ovP3OrLIz3TVzy3U16hm0yriWcIZAQEpCQsSLxtPWVXt
- +MMVvn/9y1CLAZh6dHBVHipp/mpf2X2ki4XuHvCRvaAB0fynB3mVbOUAi/NYR65o
- u5BOfeS7HgTkWpo/XTa7e/XpkGsShodOm4ixJ+wKSNsMgNXivYmtghQR79x8H0+J
- lMeTf3dYtV3RUJvi5n1CRA==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- HkxiYRptVjgbv1UjUpyAYp/ty8vBgGgQY/Zr+0tz5Z8W16gp7kvHxAIcyL3E81yO
- 7G54qhvQS4Ie1Et+j9/XEgBL8RdF8TdBnQ5PlPaoW0ckIV/f8gIxxGU0akjciUSG
- iXHKL059fdr46aDFLYtwniNiJYG16eG/FFhlDdplWIK+FkaTEMMADEG78Dryle+A
- DTl1V63WGBpS73k21hag/Mwv2xw5HUasmP1RFuLX4JCxcZAwJrPzoA==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
+ <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
+ </EncryptionMethod>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMC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ipherData>
+ <CipherValue>
+ bJVDvrtv578zcv3L/pK2YCCJtvMTDupUJB5+ZNlr6QjWolttow3QRrYHXj/W00SX
+ lGMdqRuJOkn575Xq3PHO1smO5cxWl5j7sTzVSAkzx/Z5xqiMhrFV+lBWOA/vp437
+ mEyGUxDrlE3E2NwvKCn8ovP3OrLIz3TVzy3U16hm0yriWcIZAQEpCQsSLxtPWVXt
+ +MMVvn/9y1CLAZh6dHBVHipp/mpf2X2ki4XuHvCRvaAB0fynB3mVbOUAi/NYR65o
+ u5BOfeS7HgTkWpo/XTa7e/XpkGsShodOm4ixJ+wKSNsMgNXivYmtghQR79x8H0+J
+ lMeTf3dYtV3RUJvi5n1CRA==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ HkxiYRptVjgbv1UjUpyAYp/ty8vBgGgQY/Zr+0tz5Z8W16gp7kvHxAIcyL3E81yO
+ 7G54qhvQS4Ie1Et+j9/XEgBL8RdF8TdBnQ5PlPaoW0ckIV/f8gIxxGU0akjciUSG
+ iXHKL059fdr46aDFLYtwniNiJYG16eG/FFhlDdplWIK+FkaTEMMADEG78Dryle+A
+ DTl1V63WGBpS73k21hag/Mwv2xw5HUasmP1RFuLX4JCxcZAwJrPzoA==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml b/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml
index f545dd1f..dad2cccf 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-tripledes-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>HgVuHoXxBQWD9fvi0gt9TanywZ5lJokM/12fcMG6gRoMjsCPulH+4A==</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- yUMIHkj5EETckjZ59fpda4+m4YLCrkJsnuRz+Q3e5sP+VvHKRH1kdeGkXw3kYURV
- JM3nQjGl2egW80oUxSykQD2F9iDoIjNhLSgIbyuse64oo/5/v9IiaUpSvrAocwLP
- AzFIUmOrxmIagAkRGDOeMR8tdHLD6g84dQj4O/aGfwhL/2wUo/l+7onrbmsd6pVI
- fjNyvXm+eITuyUnkDTHrCR+dfb2sHaQ3g3McgyfP6ZjI/L50SPJZ/w==
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-tripledes-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>HgVuHoXxBQWD9fvi0gt9TanywZ5lJokM/12fcMG6gRoMjsCPulH+4A==</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ yUMIHkj5EETckjZ59fpda4+m4YLCrkJsnuRz+Q3e5sP+VvHKRH1kdeGkXw3kYURV
+ JM3nQjGl2egW80oUxSykQD2F9iDoIjNhLSgIbyuse64oo/5/v9IiaUpSvrAocwLP
+ AzFIUmOrxmIagAkRGDOeMR8tdHLD6g84dQj4O/aGfwhL/2wUo/l+7onrbmsd6pVI
+ fjNyvXm+eITuyUnkDTHrCR+dfb2sHaQ3g3McgyfP6ZjI/L50SPJZ/w==
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml b/tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml
index 2825f112..4672de73 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
- <KA-Nonce>YWJjZGU=</KA-Nonce>
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
- <OriginatorKeyInfo>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIEjDCCA/WgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzAyMjUwNDBaFw0xMDAxMDEwNTAwMDBaMIGMMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEOMAwGA1UEChMFUGhhb3MxFDASBgNV
- BAsTC0hlYWQgT2ZmaWNlMRcwFQYDVQQDEw5ESCBUZXN0IENsaWVudDEdMBsGCSqG
- SIb3DQEJARYOdGVjaEBwaGFvcy5vcmcwggJDMIIBuAYHKoZIzj4CATCCAasCgYEA
- uavat7i6NOpnRObdx7Gz38h8xkgmv20XUaj1JjfvMAQfQFMHeshGhY2Q0mwvJ1Of
- X/kZ4cMbSYUywh3WAY6zQs8W2uxg8GeduCLebNQGTaHVFVmrJMQawlV1bIMQ+kDi
- IQNR/FPqSNHKD2Q9/uoGD5d2l4KP3qH8dv5HOT8fCwUCgYBxunqmUuKZFTNKJhH9
- G6UINlI/Xr9jPesj5/I8fpWgxZxsgkzksqisDCslZ09uZTATrGFTF3fk6kNhx25s
- UCtYHHK1HzQmsLMu2BWNBQrkLC+Mkd3d39UdNduPW4kCMpcdoHAh+zTqAH2QkKJm
- yxc/x0LevkSUk8rX8DFa3y152QIVAL+Eo4gPL339dk7inq87PnR1PWuHAm0A+C9E
- GPDSphFaPWO5LQTNflJ0l9IGjc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gQUHddBJmfV
- 6MD3FTbVmHcLFN6QFAcwDQYJKoZIhvcNAQEEBQADgYEAKZl9P/ZmIrwHp3BTfBHl
- eFBk9CbhK14FObMGWSkfjqipb5snXBPE3uPBrvP1StisPRsK/y1OZfcjjkA6ht0j
- YWp9lohNDTlc/NOKGOQSCpntqr+wQhc6l16jezqR7sKv2eHBFGs0V7HCrEe2mTP4
- rDa/YKrmL5K6S9GSF27rx40=
- </ds:X509Certificate>
- </ds:X509Data>
- </RecipientKeyInfo>
- </AgreementMethod>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- 2+4oM3TFfOQ5JMIvRbTk3SbeWqbSVAhMb9zT+3BatcUJuhxzzXtLKEzkfPT09iTP
- NmwEoUysB5uETmQ49Fd/0l21QjUmctAaCBIbWSrP4f3K2SUGxjKNZE4Pes+8DwiT
- H1cak+3qT0zbqFa6rXcdLxS/ucxJOPMJV9ZCE4SkvFt2ZME8uRevFEYIqp/HInFZ
- OjY9Lf8+hHOXVOVqrMObx7/CFzm0AS2aL4WmyfGM3zyUN1BF3nS4zzVOHNfIFopX
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
+ <KA-Nonce>YWJjZGU=</KA-Nonce>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ <OriginatorKeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIEjDCCA/WgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBlj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b5snXBPE3uPBrvP1StisPRsK/y1OZfcjjkA6ht0j
+ YWp9lohNDTlc/NOKGOQSCpntqr+wQhc6l16jezqR7sKv2eHBFGs0V7HCrEe2mTP4
+ rDa/YKrmL5K6S9GSF27rx40=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </RecipientKeyInfo>
+ </AgreementMethod>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ 2+4oM3TFfOQ5JMIvRbTk3SbeWqbSVAhMb9zT+3BatcUJuhxzzXtLKEzkfPT09iTP
+ NmwEoUysB5uETmQ49Fd/0l21QjUmctAaCBIbWSrP4f3K2SUGxjKNZE4Pes+8DwiT
+ H1cak+3qT0zbqFa6rXcdLxS/ucxJOPMJV9ZCE4SkvFt2ZME8uRevFEYIqp/HInFZ
+ OjY9Lf8+hHOXVOVqrMObx7/CFzm0AS2aL4WmyfGM3zyUN1BF3nS4zzVOHNfIFopX
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml b/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml
index b869cb1b..ff5816e7 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml
@@ -1,61 +1,61 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-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HBgAwDQYJKoZIhvcNAQEEBQADggEB
- ADELWZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
- OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
- WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- cCxxYh3xGBTqlXbhmKxWzNMlHeE28E7vPrMyM5V4T+t1Iy2csj1BoQ7cqBjEhqEy
- Eot4WNRYsY7P44mWBKurj2mdWQWgoxHvtITP9AR3JTMxUo3TF5ltW76DLDsEvWlE
- uZKam0PYj6lYPKd4npUULeZyR/rDRrth/wFIBD8vbQlUsBHapNT9MbQfSKZemOuT
- UJL9PNgsosySpKrX564oQw398XsxfTFxi4hqbdqzA/CLL418X01hUjIHdyv6XnA2
- 98Bmfv9WMPpX05udR4raDv5X8NWxjH00hAhasM3qumxoyCT6mAGfqvE23I+OXtrN
- lUvE9mMjANw4zweCHsOcfw==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- u2vogkwlvFqeknJ0lYTBZkWS/eX8LR1fDPFMfyK1/UY0EyZfHvbONfDHcC/HLv/f
- aAOOO2Y0GqsknP0LYT1OznkiJrzx134cmJCgbyrYXd3Mp21Pq3rs66JJ34Qt3/+I
- EyJBUSMT8TdT3fBD44BtOqH2op/hy2g3hQPFZul4GiHBEnNJL/4nU1yad3bMvtAB
- mzhx80lJvPGLcruj5V77WMvkvZfoeEqMq4qPWK02ZURsJsq0iZcJDi39NB7OCiON
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
+ MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
+ BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhki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lUsBHapNT9MbQfSKZemOuT
+ UJL9PNgsosySpKrX564oQw398XsxfTFxi4hqbdqzA/CLL418X01hUjIHdyv6XnA2
+ 98Bmfv9WMPpX05udR4raDv5X8NWxjH00hAhasM3qumxoyCT6mAGfqvE23I+OXtrN
+ lUvE9mMjANw4zweCHsOcfw==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ u2vogkwlvFqeknJ0lYTBZkWS/eX8LR1fDPFMfyK1/UY0EyZfHvbONfDHcC/HLv/f
+ aAOOO2Y0GqsknP0LYT1OznkiJrzx134cmJCgbyrYXd3Mp21Pq3rs66JJ34Qt3/+I
+ EyJBUSMT8TdT3fBD44BtOqH2op/hy2g3hQPFZul4GiHBEnNJL/4nU1yad3bMvtAB
+ mzhx80lJvPGLcruj5V77WMvkvZfoeEqMq4qPWK02ZURsJsq0iZcJDi39NB7OCiON
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml b/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml
index a49a2ad7..e8ec21fe 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
- </EncryptionMethod>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
- CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
- U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
- IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
- MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
- CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
- MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
- BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
- AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
- Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7GLXj45iqd03XjsFNTdjy4OIOgf7J
- xMG7z+hEB1LT2swTs10GILFWPByRl3/BEsnekLZdoqNoJrvnttVkxgu3x80Ji3/A
- ZD8Ub/kBGOSPyu6pn3OdnMTc5q4r1qUe985lQzCZvCMw6AoGeCyJodNu2MbveNeH
- +YPjRgLCQfzvOFRq+9qMtE8XfUJZdNhPZhgdsOGf8uJauTcIHbAyw7BhxPy6RikW
- W5yiWUmBya+7t4y1TQJzham/0y0zU3TAA7b/rDrU7xmNPwIDAQABoyQwIjAPBgNV
- HRMBAf8EBTADAQH/MA8GA1UdDwEB/wQFAwMHBgAwDQYJKoZIhvcNAQEEBQADggEB
- ADELWZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
- OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
- WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- W6N0IhRF2AdgfzzkZSp/u1kH5KmH8L4W8k4mdNMboLsYgnBUV3lsRvoFrVTXluMV
- DtXY1ju7aAEUJP9eMRU676kvRR5nSVuAbWCAejgkHMtGShJHU1s/JMzbu3iaxsuy
- PosT7/iafinNIXumvqLM/WQl9KbsmcWoAmJISbK1+WJ2kahrXNav4+7vMJq90BOP
- l8bXIzeKIsps7OGwEvrFaJ5RzVjZXi9SDXXD1vd6tJBcCfcZ347Mat1tZkR3cYrC
- MhDdte3gYGUQLzUlMYucvWz1slzTX3rYea/vhgA+OLOpdZxwM4igx1d8j5jjmo8F
- R1rxwd0G4NHA1bZ6TOy/IA==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- YjIkLPqklVVN1faEsX1t5EXXxdlW3B0rKoZsT5DtaS+pChdcceQV605clJ8YEhOj
- EhM0oCGf855bQVWp7J3TJqUFlxahREEWCfEvsIUzy/wNMHV6Z/mTFkQUWnrO3C3D
- SC6rTglijkPp592Sh1Cb6HTD60Nc/Myn3QLnwlSj+30x3uTUiAVEL+xduAnppCR1
- vhRsB3yw32TjRfZt1b+UURRzCts5oLrVAu9SSrmgJI+vUX9gsRgvwkmsi4AAq38a
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
+ </EncryptionMethod>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+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kKO/vB9Ay64Rt88XbLnnGns=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ W6N0IhRF2AdgfzzkZSp/u1kH5KmH8L4W8k4mdNMboLsYgnBUV3lsRvoFrVTXluMV
+ DtXY1ju7aAEUJP9eMRU676kvRR5nSVuAbWCAejgkHMtGShJHU1s/JMzbu3iaxsuy
+ PosT7/iafinNIXumvqLM/WQl9KbsmcWoAmJISbK1+WJ2kahrXNav4+7vMJq90BOP
+ l8bXIzeKIsps7OGwEvrFaJ5RzVjZXi9SDXXD1vd6tJBcCfcZ347Mat1tZkR3cYrC
+ MhDdte3gYGUQLzUlMYucvWz1slzTX3rYea/vhgA+OLOpdZxwM4igx1d8j5jjmo8F
+ R1rxwd0G4NHA1bZ6TOy/IA==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ YjIkLPqklVVN1faEsX1t5EXXxdlW3B0rKoZsT5DtaS+pChdcceQV605clJ8YEhOj
+ EhM0oCGf855bQVWp7J3TJqUFlxahREEWCfEvsIUzy/wNMHV6Z/mTFkQUWnrO3C3D
+ SC6rTglijkPp592Sh1Cb6HTD60Nc/Myn3QLnwlSj+30x3uTUiAVEL+xduAnppCR1
+ vhRsB3yw32TjRfZt1b+UURRzCts5oLrVAu9SSrmgJI+vUX9gsRgvwkmsi4AAq38a
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml b/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml
index a53cfd93..aa6f0ff4 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes128-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>GPl6bneL1jKl0/lGnf9gejlYHRI6XxFz</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- AbJmB4dsNP5svH3n260KeHFFqRoXaBoDYIqtrhXHE0t1TvJaGtvwjJt2pgM8Yffc
- xKyOLWJljv+FraXUZFnW+VJloMTAXQ8DyeR8ds1sj6X7hT62RFIKm0DvggdBAh9d
- tpeF6fwtOeUUCmidna7im7SLh9a9/CKTBb9RqDzKXQ+Sai6knJPZHtX/yF6ZedgX
- GOUFLX3EdzwVgJ3jnKcB/LZjapsPrRs+6lMdck26aRizWJBHYpY86gWWnu+Ob+/k
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes128-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>GPl6bneL1jKl0/lGnf9gejlYHRI6XxFz</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ AbJmB4dsNP5svH3n260KeHFFqRoXaBoDYIqtrhXHE0t1TvJaGtvwjJt2pgM8Yffc
+ xKyOLWJljv+FraXUZFnW+VJloMTAXQ8DyeR8ds1sj6X7hT62RFIKm0DvggdBAh9d
+ tpeF6fwtOeUUCmidna7im7SLh9a9/CKTBb9RqDzKXQ+Sai6knJPZHtX/yF6ZedgX
+ GOUFLX3EdzwVgJ3jnKcB/LZjapsPrRs+6lMdck26aRizWJBHYpY86gWWnu+Ob+/k
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml b/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml
index 3cb4225f..2b376a1d 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes256-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>ic+Om6/3ZKcThVN3iv9lUEankNkDv3Et</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- T+1ay9FMWTWWnoPYUhVHMA2SNV2w9OirluWOrMSZvRUC8mQHmYfKcuD9WshrgtVd
- dnsiPobRS+Q0DJgfX8CtfjJ3wtQ2DXX9GFgV8662G0hZEjQ4SGgWhxtQEusjVFSl
- Uw4/pxmECD5O6K7N9PwnlYwMm9teksvfWcG5xir+w4k24cc9njLj5Yd0uX2o5Nj1
- sjjNFzbw5cQ4Fx3KSG2HGwnnC/+5/xyoX1eJgdOxdKQvR8uSMmyIcTPGVtRAzH3l
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes256-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>ic+Om6/3ZKcThVN3iv9lUEankNkDv3Et</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ T+1ay9FMWTWWnoPYUhVHMA2SNV2w9OirluWOrMSZvRUC8mQHmYfKcuD9WshrgtVd
+ dnsiPobRS+Q0DJgfX8CtfjJ3wtQ2DXX9GFgV8662G0hZEjQ4SGgWhxtQEusjVFSl
+ Uw4/pxmECD5O6K7N9PwnlYwMm9teksvfWcG5xir+w4k24cc9njLj5Yd0uX2o5Nj1
+ sjjNFzbw5cQ4Fx3KSG2HGwnnC/+5/xyoX1eJgdOxdKQvR8uSMmyIcTPGVtRAzH3l
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml b/tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml
index d4692f53..d722ccdf 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
- <KA-Nonce>YWJjZGU=</KA-Nonce>
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
- <OriginatorKeyInfo>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIEjDCCA/W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y1OZfcjjkA6ht0j
- YWp9lohNDTlc/NOKGOQSCpntqr+wQhc6l16jezqR7sKv2eHBFGs0V7HCrEe2mTP4
- rDa/YKrmL5K6S9GSF27rx40=
- </ds:X509Certificate>
- </ds:X509Data>
- </RecipientKeyInfo>
- </AgreementMethod>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- jg5SecwV6R7dluAMEUsPwWmrTc236XCF8xEVEV7cyEJDfTmdk6BNX4w5BKfFDfOP
- ph4t428f9HI3WIg48BVY8DDaYOReo0a3BKcIoiDjo80V5eZdAQdlWLOecKmD339+
- gqxeBIdJkmQyIpKqDM2NAlqcKM0p+utAn5M8fUosBBO7boJ8i/lnOvDrkqiELHQy
- ZZZKgWsYoIZNKPq1Fd6AUVBAIod3ruMfZYVfXL5G2S1jYa8JNcwp2MU32SIuSIxL
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
+ <KA-Nonce>YWJjZGU=</KA-Nonce>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ <OriginatorKeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIEjDCCA/WgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNV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X509Certificate>
+ </ds:X509Data>
+ </RecipientKeyInfo>
+ </AgreementMethod>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ jg5SecwV6R7dluAMEUsPwWmrTc236XCF8xEVEV7cyEJDfTmdk6BNX4w5BKfFDfOP
+ ph4t428f9HI3WIg48BVY8DDaYOReo0a3BKcIoiDjo80V5eZdAQdlWLOecKmD339+
+ gqxeBIdJkmQyIpKqDM2NAlqcKM0p+utAn5M8fUosBBO7boJ8i/lnOvDrkqiELHQy
+ ZZZKgWsYoIZNKPq1Fd6AUVBAIod3ruMfZYVfXL5G2S1jYa8JNcwp2MU32SIuSIxL
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml b/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml
index 32af43c8..ecad1ebb 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
- </EncryptionMethod>
- <ds:KeyInfo xmlns:ds="http://www.w3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WZjFLPjSjGeOaeUwH/mEOP+l/nTtxe07IWAQL4kvb4wsiUsM1EkPptcBQsym
- OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
- WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- ELSmG8oo52p2ANjbCRJDV0K6M/3W+1b+3A1c07oNWdxeUerdUBarYe5BQingndIv
- y4qfD9hGif8AmY0IXuLWptmZYx8TlHLSYw7TUfLxYMVLzUVtDgrPAqXStNcpJK/l
- 0INMurXU+xnvDXpQEcCthh6C8AWxvXDVKW+8Ud8vLYkGGNVgtEPtdAybx2WptfzJ
- TSYvkRr0VEjDJSg9ZPSJLCeOwQZ9+YvP9F9E556EHK5A476fAgeNL3uefsZ4Yo4Q
- 1UANOvSBtY2ro8xOj6PyBI/5RiW9AVUQd+5UiPq1/jWSoKTFaWib4xr5WhI4dQlc
- nkYU3EYhmST4pokqevZplw==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- WeFDc5EMzI4i77yhGpY2Ae+5VvbPSdnrmXvlRrntz5v6snRmVxtSAXJQgJiouER8
- BNVTiMdB/YcpzOeWLAEfEZG1PswYFsmkYd9QCvGpv1oXisv9Cv8uR9BBmz/ylOmX
- pBCfU38i0fR90JOkGMjwtlkNTwPwOsG5EFRch8jx/wk6qaj6qojJOA21IlFsTKFA
- ugZ3uZeDFPNBJMSVnLudyMFrQYWT14ji/aFETqhQxwlHkgrx1WDN26tBN/9Q6aTZ
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
+ </EncryptionMethod>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
+ MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc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LxYMVLzUVtDgrPAqXStNcpJK/l
+ 0INMurXU+xnvDXpQEcCthh6C8AWxvXDVKW+8Ud8vLYkGGNVgtEPtdAybx2WptfzJ
+ TSYvkRr0VEjDJSg9ZPSJLCeOwQZ9+YvP9F9E556EHK5A476fAgeNL3uefsZ4Yo4Q
+ 1UANOvSBtY2ro8xOj6PyBI/5RiW9AVUQd+5UiPq1/jWSoKTFaWib4xr5WhI4dQlc
+ nkYU3EYhmST4pokqevZplw==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ WeFDc5EMzI4i77yhGpY2Ae+5VvbPSdnrmXvlRrntz5v6snRmVxtSAXJQgJiouER8
+ BNVTiMdB/YcpzOeWLAEfEZG1PswYFsmkYd9QCvGpv1oXisv9Cv8uR9BBmz/ylOmX
+ pBCfU38i0fR90JOkGMjwtlkNTwPwOsG5EFRch8jx/wk6qaj6qojJOA21IlFsTKFA
+ ugZ3uZeDFPNBJMSVnLudyMFrQYWT14ji/aFETqhQxwlHkgrx1WDN26tBN/9Q6aTZ
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml b/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml
index 64534d9f..d3cc6307 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes192-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>iuZvvGBWScikHld9TtNIOz0Sm7Srg5AcxOBMA8qIvQY=</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- /zILD8Eq5vvZK7A+XJaHzoXVqPkk91sOunyhqj+yFA6ZJquaFSUz3A/aQ8AkTrVS
- /rGiNCXDOfmpIab6DRH5deOG0RNxDQvtSiAmM+Beb+Aas5WJ9UNKk1ff8sBdgznl
- 9u8ApmELFPj5u2ucOdCOGS+Re708aSI6SGmqUEJusoXLWJSSD0gE1xW1hmukrTaR
- p8kkchaNNTM+x4gLbq3sSsfncnCo9E/MpeQqQfBPL7r92UwvUMY/DEVz0BbKLomG
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes192-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>iuZvvGBWScikHld9TtNIOz0Sm7Srg5AcxOBMA8qIvQY=</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ /zILD8Eq5vvZK7A+XJaHzoXVqPkk91sOunyhqj+yFA6ZJquaFSUz3A/aQ8AkTrVS
+ /rGiNCXDOfmpIab6DRH5deOG0RNxDQvtSiAmM+Beb+Aas5WJ9UNKk1ff8sBdgznl
+ 9u8ApmELFPj5u2ucOdCOGS+Re708aSI6SGmqUEJusoXLWJSSD0gE1xW1hmukrTaR
+ p8kkchaNNTM+x4gLbq3sSsfncnCo9E/MpeQqQfBPL7r92UwvUMY/DEVz0BbKLomG
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml b/tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml
index 228a620e..221665f3 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
- <KA-Nonce>YWJjZGU=</KA-Nonce>
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
- <OriginatorKeyInfo>
- <ds:X509Data>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fjqipb5snXBPE3uPBrvP1StisPRsK/y1OZfcjjkA6ht0j
- YWp9lohNDTlc/NOKGOQSCpntqr+wQhc6l16jezqR7sKv2eHBFGs0V7HCrEe2mTP4
- rDa/YKrmL5K6S9GSF27rx40=
- </ds:X509Certificate>
- </ds:X509Data>
- </RecipientKeyInfo>
- </AgreementMethod>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- aXXD/Yz+ENFF/uop7z9RwfeVfdFteZwcxMILahK/NKF58LMsUKcr0C9jk5IkMZqJ
- m+bszCs5O61zLI/iJcKFUU2VrokeTuYUP2BZMoxL7q0zqUs7bIwm61IEmU0ghtAT
- 5jSGCbZLPfz3SRe3de023098UbTg+xC/zLslLxBvEtuZh/rNIoNlCA1WwUNV7oRG
- tFoqxzDDh/hyBJzSMAw/S/efNORn4Bbfqu4WjO5bN8wxCi1ATFtAmhSVh3c6t1/U
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <AgreementMethod Algorithm="http://www.w3.org/2001/04/xmlenc#dh">
+ <KA-Nonce>YWJjZGU=</KA-Nonce>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+ <OriginatorKeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIEjDCCA/WgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1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Da/YKrmL5K6S9GSF27rx40=
+ </ds:X509Certificate>
+ </ds:X509Data>
+ </RecipientKeyInfo>
+ </AgreementMethod>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ aXXD/Yz+ENFF/uop7z9RwfeVfdFteZwcxMILahK/NKF58LMsUKcr0C9jk5IkMZqJ
+ m+bszCs5O61zLI/iJcKFUU2VrokeTuYUP2BZMoxL7q0zqUs7bIwm61IEmU0ghtAT
+ 5jSGCbZLPfz3SRe3de023098UbTg+xC/zLslLxBvEtuZh/rNIoNlCA1WwUNV7oRG
+ tFoqxzDDh/hyBJzSMAw/S/efNORn4Bbfqu4WjO5bN8wxCi1ATFtAmhSVh3c6t1/U
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml b/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml
index 53560e86..9730db87 100644
--- a/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml
+++ b/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes256-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>IMwdsyg89IZ4Txf1SYYZNKUOKuYdDoIi/zEKXCjj4j9PM6BdkZligA==</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- sKcjsnw0spmr+iFPf2FWILKQz32+8DvSGm6WTtmMd9syqY/+BIubjH3PS7ROuGY6
- xaotStXfOXm5fE4R3Haqw/04gfV4jJU3vIZZHYj9blDIn602YtqI+xti2zZOhGZ4
- 9gssg7m8ZOJ28yfbQfNw97RdwQiSnIU/Bh87xQJRDK0/M3fOHylMUTH7xMMbQu5m
- rhYj49kNpnVK7XyP7jCek0lT2ei7KYdKaxD/Jm/xWPxaxyS2C8q9bku5HMsEKJOn
- </CipherValue>
- </CipherData>
- </EncryptedData>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes256-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>IMwdsyg89IZ4Txf1SYYZNKUOKuYdDoIi/zEKXCjj4j9PM6BdkZligA==</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ sKcjsnw0spmr+iFPf2FWILKQz32+8DvSGm6WTtmMd9syqY/+BIubjH3PS7ROuGY6
+ xaotStXfOXm5fE4R3Haqw/04gfV4jJU3vIZZHYj9blDIn602YtqI+xti2zZOhGZ4
+ 9gssg7m8ZOJ28yfbQfNw97RdwQiSnIU/Bh87xQJRDK0/M3fOHylMUTH7xMMbQu5m
+ rhYj49kNpnVK7XyP7jCek0lT2ei7KYdKaxD/Jm/xWPxaxyS2C8q9bku5HMsEKJOn
+ </CipherValue>
+ </CipherData>
+ </EncryptedData>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml b/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml
index 44b1b693..b972f1d4 100644
--- a/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml
+++ b/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes256-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- jOvQe4SxDqEMvAHcmb3Z+/Uedj23pvL6BRQsl2sjJlQ=
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- tY3V4h8kopDTZXb80BoqEWH7/nWryHZhU504S1ZRPLw=
- </CipherValue>
- </CipherData>
- </EncryptedData></Number>
- <Issuer>Bank of the Internet</Issuer>
- <Expiration Time="04/02"/>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes256"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes256-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ jOvQe4SxDqEMvAHcmb3Z+/Uedj23pvL6BRQsl2sjJlQ=
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ tY3V4h8kopDTZXb80BoqEWH7/nWryHZhU504S1ZRPLw=
+ </CipherValue>
+ </CipherData>
+ </EncryptedData></Number>
+ <Issuer>Bank of the Internet</Issuer>
+ <Expiration Time="04/02"/>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml b/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml
index aa743cd3..a380abb2 100644
--- a/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml
+++ b/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-aes192-key</ds:KeyName>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>PeDwjnCsg6xWzs3SmzUtc2nyUz28nGu7</CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>6hfMgI39JG5aIId4ZxZkXLGSGVcC7Wu4yOSdkC4H3NJ50pMdcZI2c38YoFHpFZFS</CipherValue>
- </CipherData>
- </EncryptedData></Number>
- <Issuer>Bank of the Internet</Issuer>
- <Expiration Time="04/02"/>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-aes192-key</ds:KeyName>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>PeDwjnCsg6xWzs3SmzUtc2nyUz28nGu7</CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>6hfMgI39JG5aIId4ZxZkXLGSGVcC7Wu4yOSdkC4H3NJ50pMdcZI2c38YoFHpFZFS</CipherValue>
+ </CipherData>
+ </EncryptedData></Number>
+ <Issuer>Bank of the Internet</Issuer>
+ <Expiration Time="04/02"/>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml b/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml
index 462020b0..46f5844a 100644
--- a/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml
+++ b/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml
@@ -1,62 +1,62 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-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xe07IWAQL4kvb4wsiUsM1EkPptcBQsym
- OYgFhf3Elqma84bbOyp85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
- WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- fiDteajx7IJTorLOQoMiXyblOh3zNix23qAy0hcKKP1/7OeLDT1hEnrXkKVvG83h
- No3WF89VPuZGuGeEIJl4xcMklHItcI370NmGjCgKI5GQS/6yxMr4mEbiUL2X8Ycy
- wVa2GUV9qFlkv6C8OnFpCUqBgJOjbUAu9pQ3OWa35Nv8tKqyaphPUaQtPc8ZMehS
- cLHtkYKeByWqz5Djp11rklDp4v1QSeDWEn9zCKkaFiD0DZRtqpnTzwjj1tZsDNp8
- mbps2mAlqnU0L+EsR+8KTRh5vzmxueM+lsLkGH2Rusy2qi/GqmF/NiwyTBdokWoM
- Vd9qzUAODGnwGzf7ymyVKg==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- hg1h2JBeLhLq1QxPKsOQUE/ThbnjAdFCfQYKeqO1ipbi6lTZr5XPP3XsIybze0nX
- </CipherValue>
- </CipherData>
- </EncryptedData></Number>
- <Issuer>Bank of the Internet</Issuer>
- <Expiration Time="04/02"/>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
+ MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
+ BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
+ AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
+ Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7GLXj45iqd03XjsFNTdjy4OIOgf7J
+ xMG7z+hEB1LT2swTs10GILF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wGzf7ymyVKg==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ hg1h2JBeLhLq1QxPKsOQUE/ThbnjAdFCfQYKeqO1ipbi6lTZr5XPP3XsIybze0nX
+ </CipherValue>
+ </CipherData>
+ </EncryptedData></Number>
+ <Issuer>Bank of the Internet</Issuer>
+ <Expiration Time="04/02"/>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml b/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml
index 3fecce71..a44829f7 100644
--- a/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml
+++ b/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml
@@ -1,64 +1,64 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
- <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
- <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
- </EncryptionMethod>
- <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
- <ds:KeyName>my-rsa-key</ds:KeyName>
- <ds:X509Data>
- <ds:X509Certificate>
- MIIDzTC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p85y/iQnjpqWWJ73TFXSWZamSIhYb4Gk+dQuwFI+zD3B2y
- WwqghaAHDzxtzROLUBjo+97Y6ng6V5zjmtdGOFwNXwWhf3Y+MjnErtBIKYao8NJO
- p6di80w82+s6Ot+CLVvVobLhxS/y8yWplATRiQnI5ij/WTLML+tiU5aes0c9abaf
- O7i9j1iTuZsDT3f96ia0RSLsXSGij737QKc3ZM8lSxBWfepWYO+G+IRgr1q9IUDa
- kKO/vB9Ay64Rt88XbLnnGns=
- </ds:X509Certificate>
- </ds:X509Data>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- FCMw2HiQoGdINvvQYoMdRH0fE5oM9i3E9D4IRx9nwvnZLbA/Oi5snoKYEjYQ8ALK
- QxYkGKhHtvwsUpVyxA9wGxbNP19Qt1yJIthG6mHUrGTcN9iYvY85FacG3NQWmdMh
- HjqmylWZAqY4b+qDHczciqzT9i/M3AVct8RrgfVL/MgYyo1WLM0n+svRtc+GFYu6
- QupE5bV1UFb/x3FaQtlzm6fIin+BSThCPKfnanj5Z1rAZsi7Wo9TiK610DKh9zXx
- ONfiLcv9fpoHxpsEzCvAp+RUzLTuqxsLR1rdOveQLy/lTx9eClK8YepzlQIaXiOY
- y0UqwPAQnEjuVzOmT3CsrQ==
- </CipherValue>
- </CipherData>
- <ReferenceList>
- <DataReference URI="#ED"/>
- </ReferenceList>
- </EncryptedKey>
- </ds:KeyInfo>
- <CipherData>
- <CipherValue>
- DpNYC0Np5hHaQAUyHWpM3MQ99wkDFtGRc7TywqxmhI4sJKDXM5SRjVlKf6st5wOz
- </CipherValue>
- </CipherData>
- </EncryptedData></Number>
- <Issuer>Bank of the Internet</Issuer>
- <Expiration Time="04/02"/>
- </CreditCard>
-</PaymentInfo>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <Number><EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
+ </EncryptionMethod>
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:KeyName>my-rsa-key</ds:KeyName>
+ <ds:X509Data>
+ <ds:X509Certificate>
+ MIIDzTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCVVMx
+ CzAJBgNVBAgTAk5ZMRIwEAYDVQQHEwlNYW5oYXR0YW4xFTATBgNVBAoTDExhdmEg
+ U3VwcmVtZTEUMBIGA1UECxMLSGVhZCBPZmZpY2UxFDASBgNVBAMTC1JTQSBUZXN0
+ IENBMSMwIQYJKoZIhvcNAQkBFhR0ZWNoQGxhdmFzdXByZW1lLm9yZzAeFw0wMjAx
+ MzExNjI5NDNaFw00MzAyMjUxNjI5NDNaMIGWMQswCQYDVQQGEwJVUzELMAkGA1UE
+ CBMCTlkxEjAQBgNVBAcTCU1hbmhhdHRhbjEVMBMGA1UEChMMTGF2YSBTdXByZW1l
+ MRQwEgYDVQQLEwtIZWFkIE9mZmljZTEUMBIGA1UEAxMLUlNBIFRlc3QgQ0ExIzAh
+ BgkqhkiG9w0BCQEWFHRlY2hAbGF2YXN1cHJlbWUub3JnMIIBIjANBgkqhkiG9w0B
+ AQEFAAOCAQ8AMIIBCgKCAQEAgj3TOyUtgg99oEfsm8h9JTZBxUkzYkXVUOHxIwnk
+ Fwp4y9ZnrGja/j+kpRyKvYP5CkNdq0e58/r7G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zLTuqxsLR1rdOveQLy/lTx9eClK8YepzlQIaXiOY
+ y0UqwPAQnEjuVzOmT3CsrQ==
+ </CipherValue>
+ </CipherData>
+ <ReferenceList>
+ <DataReference URI="#ED"/>
+ </ReferenceList>
+ </EncryptedKey>
+ </ds:KeyInfo>
+ <CipherData>
+ <CipherValue>
+ DpNYC0Np5hHaQAUyHWpM3MQ99wkDFtGRc7TywqxmhI4sJKDXM5SRjVlKf6st5wOz
+ </CipherValue>
+ </CipherData>
+ </EncryptedData></Number>
+ <Issuer>Bank of the Internet</Issuer>
+ <Expiration Time="04/02"/>
+ </CreditCard>
+</PaymentInfo>
diff --git a/tests/01-phaos-xmlenc-3/key.txt b/tests/01-phaos-xmlenc-3/key.txt
index 4e6ad0c1..d08983a6 100644
--- a/tests/01-phaos-xmlenc-3/key.txt
+++ b/tests/01-phaos-xmlenc-3/key.txt
@@ -1,117 +1,117 @@
-This file contains keys to decrypt the sample xml documents: enc-*-*-*-*.xml.
-
-All the keys are expressed in hex string.
-
-The symmetric keys (Triple DES Key, AES-128 Key, AES-192 Key, AES-256 Key) are
-key wrap keys. They can be used to decrypt the EncryptedKey element in the files: enc-*-*-kw-*.xml.
-
-The RSA Private Key is for decrypting the EncryptedKey element in the files: enc-*-*-kt-*.xml.
-
-The Diffie-Hellman Private Key is the Recipient's private key which can be used to derive
-the data decryption key for the EncryptedData element in the files: enc-*-*-ka-dh.xml.
-
-#Triple DES Key (identified by the key name = my-3des-key):
-#----------------------------------------------------------
-c8 8f 89 d5 fd e9 b9 80 04 46 32 1c 4f ab df 83 a4 62 b6 62 97 f2 70 f4
-
-#AES-128 Key (identified by the key name = my-aes128-key):
-#---------------------------------------------------------
-d3 5f b2 b9 0d a1 b8 f4 b5 f9 0b f4 2c 7f b3 69
-
-#AES-192 Key (identified by the key name = my-aes192-key):
-#---------------------------------------------------------
-22 57 ee 4b 8d 0b bd 2b 55 53 43 23 f1 e3 eb ac 61 d5 84 06 f8 f3 2f be
-
-#AES-256 Key (identified by the key name = my-aes256-key):
-#---------------------------------------------------------
-66 16 78 bf 74 65 c1 39 42 10 ea 48 ac 77 cb 29 5c 89 38 10 ed 10 93 8e 40 36
-ad ff 8c 51 d5 b0
-
-#RSA Private Key:
-#----------------
-
-#Modulus:
-82 3d d3 3b 25 2d 82 0f 7d a0 47 ec 9b c8 7d 25 36 41 c5 49 33 62 45 d5 50 e1
-f1 23 09 e4 17 0a 78 cb d6 67 ac 68 da fe 3f a4 a5 1c 8a bd 83 f9 0a 43 5d ab
-47 b9 f3 fa fb 18 b5 e3 e3 98 aa 77 4d d7 8e c1 4d 4d d8 f2 e0 e2 0e 81 fe c9
-c4 c1 bb cf e8 44 07 52 d3 da cc 13 b3 5d 06 20 b1 56 3c 1c 91 97 7f c1 12 c9
-de 90 b6 5d a2 a3 68 26 bb e7 b6 d5 64 c6 0b b7 c7 cd 09 8b 7f c0 64 3f 14 6f
-f9 01 18 e4 8f ca ee a9 9f 73 9d 9c c4 dc e6 ae 2b d6 a5 1e f7 ce 65 43 30 99
-bc 23 30 e8 0a 06 78 2c 89 a1 d3 6e d8 c6 ef 78 d7 87 f9 83 e3 46 02 c2 41 fc
-ef 38 54 6a fb da 8c b4 4f 17 7d 42 59 74 d8 4f 66 18 1d b0 e1 9f f2 e2 5a b9
-37 08 1d b0 32 c3 b0 61 c4 fc ba 46 29 16 5b 9c a2 59 49 81 c9 af bb b7 8c b5
-4d 02 73 85 a9 bf d3 2d 33 53 74 c0 03 b6 ff ac 3a d4 ef 19 8d 3f
-
-#Public Expotent
-01 00 01
-
-#Exponent
-52 be 3c 88 82 e2 1a 93 04 d8 e3 58 ea cf c0 d1 f7 5a 69 a0 4b c8 cf 5c ea 79 e0
-dc c5 d7 e6 db 7c 4a e3 f8 11 8c bc 34 72 f2 83 03 53 11 7b da a8 2e 8c 3f d8 dd
-c6 a7 59 07 25 e7 96 1c d3 8f e0 20 66 4d 60 73 68 b5 45 31 d8 cd b5 b5 32 0f 72
-e6 6f 45 68 f1 b2 2e 7b 20 b8 ff 0c 79 90 b0 9c 97 f9 d7 2a 0e db 84 ec a5 3b 76
-d9 70 bf 26 7c 92 85 91 a4 e8 3d 61 90 ca 2e 9a 35 9b 61 13 d1 18 f2 34 49 bd 7e
-fb 7a 9b 76 70 49 ac 00 f5 8b b4 c5 25 6f 54 8b a4 34 89 7b 7a 29 90 cc 16 1e 19
-0c 06 c2 13 20 32 8c 9b 41 68 f0 20 ea 67 6e f7 11 7d 3f e2 02 1f 67 fc 0c 97 72
-3b 4e 30 6c 16 86 27 e3 7a 5f 94 d5 73 0c 86 b7 0b de 60 39 c5 bf a0 19 0a 59 ed
-34 e8 4d f9 8e 10 97 95 0a 1f 41 44 aa 60 9e 21 f8 25 50 a5 86 24 ce 78 de 15 4c
-b6 58 83 f0 46 98 64 e3 ac 46 4a 5f 81
-
-#Prime 1
-8a 00 d7 b6 c1 27 b3 df 90 56 c4 0a 62 89 48 fc 61 34 11 d9 1d d4 e9 32 1b 0d 75
-37 76 08 30 d3 73 3a 8b 5c 0c aa 14 d3 f2 6d d6 12 3b 35 a5 91 82 2f 7f 2f 2a 61
-98 43 3f 74 16 8d 9e b3 56 e8 63 c8 11 34 a3 51 0f 45 b8 ad 8b cb 09 0d 52 23 36
-0f e5 05 b0 b9 6a 10 9e 12 e7 4f fb 91 d5 ce 0b 7b 7d ae 6f 6d 88 83 f2 ab 02 4a
-37 14 66 c8 00 0a 7e 24 5b 62 21 2d aa a4 79 cd d1 97 70 11
-
-#Prime 2
-f1 9a 06 c5 37 17 23 ba 6a 9a 45 9c 23 ce ec 88 78 6d 87 58 c5 08 6b f7 10 cc 00
-78 8c b8 b6 4e 07 06 4c 63 66 80 72 fe 15 36 9b 1b e2 60 f8 6e 14 43 e3 25 32 84
-6e 24 11 79 b5 4b c1 a4 c9 c6 ce 78 dd d7 86 43 5b 21 75 51 d3 d7 4d 39 c3 21 b2
-86 e2 15 5d 80 b9 e9 78 6e fb c0 76 cb 7d ba e7 4f d7 c1 14 d2 51 7c 4f fd e4 3e
-41 bd 8c 78 33 d9 d1 78 29 1e 15 3b e1 96 b8 17 cd 76 78 4f
-
-#Prime exponent 1
-01 37 0a af 28 3a 32 42 38 a2 1a ed c0 7a 56 f3 29 e3 ec 78 4d e3 ee fd aa f1 4e
-63 e3 9d 24 d8 e7 bd cf 36 4b 42 40 16 b1 9e b7 f0 c7 26 ac c3 80 32 ec da bc 73
-c9 84 66 0d 9e 99 36 99 7b 9d 66 2b 7f c3 47 e0 d1 d2 9a 52 a4 d5 6f c9 f7 3c 2a
-20 af b2 82 20 cf c7 3f ad 08 ee 52 57 b1 5b 34 0c ad 49 98 df 8d 01 24 64 cf 0b
-5a 3a ca c0 de 07 39 9f 16 52 e1 d9 e6 13 b6 a2 d2 42 94 11
-
-#Prime exponent 2
-47 c0 ff 11 c3 72 d3 e1 a1 97 7f e5 07 9d 85 12 62 f1 e4 a8 b0 9b f7 b4 c1 00 55
-83 78 07 c3 dd 18 a8 fe 36 e7 52 6e d4 97 68 48 58 d7 bb 05 0d 6c 67 5d 26 c7 02
-1d 40 7c 52 82 77 55 d2 78 67 21 f0 08 8e 99 d0 fe 27 5f 77 f5 f0 77 32 bf ec 4c
-c9 e8 37 5f e8 4f 82 33 6c 58 a3 de 72 e5 00 bc de f4 be 81 95 1e 7e 07 ca f6 6c
-ff ca 3e a6 99 24 c3 ac f9 ea 71
-
-#CrtCoffieient:
-75 5e b2 85 d4 5c 52 b4 81 83 a7 bc 43 67 f5 a2 be cb 79 8c e2 eb 15 a3 7f 54 51
-8e a3 ce 81 fe 95 07 fc 62 32 61 7a 46 76 4a b9 15 33 2b d8 9e 46 70 21 b4 31 49
-4d 2d 67 3d b7 d5 2c f4 ac 01 2c f1 01 a1 90 19 d6 77 02 c1 c3 e2 3a 74 de 30 b2
-2a d0 5a 3c a7 43 cd e5 6b ae b2 18 3d cc 99 e0 e0 5e a0 55 94 bf 39 43 12 d1 1c
-a8 97 37 38 dc 29 35 66 a5 ee 78 4a 11 b6 ff 02 3a 85 9a 98
-
-
-#Diffie-Hellman Private Key:
-#---------------------------
-
-#Prime P
-b9 ab da b7 b8 ba 34 ea 67 44 e6 dd c7 b1 b3 df c8 7c c6 48 26 bf 6d 17 51 a8 f5
-26 37 ef 30 04 1f 40 53 07 7a c8 46 85 8d 90 d2 6c 2f 27 53 9f 5f f9 19 e1 c3 1b
-49 85 32 c2 1d d6 01 8e b3 42 cf 16 da ec 60 f0 67 9d b8 22 de 6c d4 06 4d a1 d5
-15 59 ab 24 c4 1a c2 55 75 6c 83 10 fa 40 e2 21 03 51 fc 53 ea 48 d1 ca 0f 64 3d
-fe ea 06 0f 97 76 97 82 8f de a1 fc 76 fe 47 39 3f 1f 0b 05
-
-#Generator G
-71 ba 7a a6 52 e2 99 15 33 4a 26 11 fd 1b a5 08 36 52 3f 5e bf 63 3d eb 23 e7 f2
-3c 7e 95 a0 c5 9c 6c 82 4c e4 b2 a8 ac 0c 2b 25 67 4f 6e 65 30 13 ac 61 53 17 77
-e4 ea 43 61 c7 6e 6c 50 2b 58 1c 72 b5 1f 34 26 b0 b3 2e d8 15 8d 05 0a e4 2c 2f
-8c 91 dd dd df d5 1d 35 db 8f 5b 89 02 32 97 1d a0 70 21 fb 34 ea 00 7d 90 90 a2
-66 cb 17 3f c7 42 de be 44 94 93 ca d7 f0 31 5a df 2d 79 d9
-
-#Prime Q
-bf 84 a3 88 0f 2f 7d fd 76 4e e2 9e af 3b 3e 74 75 3d 6b 87
-
-#Private Key Value
-6d 27 17 0e c9 ff b3 29 8e 12 2c 1f a7 a8 48 64 42 f2 12 b3
+This file contains keys to decrypt the sample xml documents: enc-*-*-*-*.xml.
+
+All the keys are expressed in hex string.
+
+The symmetric keys (Triple DES Key, AES-128 Key, AES-192 Key, AES-256 Key) are
+key wrap keys. They can be used to decrypt the EncryptedKey element in the files: enc-*-*-kw-*.xml.
+
+The RSA Private Key is for decrypting the EncryptedKey element in the files: enc-*-*-kt-*.xml.
+
+The Diffie-Hellman Private Key is the Recipient's private key which can be used to derive
+the data decryption key for the EncryptedData element in the files: enc-*-*-ka-dh.xml.
+
+#Triple DES Key (identified by the key name = my-3des-key):
+#----------------------------------------------------------
+c8 8f 89 d5 fd e9 b9 80 04 46 32 1c 4f ab df 83 a4 62 b6 62 97 f2 70 f4
+
+#AES-128 Key (identified by the key name = my-aes128-key):
+#---------------------------------------------------------
+d3 5f b2 b9 0d a1 b8 f4 b5 f9 0b f4 2c 7f b3 69
+
+#AES-192 Key (identified by the key name = my-aes192-key):
+#---------------------------------------------------------
+22 57 ee 4b 8d 0b bd 2b 55 53 43 23 f1 e3 eb ac 61 d5 84 06 f8 f3 2f be
+
+#AES-256 Key (identified by the key name = my-aes256-key):
+#---------------------------------------------------------
+66 16 78 bf 74 65 c1 39 42 10 ea 48 ac 77 cb 29 5c 89 38 10 ed 10 93 8e 40 36
+ad ff 8c 51 d5 b0
+
+#RSA Private Key:
+#----------------
+
+#Modulus:
+82 3d d3 3b 25 2d 82 0f 7d a0 47 ec 9b c8 7d 25 36 41 c5 49 33 62 45 d5 50 e1
+f1 23 09 e4 17 0a 78 cb d6 67 ac 68 da fe 3f a4 a5 1c 8a bd 83 f9 0a 43 5d ab
+47 b9 f3 fa fb 18 b5 e3 e3 98 aa 77 4d d7 8e c1 4d 4d d8 f2 e0 e2 0e 81 fe c9
+c4 c1 bb cf e8 44 07 52 d3 da cc 13 b3 5d 06 20 b1 56 3c 1c 91 97 7f c1 12 c9
+de 90 b6 5d a2 a3 68 26 bb e7 b6 d5 64 c6 0b b7 c7 cd 09 8b 7f c0 64 3f 14 6f
+f9 01 18 e4 8f ca ee a9 9f 73 9d 9c c4 dc e6 ae 2b d6 a5 1e f7 ce 65 43 30 99
+bc 23 30 e8 0a 06 78 2c 89 a1 d3 6e d8 c6 ef 78 d7 87 f9 83 e3 46 02 c2 41 fc
+ef 38 54 6a fb da 8c b4 4f 17 7d 42 59 74 d8 4f 66 18 1d b0 e1 9f f2 e2 5a b9
+37 08 1d b0 32 c3 b0 61 c4 fc ba 46 29 16 5b 9c a2 59 49 81 c9 af bb b7 8c b5
+4d 02 73 85 a9 bf d3 2d 33 53 74 c0 03 b6 ff ac 3a d4 ef 19 8d 3f
+
+#Public Expotent
+01 00 01
+
+#Exponent
+52 be 3c 88 82 e2 1a 93 04 d8 e3 58 ea cf c0 d1 f7 5a 69 a0 4b c8 cf 5c ea 79 e0
+dc c5 d7 e6 db 7c 4a e3 f8 11 8c bc 34 72 f2 83 03 53 11 7b da a8 2e 8c 3f d8 dd
+c6 a7 59 07 25 e7 96 1c d3 8f e0 20 66 4d 60 73 68 b5 45 31 d8 cd b5 b5 32 0f 72
+e6 6f 45 68 f1 b2 2e 7b 20 b8 ff 0c 79 90 b0 9c 97 f9 d7 2a 0e db 84 ec a5 3b 76
+d9 70 bf 26 7c 92 85 91 a4 e8 3d 61 90 ca 2e 9a 35 9b 61 13 d1 18 f2 34 49 bd 7e
+fb 7a 9b 76 70 49 ac 00 f5 8b b4 c5 25 6f 54 8b a4 34 89 7b 7a 29 90 cc 16 1e 19
+0c 06 c2 13 20 32 8c 9b 41 68 f0 20 ea 67 6e f7 11 7d 3f e2 02 1f 67 fc 0c 97 72
+3b 4e 30 6c 16 86 27 e3 7a 5f 94 d5 73 0c 86 b7 0b de 60 39 c5 bf a0 19 0a 59 ed
+34 e8 4d f9 8e 10 97 95 0a 1f 41 44 aa 60 9e 21 f8 25 50 a5 86 24 ce 78 de 15 4c
+b6 58 83 f0 46 98 64 e3 ac 46 4a 5f 81
+
+#Prime 1
+8a 00 d7 b6 c1 27 b3 df 90 56 c4 0a 62 89 48 fc 61 34 11 d9 1d d4 e9 32 1b 0d 75
+37 76 08 30 d3 73 3a 8b 5c 0c aa 14 d3 f2 6d d6 12 3b 35 a5 91 82 2f 7f 2f 2a 61
+98 43 3f 74 16 8d 9e b3 56 e8 63 c8 11 34 a3 51 0f 45 b8 ad 8b cb 09 0d 52 23 36
+0f e5 05 b0 b9 6a 10 9e 12 e7 4f fb 91 d5 ce 0b 7b 7d ae 6f 6d 88 83 f2 ab 02 4a
+37 14 66 c8 00 0a 7e 24 5b 62 21 2d aa a4 79 cd d1 97 70 11
+
+#Prime 2
+f1 9a 06 c5 37 17 23 ba 6a 9a 45 9c 23 ce ec 88 78 6d 87 58 c5 08 6b f7 10 cc 00
+78 8c b8 b6 4e 07 06 4c 63 66 80 72 fe 15 36 9b 1b e2 60 f8 6e 14 43 e3 25 32 84
+6e 24 11 79 b5 4b c1 a4 c9 c6 ce 78 dd d7 86 43 5b 21 75 51 d3 d7 4d 39 c3 21 b2
+86 e2 15 5d 80 b9 e9 78 6e fb c0 76 cb 7d ba e7 4f d7 c1 14 d2 51 7c 4f fd e4 3e
+41 bd 8c 78 33 d9 d1 78 29 1e 15 3b e1 96 b8 17 cd 76 78 4f
+
+#Prime exponent 1
+01 37 0a af 28 3a 32 42 38 a2 1a ed c0 7a 56 f3 29 e3 ec 78 4d e3 ee fd aa f1 4e
+63 e3 9d 24 d8 e7 bd cf 36 4b 42 40 16 b1 9e b7 f0 c7 26 ac c3 80 32 ec da bc 73
+c9 84 66 0d 9e 99 36 99 7b 9d 66 2b 7f c3 47 e0 d1 d2 9a 52 a4 d5 6f c9 f7 3c 2a
+20 af b2 82 20 cf c7 3f ad 08 ee 52 57 b1 5b 34 0c ad 49 98 df 8d 01 24 64 cf 0b
+5a 3a ca c0 de 07 39 9f 16 52 e1 d9 e6 13 b6 a2 d2 42 94 11
+
+#Prime exponent 2
+47 c0 ff 11 c3 72 d3 e1 a1 97 7f e5 07 9d 85 12 62 f1 e4 a8 b0 9b f7 b4 c1 00 55
+83 78 07 c3 dd 18 a8 fe 36 e7 52 6e d4 97 68 48 58 d7 bb 05 0d 6c 67 5d 26 c7 02
+1d 40 7c 52 82 77 55 d2 78 67 21 f0 08 8e 99 d0 fe 27 5f 77 f5 f0 77 32 bf ec 4c
+c9 e8 37 5f e8 4f 82 33 6c 58 a3 de 72 e5 00 bc de f4 be 81 95 1e 7e 07 ca f6 6c
+ff ca 3e a6 99 24 c3 ac f9 ea 71
+
+#CrtCoffieient:
+75 5e b2 85 d4 5c 52 b4 81 83 a7 bc 43 67 f5 a2 be cb 79 8c e2 eb 15 a3 7f 54 51
+8e a3 ce 81 fe 95 07 fc 62 32 61 7a 46 76 4a b9 15 33 2b d8 9e 46 70 21 b4 31 49
+4d 2d 67 3d b7 d5 2c f4 ac 01 2c f1 01 a1 90 19 d6 77 02 c1 c3 e2 3a 74 de 30 b2
+2a d0 5a 3c a7 43 cd e5 6b ae b2 18 3d cc 99 e0 e0 5e a0 55 94 bf 39 43 12 d1 1c
+a8 97 37 38 dc 29 35 66 a5 ee 78 4a 11 b6 ff 02 3a 85 9a 98
+
+
+#Diffie-Hellman Private Key:
+#---------------------------
+
+#Prime P
+b9 ab da b7 b8 ba 34 ea 67 44 e6 dd c7 b1 b3 df c8 7c c6 48 26 bf 6d 17 51 a8 f5
+26 37 ef 30 04 1f 40 53 07 7a c8 46 85 8d 90 d2 6c 2f 27 53 9f 5f f9 19 e1 c3 1b
+49 85 32 c2 1d d6 01 8e b3 42 cf 16 da ec 60 f0 67 9d b8 22 de 6c d4 06 4d a1 d5
+15 59 ab 24 c4 1a c2 55 75 6c 83 10 fa 40 e2 21 03 51 fc 53 ea 48 d1 ca 0f 64 3d
+fe ea 06 0f 97 76 97 82 8f de a1 fc 76 fe 47 39 3f 1f 0b 05
+
+#Generator G
+71 ba 7a a6 52 e2 99 15 33 4a 26 11 fd 1b a5 08 36 52 3f 5e bf 63 3d eb 23 e7 f2
+3c 7e 95 a0 c5 9c 6c 82 4c e4 b2 a8 ac 0c 2b 25 67 4f 6e 65 30 13 ac 61 53 17 77
+e4 ea 43 61 c7 6e 6c 50 2b 58 1c 72 b5 1f 34 26 b0 b3 2e d8 15 8d 05 0a e4 2c 2f
+8c 91 dd dd df d5 1d 35 db 8f 5b 89 02 32 97 1d a0 70 21 fb 34 ea 00 7d 90 90 a2
+66 cb 17 3f c7 42 de be 44 94 93 ca d7 f0 31 5a df 2d 79 d9
+
+#Prime Q
+bf 84 a3 88 0f 2f 7d fd 76 4e e2 9e af 3b 3e 74 75 3d 6b 87
+
+#Private Key Value
+6d 27 17 0e c9 ff b3 29 8e 12 2c 1f a7 a8 48 64 42 f2 12 b3
diff --git a/tests/01-phaos-xmlenc-3/payment.xml b/tests/01-phaos-xmlenc-3/payment.xml
index 3f8d24d9..e7b50c77 100644
--- a/tests/01-phaos-xmlenc-3/payment.xml
+++ b/tests/01-phaos-xmlenc-3/payment.xml
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PaymentInfo xmlns="http://example.org/paymentv2">
- <Name>John Smith</Name>
- <CreditCard Currency="USD" Limit="5,000">
- <Number>4019 2445 0277 5567</Number>
- <Issuer>Bank of the Internet</Issuer>
- <Expiration Time="04/02"/>
- </CreditCard>
+<?xml version="1.0" encoding="UTF-8"?>
+<PaymentInfo xmlns="http://example.org/paymentv2">
+ <Name>John Smith</Name>
+ <CreditCard Currency="USD" Limit="5,000">
+ <Number>4019 2445 0277 5567</Number>
+ <Issuer>Bank of the Internet</Issuer>
+ <Expiration Time="04/02"/>
+ </CreditCard>
</PaymentInfo> \ No newline at end of file
diff --git a/tests/01-phaos-xmlenc-3/rsa-priv-key.der b/tests/01-phaos-xmlenc-3/rsa-priv-key.der
index 0a1e4b27..7fc5398e 100644
--- a/tests/01-phaos-xmlenc-3/rsa-priv-key.der
+++ b/tests/01-phaos-xmlenc-3/rsa-priv-key.der
Binary files differ
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bb794660..8db1dc0f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,6 +13,7 @@ EXTRA_DIST = \
merlin-exc-c14n-one \
merlin-xmldsig-twenty-three \
merlin-xmlenc-five \
+ 01-geuerp-xfilter2 \
$(NULL)
check: $(DEPS)
diff --git a/tests/keys.xml b/tests/keys.xml
index 4545338d..e67ddd35 100644
--- a/tests/keys.xml
+++ b/tests/keys.xml
@@ -3,7 +3,7 @@
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>test-hmac-sha1</KeyName>
<KeyValue>
-<HMACKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">lCov3z31EVMr6TEDFqCTwk9+Iil+/Azb</HMACKeyValue>
+<HMACKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">VcYlzW7LnrQcZUEsxMFFuja18lL8hnSl</HMACKeyValue>
</KeyValue>
</KeyInfo>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
@@ -11,17 +11,17 @@
<KeyValue>
<RSAKeyValue>
<Modulus>
-z1ZU9zsBX3XvSFLsMRoaT4n4RImSpbOdOHM5zTb5Gf0gqmWWF256+pLEqi8jvZHf
-YbELJT1wy01zzUMMZfjZbWdTDxPINK9td4xt43KUxMJyEwrthdrqtIevZzkjy9i4
-t9InJLJev04bf6Hggq9TWS4IPSu+4QtszybEnyLYHNM=
+sYw63Pr+i53WLBuToN9CCFDsoRwCBWNg8X7DIRWZm/fsKJm5CKZt9jG0ZCjjM5x1
+dQFkzhfA1pGxsQJV6yDMasLfghlfu+UfDP1XBKpPDxEiLR2/gb1otmq0cLlmSgrB
+VGRCjIs6JH071t35pH4CvVBRvI5+OF4T0I4tdfOMS6k=
</Modulus>
<Exponent>
Aw==
</Exponent>
<PrivateExponent xmlns="http://www.aleksey.com/xmlsec/2002">
-ijmN+idWP6P02uHyy2a8NQalgwZhw80Tevd73iSmEVNrHEO5ZPRR/GHYcXTCfmE/
-lnYHbij13N5NM4IIQ/s7nRGm4WcaFgdSA4Y4AQ+QZbCtwAlFXw+r6kU31ucMLvhm
-jJavKAIPPokxjZGSSGewjvZlewXMGeKK/5+VNgWWfvs=
+dl18k1H/B76OyBJiaz+BWuCdwL1WrkJAoP8swLkREqVIGxEmBcRJTsvNmBtCImhO
+TgDt3rqAjwvLy1bj8hXdm2UBpZkH5eTN1yncCcuFvktYsaOlQJVvfYG8fLBiQKPd
+DlDhQgDh5ly6La9S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wEzjL7PXKRH/ZBDhU8ZB8AUCEkkp6/AwlJWehlCz98gNyzXIl4x
-MMEkDSZDysCjIyFgvYa34OplXG3CqrZ5S2pFo2n/xmxRJAG9QtX9bFOkd2+UO5AG
-W0lh8uHR8IKBu1k+5V0lbJRHOBxoVe4ctFYShGWebS8=
+KbkUIXPMMWsssvCBqzxAtG1XvLn9xVCrl8sfvLZsY3+P4QN6rohL6ZHaD2oUfo0x
+m7C2vPpxSGvzZxrSumyWEvmhO8hiO2eIt9fd8dkjnmVB8TXCPECXneJBxzW4+zzT
+6nBcLtX51chRGKNOjSAUj9qlLJCp1o/j8f2cSSMnPYU=
</Y>
</DSAKeyValue>
</KeyValue>
@@ -57,25 +57,25 @@ W0lh8uHR8IKBu1k+5V0lbJRHOBxoVe4ctFYShGWebS8=
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>test-des</KeyName>
<KeyValue>
-<DESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">7KxEcyqTY1jE6QmvnQAyZOsCJ1pijnWb</DESKeyValue>
+<DESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">e0MiuMMH5xo9fBcveTplsYXLmJpZ+8Rh</DESKeyValue>
</KeyValue>
</KeyInfo>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>test-aes128</KeyName>
<KeyValue>
-<AESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">77vEvjTyCCVRztEh9lQ9ZrzoXlC0A8zvUe0kUuhJmAYDaus3WJTuVlFminzijf1NBEzUl0QQ7Q9oaGeUMDZgb+JNpuT3gisvSPxkYgm+vSAAs61njRw+42B68/SS5K2eGwxpuWFoeAnz2qr7NnxMBkrx76S5sMfd2QEfMyo9xPs=</AESKeyValue>
+<AESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">ki/sVkzSrPTG8ezNItIqPA==</AESKeyValue>
</KeyValue>
</KeyInfo>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>test-aes192</KeyName>
<KeyValue>
-<AESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">OO97ZqE/x0rK8TuOJ6zH/72YGZFBMESZK2+AHKsLr3dX8+B1SCJrdtil4DcaG9iEWkm/jLZvnw0LWwLAJYZ37j3ALC/HN23mt/zZpKsdWnB0nTvGZabYpop6r2R5Itff8pShiKe06+XJxtlyrXPkmcBZWHH7ga+HCelhOqkYfICoxxlqD5J2oeVc8lKpJq4sZQp35eQJeBmyN6cwdH4MJo3az4OvAIwMv3VO7AAGeVDom2NzugFYAb824Bn2Qj2/</AESKeyValue>
+<AESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">yuvM6yQdfZFT1ni0zOwrqzuAlUJQlRlH</AESKeyValue>
</KeyValue>
</KeyInfo>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>test-aes256</KeyName>
<KeyValue>
-<AESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">db5YuAZ1B2Nkb2tbbY+F7Wd0VJqKpWSru374teMxEaL0Qr+m6+sfuuHYzsgsMxc/SgTRccarzVs1uQjpP8tLi9czFGlf4j4Rs97MxjsFhYY3l2p9lGcaTdgWKZXhSrm9FJ5b+TFo7pj8b96yVMUTHoA66sWJ/7EWmjlPjvddDYmZlvHlw3/dBlM2gWJ35l1UYQstkSgVAXGwFrBlLfI+5JYj7MDfVmQZ6vEvFNJfUwWwQHTXslX82AYL//nuGAqtJV3PRRvQu04dyZcKoCdtqCBkZF6RpIW65cy8QkgQYbAptVWUCUStxhvuFU2lz3H9sFP+3qqk0ZoARMHgQ2VV9Q==</AESKeyValue>
+<AESKeyValue xmlns="http://www.aleksey.com/xmlsec/2002">dMwT2AK0m/q7XcJy/0XOAVB866HLfCarwmidY/XSZGQ=</AESKeyValue>
</KeyValue>
</KeyInfo>
</Keys>
diff --git a/tests/merlin-xmldsig-twenty-three/certs/badb.crt b/tests/merlin-xmldsig-twenty-three/certs/badb.crt
index 2d0dec68..2061697b 100644
--- a/tests/merlin-xmldsig-twenty-three/certs/badb.crt
+++ b/tests/merlin-xmldsig-twenty-three/certs/badb.crt
Binary files differ
diff --git a/tests/merlin-xmldsig-twenty-three/certs/bres.crt b/tests/merlin-xmldsig-twenty-three/certs/bres.crt
index c0953f4d..7f8a0be0 100644
--- a/tests/merlin-xmldsig-twenty-three/certs/bres.crt
+++ b/tests/merlin-xmldsig-twenty-three/certs/bres.crt
Binary files differ
diff --git a/tests/merlin-xmldsig-twenty-three/certs/ca.crt b/tests/merlin-xmldsig-twenty-three/certs/ca.crt
index 00861d03..88e3afe9 100644
--- a/tests/merlin-xmldsig-twenty-three/certs/ca.crt
+++ b/tests/merlin-xmldsig-twenty-three/certs/ca.crt
Binary files differ
diff --git a/tests/merlin-xmldsig-twenty-three/certs/macha.crt b/tests/merlin-xmldsig-twenty-three/certs/macha.crt
index 484ddc26..f637dc82 100644
--- a/tests/merlin-xmldsig-twenty-three/certs/macha.crt
+++ b/tests/merlin-xmldsig-twenty-three/certs/macha.crt
Binary files differ
diff --git a/tests/merlin-xmldsig-twenty-three/certs/nemain.crt b/tests/merlin-xmldsig-twenty-three/certs/nemain.crt
index f4b62ae6..52b63f03 100644
--- a/tests/merlin-xmldsig-twenty-three/certs/nemain.crt
+++ b/tests/merlin-xmldsig-twenty-three/certs/nemain.crt
Binary files differ
diff --git a/tests/merlin-xmlenc-five/dh0.p8 b/tests/merlin-xmlenc-five/dh0.p8
index bd3683d7..86bf4ce3 100644
--- a/tests/merlin-xmlenc-five/dh0.p8
+++ b/tests/merlin-xmlenc-five/dh0.p8
Binary files differ
diff --git a/tests/merlin-xmlenc-five/dh1.p8 b/tests/merlin-xmlenc-five/dh1.p8
index 56946899..86bf4ce3 100644
--- a/tests/merlin-xmlenc-five/dh1.p8
+++ b/tests/merlin-xmlenc-five/dh1.p8
Binary files differ
diff --git a/tests/merlin-xmlenc-five/dsa.p8 b/tests/merlin-xmlenc-five/dsa.p8
index 8e4a85cd..95b240fc 100644
--- a/tests/merlin-xmlenc-five/dsa.p8
+++ b/tests/merlin-xmlenc-five/dsa.p8
Binary files differ
diff --git a/tests/merlin-xmlenc-five/ids.p12 b/tests/merlin-xmlenc-five/ids.p12
index 503960f8..e659a4b6 100644
--- a/tests/merlin-xmlenc-five/ids.p12
+++ b/tests/merlin-xmlenc-five/ids.p12
Binary files differ
diff --git a/tests/merlin-xmlenc-five/rsa.p8 b/tests/merlin-xmlenc-five/rsa.p8
index 6a7d8282..df70c742 100644
--- a/tests/merlin-xmlenc-five/rsa.p8
+++ b/tests/merlin-xmlenc-five/rsa.p8
Binary files differ
diff --git a/tests/testDSig.sh b/tests/testDSig.sh
index 007306cd..04adbb98 100755
--- a/tests/testDSig.sh
+++ b/tests/testDSig.sh
@@ -10,8 +10,8 @@ keysfile=$topfolder/keys.xml
if [ -n "$DEBUG_MEMORY" ] ; then
export VALGRIND="valgrind --leak-check=yes --show-reachable=yes --num-callers=16"
- export RETRY=10
- export EXTRA_PARAMS="--retry $RETRY"
+ export REPEAT=10
+ export EXTRA_PARAMS="--repeat $REPEAT"
fi
printRes() {
@@ -171,6 +171,16 @@ execDSigTest "aleksey-xmldsig-01/enveloping-hmac-md5-64" \
"--hmackey keys/hmackey.bin" \
"--hmackey keys/hmackey.bin"
+execDSigTest "01-geuerp-xfilter2/xpath2filterOmitComments" \
+ "--hmackey keys/hmackey.bin" \
+ "--hmackey keys/hmackey.bin" \
+ "--hmackey keys/hmackey.bin"
+
+execDSigTest "01-geuerp-xfilter2/xpath2filterWithComments" \
+ "--hmackey keys/hmackey.bin" \
+ "--hmackey keys/hmackey.bin" \
+ "--hmackey keys/hmackey.bin"
+
echo "--------- Negative Testing: next test MUST FAIL ----------"
execDSigTest "merlin-xmldsig-twenty-three/signature-x509-crt-crl" \
diff --git a/tests/testEnc.sh b/tests/testEnc.sh
index b3107882..09d1f377 100755
--- a/tests/testEnc.sh
+++ b/tests/testEnc.sh
@@ -10,8 +10,8 @@ keysfile=$topfolder/keys.xml
if [ -n "$DEBUG_MEMORY" ] ; then
export VALGRIND="valgrind --leak-check=yes --show-reachable=yes --num-callers=16"
- export RETRY=1
- export EXTRA_PARAMS="--retry $RETRY"
+ export REPEAT=1
+ export EXTRA_PARAMS="--repeat $REPEAT"
fi
printRes() {
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
new file mode 100644
index 00000000..15cb2f61
--- /dev/null
+++ b/win32/Makefile.msvc
@@ -0,0 +1,241 @@
+# Makefile for xmlsec, specific for Windows, MSVC and NMAKE.
+#
+# Take a look at the beginning and modify the variables to suit your
+# environment. Having done that, you can do a
+#
+# nmake [all] to build the xmlsec and the accompanying utilities.
+# nmake clean to remove all compiler output files and return to a
+# clean state.
+# nmake rebuild to rebuild everything from scratch. This basically does
+# a 'nmake clean' and then a 'nmake all'.
+# nmake install to install the library and its header files.
+#
+# March 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de>
+# Created for LibXML and LibXSLT
+# April 2002, Aleksey Sanin <aleksey@aleksey.com>
+# Modified for XMLSec Libary
+#
+
+AUTOCONF = .\configure.txt
+
+# If you cannot run the configuration script, which would take the burden of
+# editing this file from your back, then remove the following line...
+!include $(AUTOCONF)
+# ...and enable the following lines and adapt them to your environment.
+#BASEDIR = ..
+#XMLSEC_SRCDIR = $(BASEDIR)\src
+#APPS_SRCDIR = $(BASEDIR)\apps
+#BINDIR = binaries
+#XMLSEC_MAJOR_VERSION = 0 # set this to the right value.
+#XMLSEC_MINOR_VERSION = 0 # set this to the right value.
+#XMLSEC_MICRO_VERSION = 0 # set this to the right value.
+#WITH_XMLSEC_DEBUG = 1
+#DEBUG = 0
+#WITH_OPENSSL096=0
+#WITH_LIBXSLT=1
+#STATIC = 0
+#PREFIX = . # set this to the right value.
+#BINPREFIX = $(PREFIX)\bin
+#INCPREFIX = $(PREFIX)\include
+#LIBPREFIX = $(PREFIX)\lib
+#SOPREFIX = $(PREFIX)\lib
+#INCLUDE = $(INCLUDE);$(INCPREFIX)
+#LIB = $(LIB);$(LIBPREFIX)
+
+
+# There should never be a need to modify anything below this line.
+# ----------------------------------------------------------------
+
+
+# Names of various input and output components.
+XMLSEC_NAME = xmlsec
+XMLSEC_BASENAME = lib$(XMLSEC_NAME)
+XMLSEC_SO = $(XMLSEC_BASENAME).dll
+XMLSEC_IMP = $(XMLSEC_BASENAME).lib
+XMLSEC_DEF = $(XMLSEC_BASENAME).def
+XMLSEC_A = $(XMLSEC_BASENAME)_a.lib
+
+# Places where intermediate files produced by the compiler go
+XMLSEC_INTDIR = $(XMLSEC_BASENAME).int
+APPS_INTDIR = apps.int
+
+# The preprocessor and its options.
+CPP = cl.exe /EP
+CPPFLAGS = /nologo
+
+# The compiler and its options.
+CC = cl.exe
+CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W1 /MD
+CFLAGS = $(CFLAGS) /I$(BASEDIR) /I$(BASEDIR)\include /I$(XMLSEC_SRCDIR)
+CFLGAS = $(CFLAGS) /DXMLSEC_NO_XPATHAL=1
+
+
+# The linker and its options.
+LD = link.exe
+LDFLAGS = /nologo
+LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR)
+LIBS =
+!if "$(STATIC)" == "1"
+LIBS = libeay32.lib libxml2_a.lib wsock32.lib user32.lib gdi32.lib
+!else
+LIBS = libeay32.lib libxml2.lib user32.lib gdi32.lib
+!endif
+
+
+# The archiver and its options.
+AR = lib.exe
+ARFLAGS = /nologo
+
+# Optimisation and debug symbols.
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
+LDFLAGS = $(LDFLAGS) /DEBUG
+!else
+CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
+LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
+!endif
+
+# configurable options
+!if "$(WITH_OPENSSL096)" == "1"
+CFLGAS = $(CFLAGS) /DXMLSEC_NO_AES=1
+!else
+CFLAGS = $(CFLAGS) /DXMLSEC_OPENSSL097=1
+!endif
+
+!if "$(WITH_LIBSXSLT)" == "1"
+!if "$(STATIC)" == "1"
+LIBS = libxslt_a.lib $(LIBS)
+!else
+LIBS = libxslt.lib $(LIBS)
+!endif
+!else
+CFLAGS = $(CFLAGS) /DXMLSEC_NO_XSLT=1
+!endif
+
+
+# xmlsec object files.
+XMLSEC_OBJS = $(XMLSEC_INTDIR)\aes.obj\
+ $(XMLSEC_INTDIR)\base64.obj\
+ $(XMLSEC_INTDIR)\bn.obj \
+ $(XMLSEC_INTDIR)\buffered.obj \
+ $(XMLSEC_INTDIR)\c14n.obj \
+ $(XMLSEC_INTDIR)\ciphers.obj \
+ $(XMLSEC_INTDIR)\debug.obj \
+ $(XMLSEC_INTDIR)\des.obj \
+ $(XMLSEC_INTDIR)\digests.obj \
+ $(XMLSEC_INTDIR)\dsa.obj \
+ $(XMLSEC_INTDIR)\enveloped.obj \
+ $(XMLSEC_INTDIR)\hmac.obj \
+ $(XMLSEC_INTDIR)\io.obj \
+ $(XMLSEC_INTDIR)\keyinfo.obj \
+ $(XMLSEC_INTDIR)\keys.obj \
+ $(XMLSEC_INTDIR)\keysmngr.obj \
+ $(XMLSEC_INTDIR)\membuf.obj \
+ $(XMLSEC_INTDIR)\ripemd160.obj \
+ $(XMLSEC_INTDIR)\rsa.obj \
+ $(XMLSEC_INTDIR)\sha1.obj \
+ $(XMLSEC_INTDIR)\transforms.obj \
+ $(XMLSEC_INTDIR)\x509.obj \
+ $(XMLSEC_INTDIR)\xmldsig.obj \
+ $(XMLSEC_INTDIR)\xmlenc.obj \
+ $(XMLSEC_INTDIR)\xmlsec.obj \
+ $(XMLSEC_INTDIR)\xmltree.obj \
+ $(XMLSEC_INTDIR)\xpath.obj \
+ $(XMLSEC_INTDIR)\xpathalt.obj \
+ $(XMLSEC_INTDIR)\xslt.obj
+
+
+
+# XmlSec and friends executables.
+APPS = $(BINDIR)\xmlsec.exe
+
+all : xmlsec apps
+
+xmlsec : $(BINDIR)\$(XMLSEC_SO) $(BINDIR)\$(XMLSEC_A)
+
+
+apps : $(APPS)
+
+clean :
+ if exist $(XMLSEC_INTDIR) rmdir /S /Q $(XMLSEC_INTDIR)
+ if exist $(APPS_INTDIR) rmdir /S /Q $(APPS_INTDIR)
+ if exist $(BINDIR) rmdir /S /Q $(BINDIR)
+
+rebuild : clean all
+
+install : all
+ if not exist $(INCPREFIX)\$(XMLSEC_NAME) mkdir $(INCPREFIX)\$(XMLSEC_NAME)
+ if not exist $(BINPREFIX) mkdir $(BINPREFIX)
+ if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
+ copy $(BASEDIR)\include\$(XMLSEC_NAME)\*.h $(INCPREFIX)\$(XMLSEC_NAME)
+ copy $(BINDIR)\$(XMLSEC_SO) $(SOPREFIX)
+ copy $(BINDIR)\$(XMLSEC_A) $(LIBPREFIX)
+ copy $(BINDIR)\$(XMLSEC_IMP) $(LIBPREFIX)
+ copy $(BINDIR)\*.exe $(BINPREFIX)
+
+# This is a target for me, to make a binary distribution. Not for the public use,
+# keep your hands off :-)
+BDVERSION = $(xmlsec_MAJOR_VERSION).$(xmlsec_MINOR_VERSION).$(xmlsec_MICRO_VERSION)
+BDPREFIX = $(XMLSEC_BASENAME)-$(BDVERSION).win32
+bindist : all
+ $(MAKE) /nologo PREFIX=$(BDPREFIX) BINPREFIX=$(BDPREFIX)\util install
+ cscript //NoLogo configure.js genreadme $(XMLSEC_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
+
+# Makes the compiler output directory.
+$(BINDIR) :
+ if not exist $(BINDIR) mkdir $(BINDIR)
+
+
+# Makes the xmlsec intermediate directory.
+$(XMLSEC_INTDIR) :
+ if not exist $(XMLSEC_INTDIR) mkdir $(XMLSEC_INTDIR)
+
+# An implicit rule for xmlsec compilation.
+{$(XMLSEC_SRCDIR)}.c{$(XMLSEC_INTDIR)}.obj::
+ $(CC) $(CFLAGS) /Fo$(XMLSEC_INTDIR)\ /c $<
+
+# Compiles xmlsec source. Uses the implicit rule for commands.
+$(XMLSEC_OBJS) : $(XMLSEC_INTDIR)
+
+# Creates the export definition file (DEF) for xmlsec.
+$(XMLSEC_INTDIR)\$(XMLSEC_DEF) : $(XMLSEC_INTDIR) $(XMLSEC_DEF).src
+ $(CPP) $(CPPFLAGS) $(XMLSEC_DEF).src > $(XMLSEC_INTDIR)\$(XMLSEC_DEF)
+
+# Creates the xmlsec shared object.
+$(BINDIR)\$(XMLSEC_SO) : $(BINDIR) $(XMLSEC_OBJS) $(XMLSEC_INTDIR)\$(XMLSEC_DEF)
+ $(LD) $(LDFLAGS) /DLL /DEF:$(XMLSEC_INTDIR)\$(XMLSEC_DEF) \
+ /VERSION:$(XMLSEC_VERSION_MAJOR).$(XMLSEC_VERSION_MINOR) \
+ /IMPLIB:$(BINDIR)\$(XMLSEC_IMP) /OUT:$(BINDIR)\$(XMLSEC_SO) \
+ $(XMLSEC_OBJS) $(LIBS)
+
+# Creates the xmlsec archive.
+$(BINDIR)\$(XMLSEC_A) : $(BINDIR) $(XMLSEC_OBJS)
+ $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XMLSEC_A) $(XMLSEC_OBJS)
+
+
+# Creates the xmlsec intermediate directory.
+
+# Creates the export definition file (DEF) for xmlsec.
+
+
+# Creates the apps intermediate directory.
+$(APPS_INTDIR) :
+ if not exist $(APPS_INTDIR) mkdir $(APPS_INTDIR)
+
+# An implicit rule for xmlsec and friends.
+!if "$(STATIC)" == "1"
+{$(APPS_SRCDIR)}.c{$(BINDIR)}.exe:
+ $(CC) /D "xmlsec_STATIC" $(CFLAGS) /Fo$(APPS_INTDIR)\ /c $<
+ $(LD) $(LDFLAGS) /OUT:$@ $(XMLSEC_A) $(LIBS) $(APPS_INTDIR)\$(<B).obj
+!else
+{$(APPS_SRCDIR)}.c{$(BINDIR)}.exe:
+ $(CC) $(CFLAGS) /Fo$(APPS_INTDIR)\ /c $<
+ $(LD) $(LDFLAGS) /OUT:$@ $(XMLSEC_IMP) $(LIBS) $(APPS_INTDIR)\$(<B).obj
+!endif
+
+# Builds xmlsec and friends. Uses the implicit rule for commands.
+$(APPS) : $(APPS_INTDIR) $(BINDIR) xmlsec
+
+# Source dependences should be autogenerated somehow here, but how to
+# do it? I have no clue.
+
diff --git a/win32/Readme.txt b/win32/Readme.txt
new file mode 100644
index 00000000..4b399c89
--- /dev/null
+++ b/win32/Readme.txt
@@ -0,0 +1,129 @@
+
+ Windows port
+ ------------
+
+This directory contains the files required to build this software on the
+native Windows platform.
+
+As a rule of thumb, the root of this directory contains files needed
+to build the library using the command-line tools, while various
+subdirectories contain project files for various IDEs.
+
+
+ 1. Building from the command-line
+ =================================
+
+This is the easiest, preferred and currently supported method.
+
+In order to build from the command-line you need to make sure that
+your compiler works from the command line. This is not always the
+case, often the required environment variables are missing. If you are
+not sure, test if this works first. If it doesn't, you will first have
+to configure your compiler suite to run from the command-line - please
+refer to your compiler's documentation regarding that.
+
+The first thing you want to do is configure the source. You can have
+the configuration script do this automatically for you. The
+configuration script is written in JScript, a Microsoft's
+implementation of the ECMA scripting language. Almost every Windows
+machine can execute this through the Windows Scripting Host. If your
+system lacks the ability to execute JScript for some reason, you must
+perform the configuration manually.
+
+The second step is compiling the source and, optionally, installing it
+to the location of your choosing.
+
+
+ 1.1 Configuring the source automatically
+ ----------------------------------------
+
+The configuration script accepts numerous options. Some of these
+affect features which will be available in the compiled software,
+others affect the way the software is built and installed. To see a
+full list of options supported by the configuration script, run
+
+ cscript configure.js help
+
+from the win32 subdirectory. The configuration script will present you
+the options it accepts and give a biref explanation of these. In every
+case you will have two sets of options. The first set is specific to
+the software you are building and the second one is specific to the
+Windows port.
+
+Once you have decided which options suit you, run the script with that
+options. Here is an example:
+
+ cscript configure.js prefix=c:\opt include=c:\opt\include
+ lib=c:\opt\lib debug=yes
+
+The previous example will configure the process to install the library
+in c:\opt, use c:\opt\include and c:\opt\lib as additional search
+paths for the compiler and the linker and build executables with debug
+symbols.
+
+Note: Please do not use path names which contain spaces. This will
+fail. Allowing this would require me to put almost everything in the
+Makefile in quotas and that looks quite ugly with my
+syntax-highlighting engine. If you absolutely must use spaces in paths
+send me an email and tell me why. If there are enough of you out there
+who need this, or if a single one has a very good reason, I will
+modify the Makefile to allow spaces in paths.
+
+
+ 1.2 (Not) Configuring the source manually
+ -----------------------------------------
+
+The manual configuration is pretty straightforward, but I would
+suggest rather to get a JScript engine and let the configure script do
+it for you. This process involves editing the apropriate Makefile to
+suit your needs, as well as manually generating certain *.h files from
+their *.h.in sources.
+
+If you really have no idea what I am talking about and ask yourself
+what in Gods name do I mean with '*.h files and their *.h.in sources',
+then you really should do an automatic configuration. Which files must
+be generated and what needs to be done with their sources in order to
+generate them is something people who have built this software before
+allready know. You will not find any explanations for that
+here. Please configure the source manually only if you allready know
+what you must do. Otherwise, you have the choice of either getting a
+precompiled binary distribution, or performing the automatic
+configuration.
+
+
+ 1.3 Compiling
+ -------------
+
+After the configuration stage has been completed, you want to build
+the software. To do that, type
+
+ nmake
+
+in the win32 subdirectory.When the building completes, you will find
+the executable files in win32\binaries directory.
+
+You can install the software into the directory you specified to the
+configure script during the configure stage by typing
+
+ nmake install
+
+That would be it, enjoy.
+
+
+ 2. Building with the IDE
+ ========================
+
+Each supported IDE has its project files placed in a subdirectory of
+win32. If you use a particular IDE, you should be able to
+instinctively recognise its project files. When you have found your
+favourites, load them into the IDE and do whatever you would do with
+any other project files. If you are a novice and puzzled about how to
+use particular project files with a particular IDE, check for a readme
+file in that IDEs subdirectory. I won't discuss any particular IDE
+here, because I would like to keep this document as general as
+possible, and there is also a chance that support exists for IDEs
+which I have never seen.
+
+
+March 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de>
+
diff --git a/win32/configure.js b/win32/configure.js
new file mode 100644
index 00000000..4fa45389
--- /dev/null
+++ b/win32/configure.js
@@ -0,0 +1,318 @@
+/* Configure script for xmlsec, specific for Windows with Scripting Host.
+ *
+ * This script will configure the libxmlsec build process and create necessary files.
+ * Run it with an 'help', or an invalid option and it will tell you what options
+ * it accepts.
+ *
+ * March 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de>
+ * Created for LibXML and LibXSLT
+ * April 2002, Aleksey Sanin <aleksey@aleksey.com>
+ * Modified for XMLSec Libary
+ */
+
+/* The source directory, relative to the one where this file resides. */
+var baseDir = "..";
+var srcDir = baseDir + "\\src";
+var srcDirApps = baseDir + "\\apps";
+/* The directory where we put the binaries after compilation. */
+var binDir = "binaries";
+/* Base name of what we are building. */
+var baseName = "libxmlsec";
+
+/* Configure file which contains the version and the output file where
+ we can store our build configuration. */
+var configFile = baseDir + "\\configure.in";
+var versionFile = ".\\configure.txt";
+
+/* Input and output files regarding the lib(e)xml features. The second
+ output file is there for the compatibility reasons, otherwise it
+ is identical to the first. */
+var optsFileIn = baseDir + "\\config.h.in";
+var optsFile = baseDir + "\\config.h";
+
+/* Version strings for the binary distribution. Will be filled later
+ in the code. */
+var verMajorXmlSec;
+var verMinorXmlSec;
+var verMicroXmlSec;
+
+/* Libxmlsec features. */
+var withXmlSecDebug = true;
+var withOpenSSL096 = 0;
+var withLibXSLT = 1;
+
+/* Win32 build options. */
+var buildDebug = 0;
+var buildStatic = 1;
+var buildPrefix = ".";
+var buildBinPrefix = "$(PREFIX)\\bin";
+var buildIncPrefix = "$(PREFIX)\\include";
+var buildLibPrefix = "$(PREFIX)\\lib";
+var buildSoPrefix = "$(PREFIX)\\lib";
+var buildInclude = ".";
+var buildLib = ".";
+/* Local stuff */
+var error = 0;
+
+/* Helper function, transforms the option variable into the 'Enabled'
+ or 'Disabled' string. */
+function boolToStr(opt)
+{
+ if (opt == false)
+ return "Disabled";
+ else if (opt == true)
+ return "Enabled";
+ error = 1;
+ return "Undefined";
+}
+
+/* Helper function, transforms the argument string into the boolean
+ value. */
+function strToBool(opt)
+{
+ if (opt == "0" || opt == "no")
+ return false;
+ else if (opt == "1" || opt == "yes")
+ return true;
+ error = 1;
+ return false;
+}
+
+/* Displays the details about how to use this script. */
+function usage()
+{
+ var txt;
+ txt = "Usage:\n";
+ txt += " cscript " + WScript.ScriptName + " <options>\n";
+ txt += " cscript " + WScript.ScriptName + " help\n\n";
+ txt += "Options can be specified in the form <option>=<value>, where the value is\n";
+ txt += "either 'yes' or 'no'.\n\n";
+ txt += "XmlSec Library options, default value given in parentheses:\n\n";
+ txt += " xmlsec_debug: Enable XMLSec debbugging (" + (withXmlSecDebug? "yes" : "no") + ")\n";
+ txt += " openssl_096: OpenSSL 0.9.6 is used: disable some features (" + (withOpenSSL096? "yes" : "no") + ")\n";
+ txt += " xslt: LibXSLT is not used (" + (withLibXSLT? "yes" : "no") + ")\n";
+ txt += "\nWin32 build options, default value given in parentheses:\n\n";
+ txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
+ txt += " static: Link libxmlsec statically to xmlsec (" + (buildStatic? "yes" : "no") + ")\n";
+ txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n";
+ txt += " bindir: Directory where xmlsec and friends should be installed\n";
+ txt += " (" + buildBinPrefix + ")\n";
+ txt += " incdir: Directory where headers should be installed\n";
+ txt += " (" + buildIncPrefix + ")\n";
+ txt += " libdir: Directory where static and import libraries should be\n";
+ txt += " installed (" + buildLibPrefix + ")\n";
+ txt += " sodir: Directory where shared libraries should be installed\n";
+ txt += " (" + buildSoPrefix + ")\n";
+ txt += " include: Additional search path for the compiler, particularily\n";
+ txt += " where libxml headers can be found (" + buildInclude + ")\n";
+ txt += " lib: Additional search path for the linker, particularily\n";
+ txt += " where libxml library can be found (" + buildLib + ")\n";
+ WScript.Echo(txt);
+}
+
+/* Discovers the version we are working with by reading the apropriate
+ configuration file. Despite its name, this also writes the configuration
+ file included by our makefile. */
+function discoverVersion()
+{
+ var fso, cf, vf, ln, s;
+ fso = new ActiveXObject("Scripting.FileSystemObject");
+ cf = fso.OpenTextFile(configFile, 1);
+ vf = fso.CreateTextFile(versionFile, true);
+ vf.WriteLine("# " + versionFile);
+ vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + ".");
+ vf.WriteBlankLines(1);
+ while (cf.AtEndOfStream != true) {
+ ln = cf.ReadLine();
+ s = new String(ln);
+ if (s.search(/^XMLSEC_VERSION_MAJOR/) != -1) {
+ WScript.Echo(verMajorXmlSec);
+ vf.WriteLine(s);
+ verMajorXmlSec = s.substring(s.indexOf("=") + 1, s.length)
+ } else if(s.search(/^XMLSEC_VERSION_MINOR/) != -1) {
+ vf.WriteLine(s);
+ verMinorXmlSec = s.substring(s.indexOf("=") + 1, s.length)
+ } else if(s.search(/^XMLSEC_VERSION_SUBMINOR/) != -1) {
+ vf.WriteLine(s);
+ verMicroXmlSec = s.substring(s.indexOf("=") + 1, s.length)
+ }
+ }
+ cf.Close();
+ vf.WriteLine("BASEDIR=" + baseDir);
+ vf.WriteLine("XMLSEC_SRCDIR=" + srcDir);
+ vf.WriteLine("APPS_SRCDIR=" + srcDirApps);
+ vf.WriteLine("BINDIR=" + binDir);
+ vf.WriteLine("WITH_DEBUG=" + (withXmlSecDebug? "1" : "0"));
+ vf.WriteLine("WITH_OPENSSL096=" + (withOpenSSL096? "1" : "0"));
+ vf.WriteLine("WITH_LIBXSLT=" + (withLibXSLT ? "1" : "0"));
+ vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
+ vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
+ vf.WriteLine("PREFIX=" + buildPrefix);
+ vf.WriteLine("BINPREFIX=" + buildBinPrefix);
+ vf.WriteLine("INCPREFIX=" + buildIncPrefix);
+ vf.WriteLine("LIBPREFIX=" + buildLibPrefix);
+ vf.WriteLine("SOPREFIX=" + buildSoPrefix);
+ vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
+ vf.WriteLine("LIB=$(LIB);" + buildLib);
+ vf.Close();
+}
+
+/* Configures xmlsec. This one will generate config.h from config.h.in
+ taking what the user passed on the command line into account. */
+function configureXmlSec()
+{
+ var fso, ofi, of, ln, s;
+ fso = new ActiveXObject("Scripting.FileSystemObject");
+ ofi = fso.OpenTextFile(optsFileIn, 1);
+ of = fso.CreateTextFile(optsFile, true);
+ while (ofi.AtEndOfStream != true) {
+ ln = ofi.ReadLine();
+ s = new String(ln);
+ if (s.search(/\@VERSION\@/) != -1) {
+ of.WriteLine(s.replace(/\@VERSION\@/,
+ verMajorXmlSec + "." + verMinorXmlSec + "." + verMicroXmlSec));
+ } else if (s.search(/\@XMLSECVERSION_NUMBER\@/) != -1) {
+ of.WriteLine(s.replace(/\@XMLSECVERSION_NUMBER\@/,
+ verMajorXmlSec*10000 + verMinorXmlSec*100 + verMicroXmlSec*1));
+ } else if (s.search(/\@XMLSEC_DEBUG\@/) != -1) {
+ of.WriteLine(s.replace(/\@XMLSEC_DEBUG\@/, withXmlSecDebug? "1" : "0"));
+ } else
+ of.WriteLine(ln);
+ }
+ ofi.Close();
+ of.Close();
+}
+
+/* Creates the readme file for the binary distribution of 'bname', for the
+ version 'ver' in the file 'file'. This one is called from the Makefile when
+ generating a binary distribution. The parameters are passed by make. */
+function genReadme(bname, ver, file)
+{
+ var fso, f;
+ fso = new ActiveXObject("Scripting.FileSystemObject");
+ f = fso.CreateTextFile(file, true);
+ f.WriteLine(" " + bname + " " + ver);
+ f.WriteLine(" --------------");
+ f.WriteBlankLines(1);
+ f.WriteLine(" This is " + bname + ", version " + ver + ", binary package for the native Win32/IA32");
+ f.WriteLine("platform.");
+ f.WriteBlankLines(1);
+ f.WriteLine(" The directory named 'include' contains the header files. Place its");
+ f.WriteLine("contents somewhere where it can be found by the compiler.");
+ f.WriteLine(" The directory which answers to the name 'lib' contains the static and");
+ f.WriteLine("dynamic libraries. Place them somewhere where they can be found by the");
+ f.WriteLine("linker. The files whose names end with '_a.lib' are aimed for static");
+ f.WriteLine("linking, the other files are lib/dll pairs.");
+ f.WriteLine(" The directory called 'util' contains various programs which count as a");
+ f.WriteLine("part of " + bname + ".");
+ f.WriteBlankLines(1);
+ f.WriteLine(" If there is something you cannot keep for yourself, such as a problem,");
+ f.WriteLine("a cheer of joy, a comment or a suggestion, feel free to contact me using");
+ f.WriteLine("the address below.");
+ f.WriteBlankLines(1);
+ f.WriteLine(" Igor Zlatkovic (igor@stud.fh-frankfurt.de)");
+ f.Close();
+}
+
+/*
+ * main(),
+ * Execution begins here.
+ */
+
+/* Parse the command-line arguments. */
+for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
+ var arg, opt;
+ arg = WScript.Arguments(i);
+ opt = arg.substring(0, arg.indexOf("="));
+ if (opt.length == 0)
+ opt = arg.substring(0, arg.indexOf(":"));
+ if (opt.length > 0) {
+ if (opt == "xmlsec_debug")
+ withXmlSecDebug = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "openssl_096")
+ withOpenSSL096 = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "xslt")
+ withLibXSLT = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "debug")
+ buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "static")
+ buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "prefix")
+ buildPrefix = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "incdir")
+ buildIncPrefix = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "bindir")
+ buildBinPrefix = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "libdir")
+ buildLibPrefix = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "sodir")
+ buildSoPrefix = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "incdir")
+ buildIncPrefix = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "include")
+ buildInclude = arg.substring(opt.length + 1, arg.length);
+ else if (opt == "lib")
+ buildLib = arg.substring(opt.length + 1, arg.length);
+ else
+ error = 1;
+ } else if (i == 0) {
+ if (arg == "genreadme") {
+ // This command comes from the Makefile and will not be checked
+ // for errors, because Makefile will always supply right parameters.
+ genReadme(WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3));
+ WScript.Quit(0);
+ } else if (arg == "help") {
+ usage();
+ WScript.Quit(0);
+ }
+ } else
+ error = 1;
+}
+// If we have an error here, it is because the user supplied bad parameters.
+if (error != 0) {
+ usage();
+ WScript.Quit(error);
+}
+
+// Discover the version.
+discoverVersion();
+if (error != 0) {
+ WScript.Echo("Version discovery failed, aborting.");
+ WScript.Quit(error);
+}
+WScript.Echo(baseName + " version: " + verMajorXmlSec + "." + verMinorXmlSec + "." + verMicroXmlSec);
+
+// Configure libxmlsec.
+configureXmlSec();
+if (error != 0) {
+ WScript.Echo("Configuration failed, aborting.");
+ WScript.Quit(error);
+}
+
+
+// Create the Makefile.
+var fso = new ActiveXObject("Scripting.FileSystemObject");
+fso.CopyFile(".\\Makefile.msvc", ".\\Makefile", true);
+WScript.Echo("Created Makefile.");
+
+// Display the final configuration.
+var txtOut = "\nXMLSEC configuration\n";
+txtOut += "----------------------------\n";
+txtOut += " Debugging module: " + boolToStr(withXmlSecDebug) + "\n";
+txtOut += " Use OpenSSL 096: " + boolToStr(withOpenSSL096) + "\n";
+txtOut += " Use LibXSLT: " + boolToStr(withLibXSLT) + "\n";
+txtOut += "\n";
+txtOut += "Win32 build configuration\n";
+txtOut += "-------------------------\n";
+txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n";
+txtOut += " Static xmlsec: " + boolToStr(buildStatic) + "\n";
+txtOut += " Install prefix: " + buildPrefix + "\n";
+txtOut += " Put tools in: " + buildBinPrefix + "\n";
+txtOut += " Put headers in: " + buildIncPrefix + "\n";
+txtOut += "Put static libs in: " + buildLibPrefix + "\n";
+txtOut += "Put shared libs in: " + buildSoPrefix + "\n";
+txtOut += " Include path: " + buildInclude + "\n";
+txtOut += " Lib path: " + buildLib + "\n";
+WScript.Echo(txtOut);
+
+// Done.
diff --git a/win32/dsp/xmlsec.dsp b/win32/dsp/xmlsec.dsp
new file mode 100644
index 00000000..72e82b81
--- /dev/null
+++ b/win32/dsp/xmlsec.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="xmlsec" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=xmlsec - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "xmlsec.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "xmlsec.mak" CFG="xmlsec - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "xmlsec - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "xmlsec - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "xmlsec - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "../../../../openssl/include" /I "../../../../libxml2/include" /I "../../../../libxslt/include" /I ".." /I "../.." /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 libxmlsec_a.lib libxslt_a.lib libxml2_a.lib libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"./Release" /libpath:"../../../../openssl/lib" /libpath:"../../../../libxml2/lib" /libpath:"../../../../libxslt/lib"
+
+!ELSEIF "$(CFG)" == "xmlsec - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../openssl/include" /I "../../../../libxml2/include" /I "../../../../libxslt/include" /I ".." /I "../.." /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libxmlsec_a.lib libxslt_a.lib libxml2_a.lib libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"./Debug" /libpath:"../../../../openssl/lib" /libpath:"../../../../libxml2/lib" /libpath:"../../../../libxslt/lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "xmlsec - Win32 Release"
+# Name "xmlsec - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\apps\xmlsec.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/win32/dsp/xmlsec.dsw b/win32/dsp/xmlsec.dsw
new file mode 100644
index 00000000..b179d568
--- /dev/null
+++ b/win32/dsp/xmlsec.dsw
@@ -0,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "xmlsec"=.\xmlsec.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name xmlsec_lib
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "xmlsec_lib"=.\xmlsec_lib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/win32/dsp/xmlsec_lib.dsp b/win32/dsp/xmlsec_lib.dsp
new file mode 100644
index 00000000..781b3629
--- /dev/null
+++ b/win32/dsp/xmlsec_lib.dsp
@@ -0,0 +1,296 @@
+# Microsoft Developer Studio Project File - Name="xmlsec_lib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=xmlsec_lib - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "xmlsec_lib.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "xmlsec_lib.mak" CFG="xmlsec_lib - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "xmlsec_lib - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "xmlsec_lib - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "xmlsec_lib - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseLib"
+# PROP BASE Intermediate_Dir "ReleaseLib"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseLib"
+# PROP Intermediate_Dir "ReleaseLib"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "../../../openssl/include" /I "../../../libxml2/include" /I "../../../libxslt/include" /I ".." /I "../.." /I "../../include" /I "../../../../openssl/include" /I "../../../../libxml2/include" /I "../../../../libxslt/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"Release\libxmlsec_a.lib"
+
+!ELSEIF "$(CFG)" == "xmlsec_lib - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugLib"
+# PROP BASE Intermediate_Dir "DebugLib"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugLib"
+# PROP Intermediate_Dir "DebugLib"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../openssl/include" /I "../../../libxml2/include" /I "../../../libxslt/include" /I ".." /I "../.." /I "../../include" /I "../../../../openssl/include" /I "../../../../libxml2/include" /I "../../../../libxslt/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"Debug\libxmlsec_a.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "xmlsec_lib - Win32 Release"
+# Name "xmlsec_lib - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\src\aes.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\base64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\bn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\buffered.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\c14n.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\ciphers.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\debug.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\des.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\digests.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\dsa.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\enveloped.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\hmac.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\io.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\keyinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\keys.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\keysmngr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\membuf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\ripemd160.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\rsa.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\sha1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\transforms.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\x509.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\xmldsig.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\xmlenc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\xmlsec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\xmltree.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\xpath.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\xslt.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\base64.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\bn.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\buffered.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\ciphers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\debug.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\digests.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\globals.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\io.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\keyinfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\keys.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\keysInternal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\keysmngr.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\membuf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\transforms.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\transformsInternal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\version.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\x509.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\xmldsig.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\xmlenc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\xmlsec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\xmltree.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\xmlsec\xpath.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/libxmlsec.def.src b/win32/libxmlsec.def.src
new file mode 100644
index 00000000..e4bb9c6e
--- /dev/null
+++ b/win32/libxmlsec.def.src
@@ -0,0 +1,25 @@
+/* win32/libxmlsec.def.src
+ Pseudo-source used to create a .DEF file for proper dynamic linkage.
+
+ Assuming you use Microsoft's C compiler, you run a
+
+ cl /EP libxmlsec.def.src > libxmlsec.def
+
+ in order to get the right .DEF file. Basically, all you do is
+ preprocess this file using a C/C++ preprocessor and the right
+ .DEF file should come out.
+
+ Should you need a function which does not seem to be exported
+ from the libxmlsec.dll, its name is most certainly missing here.
+ Add the name of the offending function to this file and rebuild.
+
+ 21.03.2002, Igor Zlatkovic (igor@stud.fh-frankfurt.de)
+ Created
+ for LibXML and LibXSLT
+ April 2002, Aleksey Sanin <aleksey@aleksey.com>
+ Modified for XMLSec Libary
+*/
+
+LIBRARY libxmlsec
+EXPORTS
+
diff --git a/win32/mycfg.bat b/win32/mycfg.bat
new file mode 100644
index 00000000..4e7577fb
--- /dev/null
+++ b/win32/mycfg.bat
@@ -0,0 +1,20 @@
+@echo off
+REM
+REM This is my personal configuration file.
+REM I am lazy to type all this crap again and again
+REM You are welcome to customize this file for your
+REM needs but do not check it into the CVS, please.
+REM
+REM Aleksey Sanin <aleksey@aleksey.com>
+REM
+
+SET LIBXML2=c:\sdk\libxml2
+REM SET LIBXSLT=c:\sdk\libxslt
+SET OPENSSL=c:\sdk\openssl
+SET XMLSEC=c:\sdk\xmlsec
+SET XMLSEC_INCLUDE=%LIBXML2%\include;%LIBXSLT%\include;%OPENSSL%\include
+SET XMLSEC_LIB=%LIBXML2%\lib;%LIBXSLT%\lib;%OPENSSL%\lib
+SET XMLSEC_OPTIONS=static=yes debug=yes xmlsec_debug=yes xslt=no
+
+del /F Makefile configure.txt
+cscript configure.js prefix=%XMLSEC% %XMLSEC_OPTIONS% include=%XMLSEC_INCLUDE% lib=%XMLSEC_LIB%
diff --git a/xmlsec.spec.in b/xmlsec.spec.in
index b7d4b82a..a9bdc87f 100644
--- a/xmlsec.spec.in
+++ b/xmlsec.spec.in
@@ -13,9 +13,6 @@ URL: http://www.aleksey.com/xmlsec
Requires: libxml2 >= @LIBXML_MIN_VERSION@
Requires: libxslt >= @LIBXSLT_MIN_VERSION@
Requires: openssl >= @OPENSSL_MIN_VERSION@
-Requires: libxml2-devel >= @LIBXML_MIN_VERSION@
-Requires: libxslt-devel >= @LIBXSLT_MIN_VERSION@
-Requires: openssl-devel >= @OPENSSL_MIN_VERSION@
BuildRequires: libxml2-devel >= @LIBXML_MIN_VERSION@
BuildRequires: libxslt-devel >= @LIBXSLT_MIN_VERSION@
BuildRequires: openssl-devel >= @OPENSSL_MIN_VERSION@
@@ -26,8 +23,19 @@ Docdir: %{_docdir}
XML Security Library is a C library based on LibXML2 and OpenSSL.
The library was created with a goal to support major XML security
standards "XML Digital Signature" and "XML Encryption".
-It is released under the MIT Licence (see the Copyright file in the
-distribution for details).
+
+%package devel
+Summary: Libraries, includes, etc. to develop applications with XML Digital Signatures and XML Encryption support.
+Group: Development/Libraries
+Requires: xmlsec = %{version}
+Requires: libxml2-devel >= @LIBXML_MIN_VERSION@
+Requires: libxslt-devel >= @LIBXSLT_MIN_VERSION@
+Requires: openssl-devel >= @OPENSSL_MIN_VERSION@
+Requires: zlib-devel
+
+%description devel
+Libraries, includes, etc. you can use to develop applications with XML Digital
+Signatures and XML Encryption support.
%prep
%setup -q
@@ -73,12 +81,16 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-, root, root)
%doc AUTHORS ChangeLog NEWS README Copyright
-%doc docs/*
%{prefix}/lib/lib*.so.*
%{prefix}/lib/lib*.so
-%{prefix}/lib/*a
%{prefix}/bin/xmlsec
+
+%files devel
+%defattr(-, root, root)
+
+%{prefix}/lib/*a
%{prefix}/bin/xmlsec-config
%{prefix}/include/*
+%doc docs/*
%changelog