xmlsec-shim 1.2.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/README.md +2 -0
- data/Rakefile +2 -0
- data/ext/xmlsec/extconf.rb +14 -0
- data/lib/xmlsec-shim.rb +27 -0
- data/lib/xmlsec-shim/version.rb +5 -0
- data/vendor/xmlsec1-1.2.18/AUTHORS +8 -0
- data/vendor/xmlsec1-1.2.18/COPYING +105 -0
- data/vendor/xmlsec1-1.2.18/ChangeLog +1810 -0
- data/vendor/xmlsec1-1.2.18/Copyright +105 -0
- data/vendor/xmlsec1-1.2.18/HACKING +199 -0
- data/vendor/xmlsec1-1.2.18/INSTALL +38 -0
- data/vendor/xmlsec1-1.2.18/Makefile.am +186 -0
- data/vendor/xmlsec1-1.2.18/Makefile.in +1155 -0
- data/vendor/xmlsec1-1.2.18/NEWS +1 -0
- data/vendor/xmlsec1-1.2.18/README +15 -0
- data/vendor/xmlsec1-1.2.18/TODO +156 -0
- data/vendor/xmlsec1-1.2.18/aclocal.m4 +1197 -0
- data/vendor/xmlsec1-1.2.18/apps/Makefile.am +84 -0
- data/vendor/xmlsec1-1.2.18/apps/Makefile.in +694 -0
- data/vendor/xmlsec1-1.2.18/apps/cmdline.c +355 -0
- data/vendor/xmlsec1-1.2.18/apps/cmdline.h +89 -0
- data/vendor/xmlsec1-1.2.18/apps/crypto.c +396 -0
- data/vendor/xmlsec1-1.2.18/apps/crypto.h +70 -0
- data/vendor/xmlsec1-1.2.18/apps/xmlsec.c +3058 -0
- data/vendor/xmlsec1-1.2.18/config.guess +1502 -0
- data/vendor/xmlsec1-1.2.18/config.h.in +134 -0
- data/vendor/xmlsec1-1.2.18/config.sub +1714 -0
- data/vendor/xmlsec1-1.2.18/configure +17363 -0
- data/vendor/xmlsec1-1.2.18/configure.in +1633 -0
- data/vendor/xmlsec1-1.2.18/depcomp +630 -0
- data/vendor/xmlsec1-1.2.18/docs/Makefile.am +65 -0
- data/vendor/xmlsec1-1.2.18/docs/Makefile.in +721 -0
- data/vendor/xmlsec1-1.2.18/docs/api/Makefile.am +209 -0
- data/vendor/xmlsec1-1.2.18/docs/api/Makefile.in +664 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/compiling-and-linking.sgml +252 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/creating-templates.sgml +325 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/examples.sgml +102 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/init-and-shutdown.sgml +104 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/new-crypto.sgml +487 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/sign-and-encrypt.sgml +286 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-contexts.sgml +138 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-keys.sgml +26 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-keysmngr.sgml +592 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-transforms.sgml +67 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-x509-certs.sgml +197 -0
- data/vendor/xmlsec1-1.2.18/docs/api/chapters/verify-and-decrypt.sgml +265 -0
- data/vendor/xmlsec1-1.2.18/docs/api/home.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/diagrams.sxd +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/encryption-structure.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/key.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/keysmngr.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/sign-enc-model.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/signature-structure.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/structure.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/transform.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/transforms-chain.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/images/verif-dec-model.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/index.html +307 -0
- data/vendor/xmlsec1-1.2.18/docs/api/index.sgml +43 -0
- data/vendor/xmlsec1-1.2.18/docs/api/left.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/right.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/up.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-app.html +1525 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-base64.html +357 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-bn.html +705 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-buffer.html +603 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-custom-keys-manager.html +475 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-decrypt-with-keys-mngr.html +396 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-decrypt-with-signle-key.html +326 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-dl.html +245 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encrypt-dynamic-template.html +386 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encrypt-template-file.html +364 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encrypt-with-session-key.html +495 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encryption-klasses.html +101 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-errors.html +744 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples-sign-dynamimc-template.html +406 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples-sign-template-file.html +388 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples-sign-x509.html +447 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples.html +119 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt-app.html +578 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt-crypto.html +1128 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt-ref.html +107 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt.sgml +15 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls-app.html +576 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls-crypto.html +1076 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls-ref.html +107 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls.sgml +15 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-index.html +1570 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-index.sgml +1471 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-io.html +226 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keyinfo.html +700 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keys.html +1161 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keysdata.html +2067 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keysmngr.html +743 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-list.html +643 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-membuf.html +143 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-app.html +747 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-certkeys.html +252 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-crypto.html +1153 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-keysstore.html +209 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-ref.html +113 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-x509.html +478 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto.sgml +21 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nodeset.html +542 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling-others.html +102 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling-unix.html +223 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling-windows.html +138 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling.html +117 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-contexts.html +229 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-custom-keys-store.html +250 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-decrypt.html +205 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-dynamic-encryption-templates.html +240 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-dynamic-signature-templates.html +250 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-encrypt.html +223 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-include-files.html +141 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-init-shutdown.html +194 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keys-manager-sign-enc.html +307 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keys-mngr-verify-decrypt.html +179 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keys.html +120 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keysmngr.html +140 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-functions.html +151 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-key-stores.html +83 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-keys.html +103 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-klasses.html +217 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-sharing-results.html +125 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-simple-keys-mngr.html +102 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-skeleton.html +254 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-transforms.html +170 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto.html +136 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-overview.html +102 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-sign-encrypt.html +120 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-sign-x509.html +176 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-sign.html +210 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-simple-keys-store.html +177 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-structure.html +115 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-templates.html +114 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-transforms.html +154 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-verify-decrypt.html +120 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-verify-x509.html +180 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-verify.html +210 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-x509.html +114 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes.html +115 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-app.html +740 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-bignum.html +176 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-crypto.html +978 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-keysstore.html +209 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-pkikeys.html +211 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-ref.html +115 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-x509.html +467 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss.sgml +23 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-app.html +800 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-bn.html +170 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-crypto.html +1329 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-evp.html +184 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-ref.html +113 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-x509.html +567 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl.sgml +21 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-parser.html +223 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-ref.html +149 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-reference.html +106 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-signature-klasses.html +101 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-templates.html +1290 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-transforms.html +3059 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-key.html +318 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-keys-mngr.html +388 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-restrictions.html +715 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-x509.html +369 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-version.html +143 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-x509.html +181 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmldsig.html +853 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmlenc.html +584 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmlsec.html +300 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmltree.html +1529 -0
- data/vendor/xmlsec1-1.2.18/docs/api/xmlsec.sgml +307 -0
- data/vendor/xmlsec1-1.2.18/docs/authors.html +59 -0
- data/vendor/xmlsec1-1.2.18/docs/bugs.html +106 -0
- data/vendor/xmlsec1-1.2.18/docs/c14n.html +73 -0
- data/vendor/xmlsec1-1.2.18/docs/documentation.html +65 -0
- data/vendor/xmlsec1-1.2.18/docs/download.html +115 -0
- data/vendor/xmlsec1-1.2.18/docs/faq.html +449 -0
- data/vendor/xmlsec1-1.2.18/docs/images/bart.gif +0 -0
- data/vendor/xmlsec1-1.2.18/docs/images/libxml2-logo.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/images/libxslt-logo.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/images/logo.gif +0 -0
- data/vendor/xmlsec1-1.2.18/docs/images/openssl-logo.png +0 -0
- data/vendor/xmlsec1-1.2.18/docs/images/xmlsec-logo.gif +0 -0
- data/vendor/xmlsec1-1.2.18/docs/index.html +109 -0
- data/vendor/xmlsec1-1.2.18/docs/news.html +545 -0
- data/vendor/xmlsec1-1.2.18/docs/related.html +165 -0
- data/vendor/xmlsec1-1.2.18/docs/xmldsig-verifier.html +138 -0
- data/vendor/xmlsec1-1.2.18/docs/xmldsig.html +646 -0
- data/vendor/xmlsec1-1.2.18/docs/xmlenc.html +464 -0
- data/vendor/xmlsec1-1.2.18/docs/xmlsec-man.html +291 -0
- data/vendor/xmlsec1-1.2.18/docs/xmlsec.xsl +194 -0
- data/vendor/xmlsec1-1.2.18/examples/Makefile +40 -0
- data/vendor/xmlsec1-1.2.18/examples/Makefile.w32 +88 -0
- data/vendor/xmlsec1-1.2.18/examples/README +126 -0
- data/vendor/xmlsec1-1.2.18/examples/binary.dat +1 -0
- data/vendor/xmlsec1-1.2.18/examples/decrypt1.c +223 -0
- data/vendor/xmlsec1-1.2.18/examples/decrypt2.c +293 -0
- data/vendor/xmlsec1-1.2.18/examples/decrypt3.c +372 -0
- data/vendor/xmlsec1-1.2.18/examples/deskey.bin +1 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt1-res.xml +13 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt1-tmpl.xml +13 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt1.c +219 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt2-doc.xml +9 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt2-res.xml +14 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt2.c +244 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt3-doc.xml +9 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt3-res.xml +27 -0
- data/vendor/xmlsec1-1.2.18/examples/encrypt3.c +340 -0
- data/vendor/xmlsec1-1.2.18/examples/mywin32make.bat +18 -0
- data/vendor/xmlsec1-1.2.18/examples/rootcert.pem +25 -0
- data/vendor/xmlsec1-1.2.18/examples/rsacert.pem +83 -0
- data/vendor/xmlsec1-1.2.18/examples/rsakey.pem +27 -0
- data/vendor/xmlsec1-1.2.18/examples/rsapub.pem +9 -0
- data/vendor/xmlsec1-1.2.18/examples/sign1-res.xml +31 -0
- data/vendor/xmlsec1-1.2.18/examples/sign1-tmpl.xml +27 -0
- data/vendor/xmlsec1-1.2.18/examples/sign1.c +212 -0
- data/vendor/xmlsec1-1.2.18/examples/sign2-doc.xml +9 -0
- data/vendor/xmlsec1-1.2.18/examples/sign2-res.xml +30 -0
- data/vendor/xmlsec1-1.2.18/examples/sign2.c +248 -0
- data/vendor/xmlsec1-1.2.18/examples/sign3-doc.xml +9 -0
- data/vendor/xmlsec1-1.2.18/examples/sign3-res.xml +58 -0
- data/vendor/xmlsec1-1.2.18/examples/sign3.c +261 -0
- data/vendor/xmlsec1-1.2.18/examples/verify1.c +215 -0
- data/vendor/xmlsec1-1.2.18/examples/verify2.c +285 -0
- data/vendor/xmlsec1-1.2.18/examples/verify3.c +266 -0
- data/vendor/xmlsec1-1.2.18/examples/verify4-bad-res.xml +90 -0
- data/vendor/xmlsec1-1.2.18/examples/verify4-bad-tmpl.xml +54 -0
- data/vendor/xmlsec1-1.2.18/examples/verify4-res.xml +80 -0
- data/vendor/xmlsec1-1.2.18/examples/verify4-tmpl.xml +47 -0
- data/vendor/xmlsec1-1.2.18/examples/verify4.c +309 -0
- data/vendor/xmlsec1-1.2.18/examples/xkms-server.c +839 -0
- data/vendor/xmlsec1-1.2.18/examples/xmldsigverify.c +381 -0
- data/vendor/xmlsec1-1.2.18/include/Makefile.am +4 -0
- data/vendor/xmlsec1-1.2.18/include/Makefile.in +656 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/Makefile.am +63 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/Makefile.in +767 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/app.h +424 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/base64.h +67 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/bn.h +99 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/buffer.h +108 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/crypto.h +75 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/dl.h +56 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/errors.h +504 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/exports.h +111 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/Makefile.am +13 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/Makefile.in +564 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/app.h +96 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/crypto.h +460 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/symbols.h +104 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/Makefile.am +14 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/Makefile.in +565 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/app.h +96 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/crypto.h +462 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/symbols.h +104 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/x509.h +110 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/io.h +54 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/keyinfo.h +285 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/keys.h +278 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/keysdata.h +837 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/keysmngr.h +264 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/list.h +194 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/membuf.h +44 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/Makefile.am +16 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/Makefile.in +567 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/app.h +116 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/certkeys.h +42 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/crypto.h +516 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/keysstore.h +48 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/symbols.h +114 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/x509.h +92 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nodeset.h +139 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/Makefile.am +17 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/Makefile.in +568 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/app.h +118 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/bignum.h +37 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/crypto.h +469 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/keysstore.h +46 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/pkikeys.h +44 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/symbols.h +106 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/x509.h +91 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/Makefile.am +16 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/Makefile.in +567 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/app.h +128 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/bn.h +35 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/crypto.h +561 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/evp.h +44 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/symbols.h +123 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/x509.h +109 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/parser.h +51 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/private.h +489 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/private/Makefile.am +12 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/private/Makefile.in +563 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/private/xkms.h +121 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/private/xslt.h +34 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/Makefile.am +13 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/app.h +97 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/crypto.h +40 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/symbols.h +117 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/soap.h +130 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/strings.h +610 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/templates.h +162 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/transforms.h +994 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/version.h +61 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/version.h.in +61 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/x509.h +80 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/xkms.h +652 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/xmldsig.h +281 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/xmlenc.h +163 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/xmlsec.h +216 -0
- data/vendor/xmlsec1-1.2.18/include/xmlsec/xmltree.h +275 -0
- data/vendor/xmlsec1-1.2.18/install-sh +520 -0
- data/vendor/xmlsec1-1.2.18/ltmain.sh +8413 -0
- data/vendor/xmlsec1-1.2.18/m4/libtool.m4 +7377 -0
- data/vendor/xmlsec1-1.2.18/m4/ltoptions.m4 +368 -0
- data/vendor/xmlsec1-1.2.18/m4/ltsugar.m4 +123 -0
- data/vendor/xmlsec1-1.2.18/m4/ltversion.m4 +23 -0
- data/vendor/xmlsec1-1.2.18/m4/lt~obsolete.m4 +92 -0
- data/vendor/xmlsec1-1.2.18/man/Makefile.am +52 -0
- data/vendor/xmlsec1-1.2.18/man/Makefile.in +582 -0
- data/vendor/xmlsec1-1.2.18/man/xmlsec1-config.1 +34 -0
- data/vendor/xmlsec1-1.2.18/man/xmlsec1.1 +269 -0
- data/vendor/xmlsec1-1.2.18/missing +376 -0
- data/vendor/xmlsec1-1.2.18/scripts/build_release.sh +33 -0
- data/vendor/xmlsec1-1.2.18/scripts/change-release.sh +34 -0
- data/vendor/xmlsec1-1.2.18/scripts/push_release.sh +30 -0
- data/vendor/xmlsec1-1.2.18/scripts/remove-gtkdoclink.pl +20 -0
- data/vendor/xmlsec1-1.2.18/scripts/test_errors.pl +38 -0
- data/vendor/xmlsec1-1.2.18/scripts/test_release.sh +12 -0
- data/vendor/xmlsec1-1.2.18/src/Makefile.am +71 -0
- data/vendor/xmlsec1-1.2.18/src/Makefile.in +878 -0
- data/vendor/xmlsec1-1.2.18/src/app.c +1498 -0
- data/vendor/xmlsec1-1.2.18/src/base64.c +1034 -0
- data/vendor/xmlsec1-1.2.18/src/bn.c +1060 -0
- data/vendor/xmlsec1-1.2.18/src/buffer.c +674 -0
- data/vendor/xmlsec1-1.2.18/src/c14n.c +801 -0
- data/vendor/xmlsec1-1.2.18/src/dl.c +994 -0
- data/vendor/xmlsec1-1.2.18/src/enveloped.c +152 -0
- data/vendor/xmlsec1-1.2.18/src/errors.c +242 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/Makefile.am +55 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/Makefile.in +764 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/README +9 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/app.c +663 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/asn1.c +602 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/asn1.h +39 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/asymkeys.c +1920 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/ciphers.c +855 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/crypto.c +315 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/digests.c +614 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/globals.h +30 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/hmac.c +823 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/kw_aes.c +593 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/kw_des.c +607 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/signatures.c +1490 -0
- data/vendor/xmlsec1-1.2.18/src/gcrypt/symkeys.c +441 -0
- data/vendor/xmlsec1-1.2.18/src/globals.h +25 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/Makefile.am +58 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/Makefile.in +786 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/README +6 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/app.c +998 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/asymkeys.c +455 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/ciphers.c +82 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/crypto.c +351 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/digests.c +112 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/globals.h +31 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/hmac.c +141 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/kw_aes.c +72 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/kw_des.c +51 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/signatures.c +148 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/symkeys.c +125 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/x509.c +1960 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/x509utils.c +1687 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/x509utils.h +143 -0
- data/vendor/xmlsec1-1.2.18/src/gnutls/x509vfy.c +802 -0
- data/vendor/xmlsec1-1.2.18/src/io.c +496 -0
- data/vendor/xmlsec1-1.2.18/src/keyinfo.c +1561 -0
- data/vendor/xmlsec1-1.2.18/src/keys.c +1415 -0
- data/vendor/xmlsec1-1.2.18/src/keysdata.c +1387 -0
- data/vendor/xmlsec1-1.2.18/src/keysmngr.c +745 -0
- data/vendor/xmlsec1-1.2.18/src/kw_aes_des.c +493 -0
- data/vendor/xmlsec1-1.2.18/src/kw_aes_des.h +148 -0
- data/vendor/xmlsec1-1.2.18/src/list.c +534 -0
- data/vendor/xmlsec1-1.2.18/src/membuf.c +209 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/Makefile.am +62 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/Makefile.in +799 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/README +39 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/app.c +1289 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/certkeys.c +2615 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/ciphers.c +937 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/crypto.c +889 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/csp_calg.h +105 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/csp_oid.h +114 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/digests.c +668 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/globals.h +39 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/hmac.c +963 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/keysstore.c +620 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/kt_rsa.c +631 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/kw_aes.c +662 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/kw_des.c +730 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/mingw-crypt32.def +36 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/private.h +130 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/signatures.c +960 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/symkeys.c +824 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/x509.c +2281 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/x509vfy.c +1406 -0
- data/vendor/xmlsec1-1.2.18/src/mscrypto/xmlsec-mingw.h +210 -0
- data/vendor/xmlsec1-1.2.18/src/nodeset.c +610 -0
- data/vendor/xmlsec1-1.2.18/src/nss/Makefile.am +57 -0
- data/vendor/xmlsec1-1.2.18/src/nss/Makefile.in +798 -0
- data/vendor/xmlsec1-1.2.18/src/nss/README +128 -0
- data/vendor/xmlsec1-1.2.18/src/nss/app.c +1598 -0
- data/vendor/xmlsec1-1.2.18/src/nss/bignum.c +163 -0
- data/vendor/xmlsec1-1.2.18/src/nss/ciphers.c +838 -0
- data/vendor/xmlsec1-1.2.18/src/nss/crypto.c +444 -0
- data/vendor/xmlsec1-1.2.18/src/nss/digests.c +576 -0
- data/vendor/xmlsec1-1.2.18/src/nss/globals.h +24 -0
- data/vendor/xmlsec1-1.2.18/src/nss/hmac.c +855 -0
- data/vendor/xmlsec1-1.2.18/src/nss/keysstore.c +485 -0
- data/vendor/xmlsec1-1.2.18/src/nss/keytrans.c +753 -0
- data/vendor/xmlsec1-1.2.18/src/nss/kw_aes.c +681 -0
- data/vendor/xmlsec1-1.2.18/src/nss/kw_des.c +663 -0
- data/vendor/xmlsec1-1.2.18/src/nss/pkikeys.c +1554 -0
- data/vendor/xmlsec1-1.2.18/src/nss/signatures.c +841 -0
- data/vendor/xmlsec1-1.2.18/src/nss/symkeys.c +440 -0
- data/vendor/xmlsec1-1.2.18/src/nss/x509.c +2223 -0
- data/vendor/xmlsec1-1.2.18/src/nss/x509vfy.c +808 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/Makefile.am +56 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/Makefile.in +790 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/README +17 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/app.c +1628 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/bn.c +163 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/ciphers.c +856 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/crypto.c +491 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/digests.c +682 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/evp.c +1559 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/globals.h +24 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/hmac.c +857 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/kt_rsa.c +876 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/kw_aes.c +513 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/kw_des.c +563 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/signatures.c +1065 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/symkeys.c +447 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/x509.c +2414 -0
- data/vendor/xmlsec1-1.2.18/src/openssl/x509vfy.c +1284 -0
- data/vendor/xmlsec1-1.2.18/src/parser.c +571 -0
- data/vendor/xmlsec1-1.2.18/src/skeleton/Makefile.am +45 -0
- data/vendor/xmlsec1-1.2.18/src/skeleton/README +0 -0
- data/vendor/xmlsec1-1.2.18/src/skeleton/app.c +499 -0
- data/vendor/xmlsec1-1.2.18/src/skeleton/crypto.c +260 -0
- data/vendor/xmlsec1-1.2.18/src/skeleton/globals.h +24 -0
- data/vendor/xmlsec1-1.2.18/src/soap.c +1322 -0
- data/vendor/xmlsec1-1.2.18/src/strings.c +597 -0
- data/vendor/xmlsec1-1.2.18/src/templates.c +2091 -0
- data/vendor/xmlsec1-1.2.18/src/transforms.c +2902 -0
- data/vendor/xmlsec1-1.2.18/src/x509.c +97 -0
- data/vendor/xmlsec1-1.2.18/src/xkms.c +4981 -0
- data/vendor/xmlsec1-1.2.18/src/xmldsig.c +1795 -0
- data/vendor/xmlsec1-1.2.18/src/xmlenc.c +1339 -0
- data/vendor/xmlsec1-1.2.18/src/xmlsec.c +185 -0
- data/vendor/xmlsec1-1.2.18/src/xmltree.c +1908 -0
- data/vendor/xmlsec1-1.2.18/src/xpath.c +1148 -0
- data/vendor/xmlsec1-1.2.18/src/xslt.c +617 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/Readme.txt +52 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml +29 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/dh-priv-key.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml +30 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml +30 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml +30 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.tmpl +24 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml +83 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.tmpl +23 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml +61 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml +29 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml +83 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml +61 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml +29 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml +29 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml +83 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml +29 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml +83 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml +29 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.tmpl +23 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml +32 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.tmpl +21 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml +28 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml +62 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml +64 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/key.txt +117 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/keys.xml +61 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/payment.xml +9 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/rsa-priv-key.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/rsa-priv-key.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/bad-request-name-not-supported.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/bad-request-name.xml +10 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/compound-example-1-no-match.xml +7 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/compound-example-1.xml +51 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert1.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert1.pem +26 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert2.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert2.pem +25 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert3.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert3.pem +24 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/create-keys.sh +73 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1-pk8.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1.pem +18 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2-pk8.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2.pem +9 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3-pk8.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3.pem +9 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/openssl.cnf +106 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/req2.pem +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/req3.pem +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-1-bad-service.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-1-no-match.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-1.xml +18 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-2-no-match.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-2.xml +39 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-opaque-client-data-no-match.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-opaque-client-data.xml +32 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/readme.txt +117 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-bad-request-name-msg-invalid.xml +9 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-bad-request-name.xml +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-locate-example-1-no-match.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-locate-example-1-unsupported.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-locate-example-1.xml +23 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-bad-request-name-msg-invalid.xml +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-bad-request-name.xml +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-locate-example-1-no-match.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-locate-example-1-unsupported.xml +9 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-locate-example-1.xml +23 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/status-request-success.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/status-request.xml +7 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/validate-example-1-no-match.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/validate-example-1.xml +65 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/README +47 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/dtd-hmac-91.dtd +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/dtd-hmac-91.tmpl +27 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/dtd-hmac-91.xml +27 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloped-gost.tmpl +31 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloped-gost.xml +42 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-dsa-x509chain.tmpl +18 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-dsa-x509chain.xml +87 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-expired-cert.tmpl +18 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-expired-cert.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5-64.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-rsa-md5.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-rsa-md5.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160-64.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-rsa-x509chain.tmpl +18 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-rsa-x509chain.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1-64.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-rsa-sha1.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-rsa-sha1.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-rsa-sha224.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-rsa-sha224.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256-64.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-rsa-sha256.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-rsa-sha256.xml +85 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384-64.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384.xml +13 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-rsa-sha384.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-rsa-sha384.xml +103 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512-64.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512-64.xml +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-rsa-sha512.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-rsa-sha512.xml +104 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-sn-test.tmpl +27 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-sn-test.xml +40 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-test.tmpl +31 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-test.xml +117 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/xpointer-hmac.tmpl +29 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/xpointer-hmac.xml +28 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes128cbc-keyname.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes128cbc-keyname.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes128cbc-keyname.xml +12 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname-ref.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname-ref.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname.xml +12 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes256cbc-keyname.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes256cbc-keyname.tmpl +10 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes256cbc-keyname.xml +12 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-aes192-keyname.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-aes192-keyname.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-aes192-keyname.xml +18 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-content.data +7 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-content.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-content.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element-root.data +7 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element-root.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element-root.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element.data +9 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element.xml +17 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname.tmpl +8 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname.xml +8 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname2.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname2.tmpl +10 -0
- data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname2.xml +12 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/README +203 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/ca2cert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/ca2cert.pem +66 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/ca2key.pem +9 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/cacert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/cacert.pem +72 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/cakey.pem +18 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/cacert.pem +72 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/careq.pem +14 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/index.txt +6 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/01.pem +65 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/02.pem +93 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/03.pem +60 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/04.pem +60 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/05.pem +83 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/private/cakey.pem +18 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/serial +1 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsacert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsacert.pem +78 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.p8-der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.p8-pem +8 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.pem +14 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/expiredcert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/expiredcert.pem +61 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/expiredkey.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/expiredkey.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/expiredkey.pem +9 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/expiredreq.pem +11 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/gost2001ca.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/gost2001ca.pem +13 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/hmackey.bin +1 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/keys.xml +83 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersacert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersacert.pem +100 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey-win.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey-winxp.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.p8-der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.p8-pem +53 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.pem +51 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/largersareq.pem +30 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/merlincert.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/openssl.cnf +316 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsacert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsacert.pem +61 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey-win.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey-winxp.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.p8-der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.p8-pem +11 -0
- data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.pem +9 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/Readme.txt +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-0.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-1.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-10.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-11.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-12.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-13.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-14.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-15.txt +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-16.txt +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-17.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-18.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-19.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-2.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-20.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-21.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-22.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-23.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-24.txt +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-25.txt +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-26.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-27.txt +430 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-3.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-4.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-5.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-6.txt +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-7.txt +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-8.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-9.txt +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/signature.xml +526 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-exc-c14n-one/Readme.txt +3 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-exc-c14n-one/exc-signature.tmpl +52 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-exc-c14n-one/exc-signature.xml +73 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/Readme.txt +63 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/badb.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/badb.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/balor.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/balor.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/bres.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/ca.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/ca.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh-cert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh-cert.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh.pem +12 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/macha.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/macha.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/merlin.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/merlin.pem +21 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/morigu.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/nemain.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/nemain.pem +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloped-dsa.tmpl +22 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloped-dsa.xml +43 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.tmpl +21 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.xml +42 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-dsa.tmpl +18 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-dsa.xml +39 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.xml +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.tmpl +14 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.xml +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-rsa.tmpl +18 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-rsa.xml +31 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-b64-dsa.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-b64-dsa.xml +41 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-dsa.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-dsa.xml +38 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-keyname.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-keyname.xml +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.tmpl +16 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.xml +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt-crl.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt-crl.xml +47 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt.xml +38 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-is.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-is.xml +24 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-ski.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-ski.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-sn.tmpl +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-sn.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature.tmpl +245 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature.xml +269 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/Readme.txt +117 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/bad-encrypt-content-aes128-cbc-kw-aes192.xml +42 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/decryption-transform-except.xml +83 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/decryption-transform.xml +73 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/dh0.p8 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/dh1.p8 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/dsa.p8 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes128-cbc-kw-aes192.data +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes128-cbc-kw-aes192.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes128-cbc-kw-aes192.xml +45 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes192-cbc-dh-sha512.xml +113 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes256-cbc-prop.data +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes256-cbc-prop.tmpl +18 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes256-cbc-prop.xml +42 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-tripledes-cbc.data +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-tripledes-cbc.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-tripledes-cbc.xml +35 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes128-cbc.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes128-cbc.tmpl +11 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes128-cbc.xml +12 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.xml +22 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.xml +22 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p-sha256.xml +46 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.data +1 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.tmpl +21 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.xml +43 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.data +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.tmpl +19 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.xml +63 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes192-cbc-ref.data +36 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes192-cbc-ref.xml +42 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-carried-kw-aes256.xml +57 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-kw-aes256-dh-ripemd160.xml +122 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-retrieved-kw-aes256.data +40 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-retrieved-kw-aes256.xml +47 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.data +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.tmpl +20 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.xml +43 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-dh.xml +98 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-kw-tripledes-dh.xml +108 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-rsa-1_5.xml +46 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-rsa-oaep-mgf1p.xml +51 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes.tmpl +25 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes.xml +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-sha256-hmac-sha256-kw-aes128.xml +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-sha384-hmac-sha384-kw-aes192.xml +27 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-sha512-hmac-sha512-kw-aes256.xml +28 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/ids.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/keys.xml +42 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/plaintext.xml +24 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsa.p8 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.p12 +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.p8-der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.p8-pem +17 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.pem +15 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapub.pem +6 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/Readme.txt +23 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec-c14n-0.txt +11 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec-c14n-1.txt +0 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec-c14n-2.txt +25 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec.tmpl +50 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec.xml +122 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-xfdl-c14n-0.txt +3986 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-xfdl.tmpl +4153 -0
- data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-xfdl.xml +4225 -0
- data/vendor/xmlsec1-1.2.18/tests/nss.supp +220 -0
- data/vendor/xmlsec1-1.2.18/tests/nssdb/cert8.db +0 -0
- data/vendor/xmlsec1-1.2.18/tests/nssdb/key3.db +0 -0
- data/vendor/xmlsec1-1.2.18/tests/nssdb/secmod.db +0 -0
- data/vendor/xmlsec1-1.2.18/tests/openssl.supp +63 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/README.txt +248 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/crl.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/dsa-ca-cert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/dsa-cert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/enc-dsa-key.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/enc-rsa-key.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/hmackey.bin +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/rsa-ca-cert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/rsa-cert.der +0 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document-stylesheet.xml +7 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document.b64 +4 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document.xsl +45 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-big.xml +39 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-detached.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-enveloped.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-enveloping.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-manifest.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-md5-c14n-enveloping.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-40-c14n-comments-detached.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-40-exclusive-c14n-comments-detached.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-exclusive-c14n-comments-detached.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-exclusive-c14n-enveloped.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-b64-transform.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xpath-transform.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xslt-transform-bad-retrieval-method.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xslt-transform-retrieval-method.xml +39 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xslt-transform.xml +39 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloped-bad-digest-val.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloped-bad-sig.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloped.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloping.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-cert-chain.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-cert.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-issuer-serial.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-ski.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-subject-name.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-xpath-transform-enveloped.xml +6 -0
- data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-~x509-data-crl.xml +1 -0
- data/vendor/xmlsec1-1.2.18/tests/testDSig.sh +875 -0
- data/vendor/xmlsec1-1.2.18/tests/testEnc.sh +411 -0
- data/vendor/xmlsec1-1.2.18/tests/testKeys.sh +69 -0
- data/vendor/xmlsec1-1.2.18/tests/testRes.sh +20 -0
- data/vendor/xmlsec1-1.2.18/tests/testXKMS.sh +129 -0
- data/vendor/xmlsec1-1.2.18/tests/testrun.sh +443 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/c14n11/xml-base-input.xml +17 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-1.tmpl +2 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-1.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-2.tmpl +2 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-2.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-3.tmpl +2 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-3.xml +2 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-1-SUN.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-2-SUN.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-3-SUN.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-4-SUN.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-5-SUN.xml +21 -0
- data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-6-SUN.xml +21 -0
- data/vendor/xmlsec1-1.2.18/win32/Makefile.msvc +699 -0
- data/vendor/xmlsec1-1.2.18/win32/README.txt +168 -12
- data/vendor/xmlsec1-1.2.18/win32/configure.js +395 -0
- data/vendor/xmlsec1-1.2.18/win32/libxmlsec.def.src +25 -0
- data/vendor/xmlsec1-1.2.18/win32/mycfg.bat +21 -0
- data/vendor/xmlsec1-1.2.18/xmlsec-config.in +243 -0
- data/vendor/xmlsec1-1.2.18/xmlsec-gcrypt.pc.in +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec-gnutls.pc.in +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec-nss.pc.in +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec-openssl.pc.in +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec.pc.in +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec.spec.in +185 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1-config +243 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1-gcrypt.pc +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1-gnutls.pc +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1-nss.pc +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1-openssl.pc +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1.m4 +172 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1.pc +11 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1.spec +185 -0
- data/vendor/xmlsec1-1.2.18/xmlsec1Conf.sh +13 -0
- data/vendor/xmlsec1-1.2.18/xmlsecConf.sh.in +13 -0
- data/xmlsec-shim.gemspec +18 -0
- metadata +1014 -0
|
@@ -0,0 +1,2902 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XML Security Library (http://www.aleksey.com/xmlsec).
|
|
3
|
+
*
|
|
4
|
+
* The Transforms Element (http://www.w3.org/TR/xmldsig-core/#sec-Transforms)
|
|
5
|
+
*
|
|
6
|
+
* The optional Transforms element contains an ordered list of Transform
|
|
7
|
+
* elements; these describe how the signer obtained the data object that
|
|
8
|
+
* was digested.
|
|
9
|
+
*
|
|
10
|
+
* Schema Definition:
|
|
11
|
+
*
|
|
12
|
+
* <element name="Transforms" type="ds:TransformsType"/>
|
|
13
|
+
* <complexType name="TransformsType">
|
|
14
|
+
* <sequence>
|
|
15
|
+
* <element ref="ds:Transform" maxOccurs="unbounded"/>
|
|
16
|
+
* </sequence>
|
|
17
|
+
* </complexType>
|
|
18
|
+
*
|
|
19
|
+
* <element name="Transform" type="ds:TransformType"/>
|
|
20
|
+
* <complexType name="TransformType" mixed="true">
|
|
21
|
+
* <choice minOccurs="0" maxOccurs="unbounded">
|
|
22
|
+
* <any namespace="##other" processContents="lax"/>
|
|
23
|
+
* <!-- (1,1) elements from (0,unbounded) namespaces -->
|
|
24
|
+
* <element name="XPath" type="string"/>
|
|
25
|
+
* </choice>
|
|
26
|
+
* <attribute name="Algorithm" type="anyURI" use="required"/>
|
|
27
|
+
* </complexType>
|
|
28
|
+
*
|
|
29
|
+
* DTD:
|
|
30
|
+
*
|
|
31
|
+
* <!ELEMENT Transforms (Transform+)>
|
|
32
|
+
* <!ELEMENT Transform (#PCDATA|XPath %Transform.ANY;)* >
|
|
33
|
+
* <!ATTLIST Transform Algorithm CDATA #REQUIRED >
|
|
34
|
+
* <!ELEMENT XPath (#PCDATA) >
|
|
35
|
+
*
|
|
36
|
+
* This is free software; see Copyright file in the source
|
|
37
|
+
* distribution for preciese wording.
|
|
38
|
+
*
|
|
39
|
+
* Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
#include "globals.h"
|
|
43
|
+
#include <stdlib.h>
|
|
44
|
+
#include <stdio.h>
|
|
45
|
+
#include <string.h>
|
|
46
|
+
|
|
47
|
+
#include <libxml/tree.h>
|
|
48
|
+
#include <libxml/xpath.h>
|
|
49
|
+
#include <libxml/xpointer.h>
|
|
50
|
+
|
|
51
|
+
#include <xmlsec/xmlsec.h>
|
|
52
|
+
#include <xmlsec/buffer.h>
|
|
53
|
+
#include <xmlsec/xmltree.h>
|
|
54
|
+
#include <xmlsec/keysdata.h>
|
|
55
|
+
#include <xmlsec/keys.h>
|
|
56
|
+
#include <xmlsec/keyinfo.h>
|
|
57
|
+
#include <xmlsec/transforms.h>
|
|
58
|
+
#include <xmlsec/base64.h>
|
|
59
|
+
#include <xmlsec/io.h>
|
|
60
|
+
#include <xmlsec/membuf.h>
|
|
61
|
+
#include <xmlsec/parser.h>
|
|
62
|
+
#include <xmlsec/errors.h>
|
|
63
|
+
|
|
64
|
+
#include <xmlsec/private/xslt.h>
|
|
65
|
+
|
|
66
|
+
/**************************************************************************
|
|
67
|
+
*
|
|
68
|
+
* Global xmlSecTransformIds list functions
|
|
69
|
+
*
|
|
70
|
+
*************************************************************************/
|
|
71
|
+
static xmlSecPtrList xmlSecAllTransformIds;
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* xmlSecTransformIdsGet:
|
|
76
|
+
*
|
|
77
|
+
* Gets global registered transform klasses list.
|
|
78
|
+
*
|
|
79
|
+
* Returns: the pointer to list of all registered transform klasses.
|
|
80
|
+
*/
|
|
81
|
+
xmlSecPtrListPtr
|
|
82
|
+
xmlSecTransformIdsGet(void) {
|
|
83
|
+
return(&xmlSecAllTransformIds);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* xmlSecTransformIdsInit:
|
|
88
|
+
*
|
|
89
|
+
* Initializes the transform klasses. This function is called from the
|
|
90
|
+
* #xmlSecInit function and the application should not call it directly.
|
|
91
|
+
*
|
|
92
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
93
|
+
*/
|
|
94
|
+
int
|
|
95
|
+
xmlSecTransformIdsInit(void) {
|
|
96
|
+
int ret;
|
|
97
|
+
|
|
98
|
+
ret = xmlSecPtrListInitialize(xmlSecTransformIdsGet(), xmlSecTransformIdListId);
|
|
99
|
+
if(ret < 0) {
|
|
100
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
101
|
+
NULL,
|
|
102
|
+
"xmlSecPtrListPtrInitialize",
|
|
103
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
104
|
+
"xmlSecTransformIdListId");
|
|
105
|
+
return(-1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
ret = xmlSecTransformIdsRegisterDefault();
|
|
109
|
+
if(ret < 0) {
|
|
110
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
111
|
+
NULL,
|
|
112
|
+
"xmlSecTransformIdsRegisterDefault",
|
|
113
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
114
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
115
|
+
return(-1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
#ifndef XMLSEC_NO_XSLT
|
|
119
|
+
xmlSecTransformXsltInitialize();
|
|
120
|
+
#endif /* XMLSEC_NO_XSLT */
|
|
121
|
+
|
|
122
|
+
return(0);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* xmlSecTransformIdsShutdown:
|
|
127
|
+
*
|
|
128
|
+
* Shuts down the keys data klasses. This function is called from the
|
|
129
|
+
* #xmlSecShutdown function and the application should not call it directly.
|
|
130
|
+
*/
|
|
131
|
+
void
|
|
132
|
+
xmlSecTransformIdsShutdown(void) {
|
|
133
|
+
#ifndef XMLSEC_NO_XSLT
|
|
134
|
+
xmlSecTransformXsltShutdown();
|
|
135
|
+
#endif /* XMLSEC_NO_XSLT */
|
|
136
|
+
|
|
137
|
+
xmlSecPtrListFinalize(xmlSecTransformIdsGet());
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* xmlSecTransformIdsRegister:
|
|
142
|
+
* @id: the transform klass.
|
|
143
|
+
*
|
|
144
|
+
* Registers @id in the global list of transform klasses.
|
|
145
|
+
*
|
|
146
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
147
|
+
*/
|
|
148
|
+
int
|
|
149
|
+
xmlSecTransformIdsRegister(xmlSecTransformId id) {
|
|
150
|
+
int ret;
|
|
151
|
+
|
|
152
|
+
xmlSecAssert2(id != xmlSecTransformIdUnknown, -1);
|
|
153
|
+
|
|
154
|
+
ret = xmlSecPtrListAdd(xmlSecTransformIdsGet(), (xmlSecPtr)id);
|
|
155
|
+
if(ret < 0) {
|
|
156
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
157
|
+
NULL,
|
|
158
|
+
"xmlSecPtrListAdd",
|
|
159
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
160
|
+
"transform=%s",
|
|
161
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(id)));
|
|
162
|
+
return(-1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return(0);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* xmlSecTransformIdsRegisterDefault:
|
|
170
|
+
*
|
|
171
|
+
* Registers default (implemented by XML Security Library)
|
|
172
|
+
* transform klasses: XPath transform, Base64 transform, ...
|
|
173
|
+
*
|
|
174
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
175
|
+
*/
|
|
176
|
+
int
|
|
177
|
+
xmlSecTransformIdsRegisterDefault(void) {
|
|
178
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformBase64Id) < 0) {
|
|
179
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
180
|
+
NULL,
|
|
181
|
+
"xmlSecTransformIdsRegister",
|
|
182
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
183
|
+
"name=%s",
|
|
184
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformBase64Id)));
|
|
185
|
+
return(-1);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformEnvelopedId) < 0) {
|
|
189
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
190
|
+
NULL,
|
|
191
|
+
"xmlSecTransformIdsRegister",
|
|
192
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
193
|
+
"name=%s",
|
|
194
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformEnvelopedId)));
|
|
195
|
+
return(-1);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* c14n methods */
|
|
199
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformInclC14NId) < 0) {
|
|
200
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
201
|
+
NULL,
|
|
202
|
+
"xmlSecTransformIdsRegister",
|
|
203
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
204
|
+
"name=%s",
|
|
205
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformInclC14NId)));
|
|
206
|
+
return(-1);
|
|
207
|
+
}
|
|
208
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformInclC14NWithCommentsId) < 0) {
|
|
209
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
210
|
+
NULL,
|
|
211
|
+
"xmlSecTransformIdsRegister",
|
|
212
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
213
|
+
"name=%s",
|
|
214
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformInclC14NWithCommentsId)));
|
|
215
|
+
return(-1);
|
|
216
|
+
}
|
|
217
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformInclC14N11Id) < 0) {
|
|
218
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
219
|
+
NULL,
|
|
220
|
+
"xmlSecTransformIdsRegister",
|
|
221
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
222
|
+
"name=%s",
|
|
223
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformInclC14N11Id)));
|
|
224
|
+
return(-1);
|
|
225
|
+
}
|
|
226
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformInclC14N11WithCommentsId) < 0) {
|
|
227
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
228
|
+
NULL,
|
|
229
|
+
"xmlSecTransformIdsRegister",
|
|
230
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
231
|
+
"name=%s",
|
|
232
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformInclC14N11WithCommentsId)));
|
|
233
|
+
return(-1);
|
|
234
|
+
}
|
|
235
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformExclC14NId) < 0) {
|
|
236
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
237
|
+
NULL,
|
|
238
|
+
"xmlSecTransformIdsRegister",
|
|
239
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
240
|
+
"name=%s",
|
|
241
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformExclC14NId)));
|
|
242
|
+
return(-1);
|
|
243
|
+
}
|
|
244
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformExclC14NWithCommentsId) < 0) {
|
|
245
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
246
|
+
NULL,
|
|
247
|
+
"xmlSecTransformIdsRegister",
|
|
248
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
249
|
+
"name=%s",
|
|
250
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformExclC14NWithCommentsId)));
|
|
251
|
+
return(-1);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformXPathId) < 0) {
|
|
255
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
256
|
+
NULL,
|
|
257
|
+
"xmlSecTransformIdsRegister",
|
|
258
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
259
|
+
"name=%s",
|
|
260
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformXPathId)));
|
|
261
|
+
return(-1);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformXPath2Id) < 0) {
|
|
265
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
266
|
+
NULL,
|
|
267
|
+
"xmlSecTransformIdsRegister",
|
|
268
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
269
|
+
"name=%s",
|
|
270
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformXPath2Id)));
|
|
271
|
+
return(-1);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformXPointerId) < 0) {
|
|
275
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
276
|
+
NULL,
|
|
277
|
+
"xmlSecTransformIdsRegister",
|
|
278
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
279
|
+
"name=%s",
|
|
280
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformXPointerId)));
|
|
281
|
+
return(-1);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
#ifndef XMLSEC_NO_XSLT
|
|
285
|
+
if(xmlSecTransformIdsRegister(xmlSecTransformXsltId) < 0) {
|
|
286
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
287
|
+
NULL,
|
|
288
|
+
"xmlSecTransformIdsRegister",
|
|
289
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
290
|
+
"name=%s",
|
|
291
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformXsltId)));
|
|
292
|
+
return(-1);
|
|
293
|
+
}
|
|
294
|
+
#endif /* XMLSEC_NO_XSLT */
|
|
295
|
+
|
|
296
|
+
return(0);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**************************************************************************
|
|
300
|
+
*
|
|
301
|
+
* utils
|
|
302
|
+
*
|
|
303
|
+
*************************************************************************/
|
|
304
|
+
/**
|
|
305
|
+
* xmlSecTransformUriTypeCheck:
|
|
306
|
+
* @type: the expected URI type.
|
|
307
|
+
* @uri: the uri for checking.
|
|
308
|
+
*
|
|
309
|
+
* Checks if @uri matches expected type @type.
|
|
310
|
+
*
|
|
311
|
+
* Returns: 1 if @uri matches @type, 0 if not or a negative value
|
|
312
|
+
* if an error occurs.
|
|
313
|
+
*/
|
|
314
|
+
int
|
|
315
|
+
xmlSecTransformUriTypeCheck(xmlSecTransformUriType type, const xmlChar* uri) {
|
|
316
|
+
xmlSecTransformUriType uriType = 0;
|
|
317
|
+
|
|
318
|
+
if((uri == NULL) || (xmlStrlen(uri) == 0)) {
|
|
319
|
+
uriType = xmlSecTransformUriTypeEmpty;
|
|
320
|
+
} else if(uri[0] == '#') {
|
|
321
|
+
uriType = xmlSecTransformUriTypeSameDocument;
|
|
322
|
+
} else if(xmlStrncmp(uri, BAD_CAST "file://", 7) == 0) {
|
|
323
|
+
uriType = xmlSecTransformUriTypeLocal;
|
|
324
|
+
} else {
|
|
325
|
+
uriType = xmlSecTransformUriTypeRemote;
|
|
326
|
+
}
|
|
327
|
+
return(((uriType & type) != 0) ? 1 : 0);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**************************************************************************
|
|
331
|
+
*
|
|
332
|
+
* xmlSecTransformCtx
|
|
333
|
+
*
|
|
334
|
+
*************************************************************************/
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* xmlSecTransformCtxCreate:
|
|
338
|
+
*
|
|
339
|
+
* Creates transforms chain processing context.
|
|
340
|
+
* The caller is responsible for destroying returned object by calling
|
|
341
|
+
* #xmlSecTransformCtxDestroy function.
|
|
342
|
+
*
|
|
343
|
+
* Returns: pointer to newly allocated context object or NULL if an error
|
|
344
|
+
* occurs.
|
|
345
|
+
*/
|
|
346
|
+
xmlSecTransformCtxPtr
|
|
347
|
+
xmlSecTransformCtxCreate(void) {
|
|
348
|
+
xmlSecTransformCtxPtr ctx;
|
|
349
|
+
int ret;
|
|
350
|
+
|
|
351
|
+
/* Allocate a new xmlSecTransform and fill the fields. */
|
|
352
|
+
ctx = (xmlSecTransformCtxPtr)xmlMalloc(sizeof(xmlSecTransformCtx));
|
|
353
|
+
if(ctx == NULL) {
|
|
354
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
355
|
+
NULL,
|
|
356
|
+
NULL,
|
|
357
|
+
XMLSEC_ERRORS_R_MALLOC_FAILED,
|
|
358
|
+
"size=%d", sizeof(xmlSecTransformCtx));
|
|
359
|
+
return(NULL);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
ret = xmlSecTransformCtxInitialize(ctx);
|
|
363
|
+
if(ret < 0) {
|
|
364
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
365
|
+
NULL,
|
|
366
|
+
"xmlSecTransformCtxInitialize",
|
|
367
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
368
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
369
|
+
xmlSecTransformCtxDestroy(ctx);
|
|
370
|
+
return(NULL);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return(ctx);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* xmlSecTransformCtxDestroy:
|
|
378
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
379
|
+
*
|
|
380
|
+
* Destroy context object created with #xmlSecTransformCtxCreate function.
|
|
381
|
+
*/
|
|
382
|
+
void
|
|
383
|
+
xmlSecTransformCtxDestroy(xmlSecTransformCtxPtr ctx) {
|
|
384
|
+
xmlSecAssert(ctx != NULL);
|
|
385
|
+
|
|
386
|
+
xmlSecTransformCtxFinalize(ctx);
|
|
387
|
+
xmlFree(ctx);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* xmlSecTransformCtxInitialize:
|
|
392
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
393
|
+
*
|
|
394
|
+
* Initializes transforms chain processing context.
|
|
395
|
+
* The caller is responsible for cleaning up returned object by calling
|
|
396
|
+
* #xmlSecTransformCtxFinalize function.
|
|
397
|
+
*
|
|
398
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
399
|
+
*/
|
|
400
|
+
int
|
|
401
|
+
xmlSecTransformCtxInitialize(xmlSecTransformCtxPtr ctx) {
|
|
402
|
+
int ret;
|
|
403
|
+
|
|
404
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
405
|
+
|
|
406
|
+
memset(ctx, 0, sizeof(xmlSecTransformCtx));
|
|
407
|
+
|
|
408
|
+
ret = xmlSecPtrListInitialize(&(ctx->enabledTransforms), xmlSecTransformIdListId);
|
|
409
|
+
if(ret < 0) {
|
|
410
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
411
|
+
NULL,
|
|
412
|
+
"xmlSecPtrListInitialize",
|
|
413
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
414
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
415
|
+
return(-1);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
ctx->enabledUris = xmlSecTransformUriTypeAny;
|
|
419
|
+
return(0);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* xmlSecTransformCtxFinalize:
|
|
424
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
425
|
+
*
|
|
426
|
+
* Cleans up @ctx object initialized with #xmlSecTransformCtxInitialize function.
|
|
427
|
+
*/
|
|
428
|
+
void
|
|
429
|
+
xmlSecTransformCtxFinalize(xmlSecTransformCtxPtr ctx) {
|
|
430
|
+
xmlSecAssert(ctx != NULL);
|
|
431
|
+
|
|
432
|
+
xmlSecTransformCtxReset(ctx);
|
|
433
|
+
xmlSecPtrListFinalize(&(ctx->enabledTransforms));
|
|
434
|
+
memset(ctx, 0, sizeof(xmlSecTransformCtx));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* xmlSecTransformCtxReset:
|
|
439
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
440
|
+
*
|
|
441
|
+
* Resets transfroms context for new processing.
|
|
442
|
+
*/
|
|
443
|
+
void
|
|
444
|
+
xmlSecTransformCtxReset(xmlSecTransformCtxPtr ctx) {
|
|
445
|
+
xmlSecTransformPtr transform, tmp;
|
|
446
|
+
|
|
447
|
+
xmlSecAssert(ctx != NULL);
|
|
448
|
+
|
|
449
|
+
ctx->result = NULL;
|
|
450
|
+
ctx->status = xmlSecTransformStatusNone;
|
|
451
|
+
|
|
452
|
+
/* destroy uri */
|
|
453
|
+
if(ctx->uri != NULL) {
|
|
454
|
+
xmlFree(ctx->uri);
|
|
455
|
+
ctx->uri = NULL;
|
|
456
|
+
}
|
|
457
|
+
if(ctx->xptrExpr != NULL) {
|
|
458
|
+
xmlFree(ctx->xptrExpr);
|
|
459
|
+
ctx->xptrExpr = NULL;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/* destroy transforms chain */
|
|
463
|
+
for(transform = ctx->first; transform != NULL; transform = tmp) {
|
|
464
|
+
tmp = transform->next;
|
|
465
|
+
xmlSecTransformDestroy(transform);
|
|
466
|
+
}
|
|
467
|
+
ctx->first = ctx->last = NULL;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* xmlSecTransformCtxCopyUserPref:
|
|
472
|
+
* @dst: the pointer to destination transforms chain processing context.
|
|
473
|
+
* @src: the pointer to source transforms chain processing context.
|
|
474
|
+
*
|
|
475
|
+
* Copies user settings from @src context to @dst.
|
|
476
|
+
*
|
|
477
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
478
|
+
*/
|
|
479
|
+
int
|
|
480
|
+
xmlSecTransformCtxCopyUserPref(xmlSecTransformCtxPtr dst, xmlSecTransformCtxPtr src) {
|
|
481
|
+
int ret;
|
|
482
|
+
|
|
483
|
+
xmlSecAssert2(dst != NULL, -1);
|
|
484
|
+
xmlSecAssert2(src != NULL, -1);
|
|
485
|
+
|
|
486
|
+
dst->userData = src->userData;
|
|
487
|
+
dst->flags = src->flags;
|
|
488
|
+
dst->flags2 = src->flags2;
|
|
489
|
+
dst->enabledUris = src->enabledUris;
|
|
490
|
+
dst->preExecCallback = src->preExecCallback;
|
|
491
|
+
|
|
492
|
+
ret = xmlSecPtrListCopy(&(dst->enabledTransforms), &(src->enabledTransforms));
|
|
493
|
+
if(ret < 0) {
|
|
494
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
495
|
+
NULL,
|
|
496
|
+
"xmlSecPtrListCopy",
|
|
497
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
498
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
499
|
+
return(-1);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return(0);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* xmlSecTransformCtxAppend:
|
|
507
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
508
|
+
* @transform: the pointer to new transform.
|
|
509
|
+
*
|
|
510
|
+
* Connects the @transform to the end of the chain of transforms in the @ctx
|
|
511
|
+
* (see #xmlSecTransformConnect function for details).
|
|
512
|
+
*
|
|
513
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
514
|
+
*/
|
|
515
|
+
int
|
|
516
|
+
xmlSecTransformCtxAppend(xmlSecTransformCtxPtr ctx, xmlSecTransformPtr transform) {
|
|
517
|
+
int ret;
|
|
518
|
+
|
|
519
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
520
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
521
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
522
|
+
|
|
523
|
+
if(ctx->last != NULL) {
|
|
524
|
+
ret = xmlSecTransformConnect(ctx->last, transform, ctx);
|
|
525
|
+
if(ret < 0) {
|
|
526
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
527
|
+
NULL,
|
|
528
|
+
"xmlSecTransformConnect",
|
|
529
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
530
|
+
"name=%s",
|
|
531
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
532
|
+
return(-1);
|
|
533
|
+
}
|
|
534
|
+
} else {
|
|
535
|
+
xmlSecAssert2(ctx->first == NULL, -1);
|
|
536
|
+
ctx->first = transform;
|
|
537
|
+
}
|
|
538
|
+
ctx->last = transform;
|
|
539
|
+
|
|
540
|
+
return(0);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* xmlSecTransformCtxPrepend:
|
|
545
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
546
|
+
* @transform: the pointer to new transform.
|
|
547
|
+
*
|
|
548
|
+
* Connects the @transform to the beggining of the chain of transforms in the @ctx
|
|
549
|
+
* (see #xmlSecTransformConnect function for details).
|
|
550
|
+
*
|
|
551
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
552
|
+
*/
|
|
553
|
+
int
|
|
554
|
+
xmlSecTransformCtxPrepend(xmlSecTransformCtxPtr ctx, xmlSecTransformPtr transform) {
|
|
555
|
+
int ret;
|
|
556
|
+
|
|
557
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
558
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
559
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
560
|
+
|
|
561
|
+
if(ctx->first != NULL) {
|
|
562
|
+
ret = xmlSecTransformConnect(transform, ctx->first, ctx);
|
|
563
|
+
if(ret < 0) {
|
|
564
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
565
|
+
NULL,
|
|
566
|
+
"xmlSecTransformConnect",
|
|
567
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
568
|
+
"name=%s",
|
|
569
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
570
|
+
return(-1);
|
|
571
|
+
}
|
|
572
|
+
} else {
|
|
573
|
+
xmlSecAssert2(ctx->last == NULL, -1);
|
|
574
|
+
ctx->last = transform;
|
|
575
|
+
}
|
|
576
|
+
ctx->first = transform;
|
|
577
|
+
|
|
578
|
+
return(0);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* xmlSecTransformCtxCreateAndAppend:
|
|
583
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
584
|
+
* @id: the new transform klass.
|
|
585
|
+
*
|
|
586
|
+
* Creaeates new transform and connects it to the end of the chain of
|
|
587
|
+
* transforms in the @ctx (see #xmlSecTransformConnect function for details).
|
|
588
|
+
*
|
|
589
|
+
* Returns: pointer to newly created transform or NULL if an error occurs.
|
|
590
|
+
*/
|
|
591
|
+
xmlSecTransformPtr
|
|
592
|
+
xmlSecTransformCtxCreateAndAppend(xmlSecTransformCtxPtr ctx, xmlSecTransformId id) {
|
|
593
|
+
xmlSecTransformPtr transform;
|
|
594
|
+
int ret;
|
|
595
|
+
|
|
596
|
+
xmlSecAssert2(ctx != NULL, NULL);
|
|
597
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, NULL);
|
|
598
|
+
xmlSecAssert2(id != xmlSecTransformIdUnknown, NULL);
|
|
599
|
+
|
|
600
|
+
transform = xmlSecTransformCreate(id);
|
|
601
|
+
if(!xmlSecTransformIsValid(transform)) {
|
|
602
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
603
|
+
NULL,
|
|
604
|
+
"xmlSecTransformCreate",
|
|
605
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
606
|
+
"transform=%s",
|
|
607
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(id)));
|
|
608
|
+
return(NULL);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
ret = xmlSecTransformCtxAppend(ctx, transform);
|
|
612
|
+
if(ret < 0) {
|
|
613
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
614
|
+
NULL,
|
|
615
|
+
"xmlSecTransformCtxAppend",
|
|
616
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
617
|
+
"name=%s",
|
|
618
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
619
|
+
xmlSecTransformDestroy(transform);
|
|
620
|
+
return(NULL);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
return(transform);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* xmlSecTransformCtxCreateAndPrepend:
|
|
628
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
629
|
+
* @id: the new transform klass.
|
|
630
|
+
*
|
|
631
|
+
* Creaeates new transform and connects it to the end of the chain of
|
|
632
|
+
* transforms in the @ctx (see #xmlSecTransformConnect function for details).
|
|
633
|
+
*
|
|
634
|
+
* Returns: pointer to newly created transform or NULL if an error occurs.
|
|
635
|
+
*/
|
|
636
|
+
xmlSecTransformPtr
|
|
637
|
+
xmlSecTransformCtxCreateAndPrepend(xmlSecTransformCtxPtr ctx, xmlSecTransformId id) {
|
|
638
|
+
xmlSecTransformPtr transform;
|
|
639
|
+
int ret;
|
|
640
|
+
|
|
641
|
+
xmlSecAssert2(ctx != NULL, NULL);
|
|
642
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, NULL);
|
|
643
|
+
xmlSecAssert2(id != xmlSecTransformIdUnknown, NULL);
|
|
644
|
+
|
|
645
|
+
transform = xmlSecTransformCreate(id);
|
|
646
|
+
if(!xmlSecTransformIsValid(transform)) {
|
|
647
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
648
|
+
NULL,
|
|
649
|
+
"xmlSecTransformCreate",
|
|
650
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
651
|
+
"transform=%s",
|
|
652
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(id)));
|
|
653
|
+
return(NULL);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
ret = xmlSecTransformCtxPrepend(ctx, transform);
|
|
657
|
+
if(ret < 0) {
|
|
658
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
659
|
+
NULL,
|
|
660
|
+
"xmlSecTransformCtxPrepend",
|
|
661
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
662
|
+
"name=%s",
|
|
663
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
664
|
+
xmlSecTransformDestroy(transform);
|
|
665
|
+
return(NULL);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
return(transform);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* xmlSecTransformCtxNodeRead:
|
|
673
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
674
|
+
* @node: the pointer to transform's node.
|
|
675
|
+
* @usage: the transform's usage (signature, encryption, etc.).
|
|
676
|
+
*
|
|
677
|
+
* Reads the transform from the @node and appends it to the current chain
|
|
678
|
+
* of transforms in @ctx.
|
|
679
|
+
*
|
|
680
|
+
* Returns: pointer to newly created transform or NULL if an error occurs.
|
|
681
|
+
*/
|
|
682
|
+
xmlSecTransformPtr
|
|
683
|
+
xmlSecTransformCtxNodeRead(xmlSecTransformCtxPtr ctx, xmlNodePtr node,
|
|
684
|
+
xmlSecTransformUsage usage) {
|
|
685
|
+
xmlSecTransformPtr transform;
|
|
686
|
+
int ret;
|
|
687
|
+
|
|
688
|
+
xmlSecAssert2(ctx != NULL, NULL);
|
|
689
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, NULL);
|
|
690
|
+
xmlSecAssert2(node != NULL, NULL);
|
|
691
|
+
|
|
692
|
+
transform = xmlSecTransformNodeRead(node, usage, ctx);
|
|
693
|
+
if(transform == NULL) {
|
|
694
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
695
|
+
NULL,
|
|
696
|
+
"xmlSecTransformNodeRead",
|
|
697
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
698
|
+
"name=%s",
|
|
699
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(node)));
|
|
700
|
+
return(NULL);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
ret = xmlSecTransformCtxAppend(ctx, transform);
|
|
704
|
+
if(ret < 0) {
|
|
705
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
706
|
+
NULL,
|
|
707
|
+
"xmlSecTransformCtxAppend",
|
|
708
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
709
|
+
"name=%s",
|
|
710
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
711
|
+
xmlSecTransformDestroy(transform);
|
|
712
|
+
return(NULL);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return(transform);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* xmlSecTransformCtxNodesListRead:
|
|
720
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
721
|
+
* @node: the pointer to <dsig:Transform/> nodes parent node.
|
|
722
|
+
* @usage: the transform's usage (signature, encryption, etc.).
|
|
723
|
+
*
|
|
724
|
+
* Reads transforms from the <dsig:Transform/> children of the @node and
|
|
725
|
+
* appends them to the current transforms chain in @ctx object.
|
|
726
|
+
*
|
|
727
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
728
|
+
*/
|
|
729
|
+
int
|
|
730
|
+
xmlSecTransformCtxNodesListRead(xmlSecTransformCtxPtr ctx, xmlNodePtr node, xmlSecTransformUsage usage) {
|
|
731
|
+
xmlSecTransformPtr transform;
|
|
732
|
+
xmlNodePtr cur;
|
|
733
|
+
int ret;
|
|
734
|
+
|
|
735
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
736
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
737
|
+
xmlSecAssert2(node != NULL, -1);
|
|
738
|
+
|
|
739
|
+
cur = xmlSecGetNextElementNode(node->children);
|
|
740
|
+
while((cur != NULL) && xmlSecCheckNodeName(cur, xmlSecNodeTransform, xmlSecDSigNs)) {
|
|
741
|
+
transform = xmlSecTransformNodeRead(cur, usage, ctx);
|
|
742
|
+
if(transform == NULL) {
|
|
743
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
744
|
+
NULL,
|
|
745
|
+
"xmlSecTransformNodeRead",
|
|
746
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
747
|
+
"node=%s",
|
|
748
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)));
|
|
749
|
+
return(-1);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
ret = xmlSecTransformCtxAppend(ctx, transform);
|
|
753
|
+
if(ret < 0) {
|
|
754
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
755
|
+
NULL,
|
|
756
|
+
"xmlSecTransformCtxAppend",
|
|
757
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
758
|
+
"node=%s",
|
|
759
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)));
|
|
760
|
+
xmlSecTransformDestroy(transform);
|
|
761
|
+
return(-1);
|
|
762
|
+
}
|
|
763
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
if(cur != NULL) {
|
|
767
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
768
|
+
NULL,
|
|
769
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
770
|
+
XMLSEC_ERRORS_R_UNEXPECTED_NODE,
|
|
771
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
772
|
+
return(-1);
|
|
773
|
+
}
|
|
774
|
+
return(0);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* xmlSecTransformCtxSetUri:
|
|
779
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
780
|
+
* @uri: the URI.
|
|
781
|
+
* @hereNode: the pointer to "here" node required by some
|
|
782
|
+
* XML transforms (may be NULL).
|
|
783
|
+
*
|
|
784
|
+
* Parses uri and adds xpointer transforms if required.
|
|
785
|
+
*
|
|
786
|
+
* The following examples demonstrate what the URI attribute identifies and
|
|
787
|
+
* how it is dereferenced
|
|
788
|
+
* (http://www.w3.org/TR/xmldsig-core/#sec-ReferenceProcessingModel):
|
|
789
|
+
*
|
|
790
|
+
* - URI="http://example.com/bar.xml"
|
|
791
|
+
* identifies the octets that represent the external resource
|
|
792
|
+
* 'http://example.com/bar.xml', that is probably an XML document given
|
|
793
|
+
* its file extension.
|
|
794
|
+
*
|
|
795
|
+
* - URI="http://example.com/bar.xml#chapter1"
|
|
796
|
+
* identifies the element with ID attribute value 'chapter1' of the
|
|
797
|
+
* external XML resource 'http://example.com/bar.xml', provided as an
|
|
798
|
+
* octet stream. Again, for the sake of interoperability, the element
|
|
799
|
+
* identified as 'chapter1' should be obtained using an XPath transform
|
|
800
|
+
* rather than a URI fragment (barename XPointer resolution in external
|
|
801
|
+
* resources is not REQUIRED in this specification).
|
|
802
|
+
*
|
|
803
|
+
* - URI=""
|
|
804
|
+
* identifies the node-set (minus any comment nodes) of the XML resource
|
|
805
|
+
* containing the signature
|
|
806
|
+
*
|
|
807
|
+
* - URI="#chapter1"
|
|
808
|
+
* identifies a node-set containing the element with ID attribute value
|
|
809
|
+
* 'chapter1' of the XML resource containing the signature. XML Signature
|
|
810
|
+
* (and its applications) modify this node-set to include the element plus
|
|
811
|
+
* all descendents including namespaces and attributes -- but not comments.
|
|
812
|
+
*
|
|
813
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
814
|
+
*/
|
|
815
|
+
int
|
|
816
|
+
xmlSecTransformCtxSetUri(xmlSecTransformCtxPtr ctx, const xmlChar* uri, xmlNodePtr hereNode) {
|
|
817
|
+
xmlSecNodeSetType nodeSetType = xmlSecNodeSetTree;
|
|
818
|
+
const xmlChar* xptr;
|
|
819
|
+
xmlChar* buf = NULL;
|
|
820
|
+
int useVisa3DHack = 0;
|
|
821
|
+
int ret;
|
|
822
|
+
|
|
823
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
824
|
+
xmlSecAssert2(ctx->uri == NULL, -1);
|
|
825
|
+
xmlSecAssert2(ctx->xptrExpr == NULL, -1);
|
|
826
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
827
|
+
xmlSecAssert2(hereNode != NULL, -1);
|
|
828
|
+
|
|
829
|
+
/* check uri */
|
|
830
|
+
if(xmlSecTransformUriTypeCheck(ctx->enabledUris, uri) != 1) {
|
|
831
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
832
|
+
NULL,
|
|
833
|
+
NULL,
|
|
834
|
+
XMLSEC_ERRORS_R_INVALID_URI_TYPE,
|
|
835
|
+
"uri=%s",
|
|
836
|
+
xmlSecErrorsSafeString(uri));
|
|
837
|
+
return(-1);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/* is it an empty uri? */
|
|
841
|
+
if((uri == NULL) || (xmlStrlen(uri) == 0)) {
|
|
842
|
+
return(0);
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/* do we have barename or full xpointer? */
|
|
846
|
+
xptr = xmlStrchr(uri, '#');
|
|
847
|
+
if(xptr == NULL){
|
|
848
|
+
ctx->uri = xmlStrdup(uri);
|
|
849
|
+
if(ctx->uri == NULL) {
|
|
850
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
851
|
+
NULL,
|
|
852
|
+
NULL,
|
|
853
|
+
XMLSEC_ERRORS_R_STRDUP_FAILED,
|
|
854
|
+
"size=%d", xmlStrlen(uri));
|
|
855
|
+
return(-1);
|
|
856
|
+
}
|
|
857
|
+
/* we are done */
|
|
858
|
+
return(0);
|
|
859
|
+
} else if(xmlStrcmp(uri, BAD_CAST "#xpointer(/)") == 0) {
|
|
860
|
+
ctx->xptrExpr = xmlStrdup(uri);
|
|
861
|
+
if(ctx->xptrExpr == NULL) {
|
|
862
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
863
|
+
NULL,
|
|
864
|
+
NULL,
|
|
865
|
+
XMLSEC_ERRORS_R_STRDUP_FAILED,
|
|
866
|
+
"size=%d", xmlStrlen(uri));
|
|
867
|
+
return(-1);
|
|
868
|
+
}
|
|
869
|
+
/* we are done */
|
|
870
|
+
return(0);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
ctx->uri = xmlStrndup(uri, xptr - uri);
|
|
874
|
+
if(ctx->uri == NULL) {
|
|
875
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
876
|
+
NULL,
|
|
877
|
+
NULL,
|
|
878
|
+
XMLSEC_ERRORS_R_STRDUP_FAILED,
|
|
879
|
+
"size=%d", xptr - uri);
|
|
880
|
+
return(-1);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
ctx->xptrExpr = xmlStrdup(xptr);
|
|
884
|
+
if(ctx->xptrExpr == NULL) {
|
|
885
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
886
|
+
NULL,
|
|
887
|
+
NULL,
|
|
888
|
+
XMLSEC_ERRORS_R_STRDUP_FAILED,
|
|
889
|
+
"size=%d", xmlStrlen(xptr));
|
|
890
|
+
return(-1);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/* do we have barename or full xpointer? */
|
|
894
|
+
xmlSecAssert2(xptr != NULL, -1);
|
|
895
|
+
if((xmlStrncmp(xptr, BAD_CAST "#xpointer(", 10) == 0) || (xmlStrncmp(xptr, BAD_CAST "#xmlns(", 7) == 0)) {
|
|
896
|
+
++xptr;
|
|
897
|
+
nodeSetType = xmlSecNodeSetTree;
|
|
898
|
+
} else if((ctx->flags & XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK) != 0) {
|
|
899
|
+
++xptr;
|
|
900
|
+
nodeSetType = xmlSecNodeSetTreeWithoutComments;
|
|
901
|
+
useVisa3DHack = 1;
|
|
902
|
+
} else {
|
|
903
|
+
static const char tmpl[] = "xpointer(id(\'%s\'))";
|
|
904
|
+
xmlSecSize size;
|
|
905
|
+
|
|
906
|
+
/* we need to add "xpointer(id('..')) because otherwise we have
|
|
907
|
+
* problems with numeric ("111" and so on) and other "strange" ids */
|
|
908
|
+
size = xmlStrlen(BAD_CAST tmpl) + xmlStrlen(xptr) + 2;
|
|
909
|
+
buf = (xmlChar*)xmlMalloc(size * sizeof(xmlChar));
|
|
910
|
+
if(buf == NULL) {
|
|
911
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
912
|
+
NULL,
|
|
913
|
+
NULL,
|
|
914
|
+
XMLSEC_ERRORS_R_MALLOC_FAILED,
|
|
915
|
+
"size=%d", size);
|
|
916
|
+
return(-1);
|
|
917
|
+
}
|
|
918
|
+
sprintf((char*)buf, tmpl, xptr + 1);
|
|
919
|
+
xptr = buf;
|
|
920
|
+
nodeSetType = xmlSecNodeSetTreeWithoutComments;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if(useVisa3DHack == 0) {
|
|
924
|
+
xmlSecTransformPtr transform;
|
|
925
|
+
|
|
926
|
+
/* we need to create XPonter transform to execute expr */
|
|
927
|
+
transform = xmlSecTransformCtxCreateAndPrepend(ctx, xmlSecTransformXPointerId);
|
|
928
|
+
if(!xmlSecTransformIsValid(transform)) {
|
|
929
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
930
|
+
NULL,
|
|
931
|
+
"xmlSecTransformCtxCreateAndPrepend",
|
|
932
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
933
|
+
"transform=%s",
|
|
934
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformXPointerId)));
|
|
935
|
+
return(-1);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
ret = xmlSecTransformXPointerSetExpr(transform, xptr, nodeSetType, hereNode);
|
|
939
|
+
if(ret < 0) {
|
|
940
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
941
|
+
NULL,
|
|
942
|
+
"xmlSecTransformXPointerSetExpr",
|
|
943
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
944
|
+
"name=%s",
|
|
945
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
946
|
+
if(buf != NULL) {
|
|
947
|
+
xmlFree(buf);
|
|
948
|
+
}
|
|
949
|
+
return(-1);
|
|
950
|
+
}
|
|
951
|
+
} else {
|
|
952
|
+
/* Visa3D protocol doesn't follow XML/XPointer/XMLDSig specs
|
|
953
|
+
* and allows invalid XPointer expressions (e.g. "#12345") in
|
|
954
|
+
* the URI attribute.
|
|
955
|
+
* Since we couldn't evaluate such expressions thru XPath/XPointer
|
|
956
|
+
* engine, we need to have this hack here
|
|
957
|
+
*/
|
|
958
|
+
xmlSecTransformPtr transform;
|
|
959
|
+
|
|
960
|
+
transform = xmlSecTransformCtxCreateAndPrepend(ctx, xmlSecTransformVisa3DHackId);
|
|
961
|
+
if(!xmlSecTransformIsValid(transform)) {
|
|
962
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
963
|
+
NULL,
|
|
964
|
+
"xmlSecTransformCtxCreateAndPrepend",
|
|
965
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
966
|
+
"transform=%s",
|
|
967
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformVisa3DHackId)));
|
|
968
|
+
return(-1);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
ret = xmlSecTransformVisa3DHackSetID(transform, xptr);
|
|
972
|
+
if(ret < 0) {
|
|
973
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
974
|
+
NULL,
|
|
975
|
+
"xmlSecTransformVisa3DHackSetID",
|
|
976
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
977
|
+
"name=%s",
|
|
978
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
979
|
+
if(buf != NULL) {
|
|
980
|
+
xmlFree(buf);
|
|
981
|
+
}
|
|
982
|
+
return(-1);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
if(buf != NULL) {
|
|
986
|
+
xmlFree(buf);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
return(0);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* xmlSecTransformCtxPrepare:
|
|
994
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
995
|
+
* @inputDataType: the expected input type.
|
|
996
|
+
*
|
|
997
|
+
* Prepares the transform context for processing data of @inputDataType.
|
|
998
|
+
*
|
|
999
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1000
|
+
*/
|
|
1001
|
+
int
|
|
1002
|
+
xmlSecTransformCtxPrepare(xmlSecTransformCtxPtr ctx, xmlSecTransformDataType inputDataType) {
|
|
1003
|
+
xmlSecTransformDataType firstType;
|
|
1004
|
+
xmlSecTransformPtr transform;
|
|
1005
|
+
int ret;
|
|
1006
|
+
|
|
1007
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1008
|
+
xmlSecAssert2(ctx->result == NULL, -1);
|
|
1009
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
1010
|
+
|
|
1011
|
+
/* add binary buffer to store result */
|
|
1012
|
+
transform = xmlSecTransformCtxCreateAndAppend(ctx, xmlSecTransformMemBufId);
|
|
1013
|
+
if(!xmlSecTransformIsValid(transform)) {
|
|
1014
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1015
|
+
NULL,
|
|
1016
|
+
"xmlSecTransformCreate",
|
|
1017
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1018
|
+
"transform=%s",
|
|
1019
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformMemBufId)));
|
|
1020
|
+
return(-1);
|
|
1021
|
+
}
|
|
1022
|
+
ctx->result = xmlSecTransformMemBufGetBuffer(transform);
|
|
1023
|
+
if(ctx->result == NULL) {
|
|
1024
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1025
|
+
NULL,
|
|
1026
|
+
"xmlSecTransformMemBufGetBuffer",
|
|
1027
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1028
|
+
"transform=%s",
|
|
1029
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformMemBufId)));
|
|
1030
|
+
return(-1);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
firstType = xmlSecTransformGetDataType(ctx->first, xmlSecTransformModePush, ctx);
|
|
1034
|
+
if(((firstType & xmlSecTransformDataTypeBin) == 0) &&
|
|
1035
|
+
((inputDataType & xmlSecTransformDataTypeBin) != 0)) {
|
|
1036
|
+
|
|
1037
|
+
/* need to add parser transform */
|
|
1038
|
+
transform = xmlSecTransformCtxCreateAndPrepend(ctx, xmlSecTransformXmlParserId);
|
|
1039
|
+
if(transform == NULL) {
|
|
1040
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1041
|
+
NULL,
|
|
1042
|
+
"xmlSecTransformCtxCreateAndPrepend",
|
|
1043
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1044
|
+
"transform=%s",
|
|
1045
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformXmlParserId)));
|
|
1046
|
+
return(-1);
|
|
1047
|
+
}
|
|
1048
|
+
} else if(((firstType & xmlSecTransformDataTypeXml) == 0) &&
|
|
1049
|
+
((inputDataType & xmlSecTransformDataTypeXml) != 0)) {
|
|
1050
|
+
|
|
1051
|
+
/* need to add c14n transform */
|
|
1052
|
+
transform = xmlSecTransformCtxCreateAndPrepend(ctx, xmlSecTransformInclC14NId);
|
|
1053
|
+
if(transform == NULL) {
|
|
1054
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1055
|
+
NULL,
|
|
1056
|
+
"xmlSecTransformCtxCreateAndPrepend",
|
|
1057
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1058
|
+
"transform=%s",
|
|
1059
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformInclC14NId)));
|
|
1060
|
+
return(-1);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/* finally let application a chance to verify that it's ok to execte
|
|
1065
|
+
* this transforms chain */
|
|
1066
|
+
if(ctx->preExecCallback != NULL) {
|
|
1067
|
+
ret = (ctx->preExecCallback)(ctx);
|
|
1068
|
+
if(ret < 0) {
|
|
1069
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1070
|
+
NULL,
|
|
1071
|
+
"ctx->preExecCallback",
|
|
1072
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1073
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1074
|
+
return(-1);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
ctx->status = xmlSecTransformStatusWorking;
|
|
1079
|
+
return(0);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* xmlSecTransformCtxBinaryExecute:
|
|
1084
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
1085
|
+
* @data: the input binary data buffer.
|
|
1086
|
+
* @dataSize: the input data size.
|
|
1087
|
+
*
|
|
1088
|
+
* Processes binary data using transforms chain in the @ctx.
|
|
1089
|
+
*
|
|
1090
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1091
|
+
*/
|
|
1092
|
+
int
|
|
1093
|
+
xmlSecTransformCtxBinaryExecute(xmlSecTransformCtxPtr ctx,
|
|
1094
|
+
const xmlSecByte* data, xmlSecSize dataSize) {
|
|
1095
|
+
int ret;
|
|
1096
|
+
|
|
1097
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1098
|
+
xmlSecAssert2(ctx->result == NULL, -1);
|
|
1099
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
1100
|
+
xmlSecAssert2(data != NULL, -1);
|
|
1101
|
+
xmlSecAssert2(dataSize > 0, -1);
|
|
1102
|
+
|
|
1103
|
+
/* we should not have uri stored in ctx */
|
|
1104
|
+
xmlSecAssert2(ctx->uri == NULL, -1);
|
|
1105
|
+
|
|
1106
|
+
ret = xmlSecTransformCtxPrepare(ctx, xmlSecTransformDataTypeBin);
|
|
1107
|
+
if(ret < 0) {
|
|
1108
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1109
|
+
NULL,
|
|
1110
|
+
"xmlSecTransformCtxPrepare",
|
|
1111
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1112
|
+
"type=bin");
|
|
1113
|
+
return(-1);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
ret = xmlSecTransformPushBin(ctx->first, data, dataSize, 1, ctx);
|
|
1117
|
+
if(ret < 0) {
|
|
1118
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1119
|
+
NULL,
|
|
1120
|
+
"xmlSecTransformCtxPushBin",
|
|
1121
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1122
|
+
"dataSize=%d", dataSize);
|
|
1123
|
+
return(-1);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
ctx->status = xmlSecTransformStatusFinished;
|
|
1127
|
+
return(0);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* xmlSecTransformCtxUriExecute:
|
|
1132
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
1133
|
+
* @uri: the URI.
|
|
1134
|
+
*
|
|
1135
|
+
* Process binary data from the URI using transforms chain in @ctx.
|
|
1136
|
+
*
|
|
1137
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1138
|
+
*/
|
|
1139
|
+
int
|
|
1140
|
+
xmlSecTransformCtxUriExecute(xmlSecTransformCtxPtr ctx, const xmlChar* uri) {
|
|
1141
|
+
xmlSecTransformPtr uriTransform;
|
|
1142
|
+
int ret;
|
|
1143
|
+
|
|
1144
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1145
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
1146
|
+
xmlSecAssert2(uri != NULL, -1);
|
|
1147
|
+
|
|
1148
|
+
/* we should not execute transform for a different uri */
|
|
1149
|
+
xmlSecAssert2((ctx->uri == NULL) || (uri == ctx->uri) || xmlStrEqual(uri, ctx->uri), -1);
|
|
1150
|
+
|
|
1151
|
+
uriTransform = xmlSecTransformCtxCreateAndPrepend(ctx, xmlSecTransformInputURIId);
|
|
1152
|
+
if(uriTransform == NULL) {
|
|
1153
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1154
|
+
NULL,
|
|
1155
|
+
"xmlSecTransformCtxCreateAndPrepend",
|
|
1156
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1157
|
+
"transform=%s",
|
|
1158
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecTransformInputURIId)));
|
|
1159
|
+
return(-1);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
ret = xmlSecTransformInputURIOpen(uriTransform, uri);
|
|
1163
|
+
if(ret < 0) {
|
|
1164
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1165
|
+
NULL,
|
|
1166
|
+
"xmlSecTransformInputURIOpen",
|
|
1167
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1168
|
+
"uri=%s",
|
|
1169
|
+
xmlSecErrorsSafeString(uri));
|
|
1170
|
+
return(-1);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/* we do not need to do something special for this transform */
|
|
1174
|
+
ret = xmlSecTransformCtxPrepare(ctx, xmlSecTransformDataTypeUnknown);
|
|
1175
|
+
if(ret < 0) {
|
|
1176
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1177
|
+
NULL,
|
|
1178
|
+
"xmlSecTransformCtxPrepare",
|
|
1179
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1180
|
+
"type=bin");
|
|
1181
|
+
return(-1);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
/* Now we have a choice: we either can push from first transform or pop
|
|
1185
|
+
* from last. Our C14N transforms prefers push, so push data!
|
|
1186
|
+
*/
|
|
1187
|
+
ret = xmlSecTransformPump(uriTransform, uriTransform->next, ctx);
|
|
1188
|
+
if(ret < 0) {
|
|
1189
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1190
|
+
NULL,
|
|
1191
|
+
"xmlSecTransformPump",
|
|
1192
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1193
|
+
"uri=%s",
|
|
1194
|
+
xmlSecErrorsSafeString(uri));
|
|
1195
|
+
return(-1);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
ctx->status = xmlSecTransformStatusFinished;
|
|
1199
|
+
return(0);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* xmlSecTransformCtxXmlExecute:
|
|
1204
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
1205
|
+
* @nodes: the input node set.
|
|
1206
|
+
*
|
|
1207
|
+
* Process @nodes using transforms in the transforms chain in @ctx.
|
|
1208
|
+
*
|
|
1209
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1210
|
+
*/
|
|
1211
|
+
int
|
|
1212
|
+
xmlSecTransformCtxXmlExecute(xmlSecTransformCtxPtr ctx, xmlSecNodeSetPtr nodes) {
|
|
1213
|
+
int ret;
|
|
1214
|
+
|
|
1215
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1216
|
+
xmlSecAssert2(ctx->result == NULL, -1);
|
|
1217
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
1218
|
+
xmlSecAssert2(nodes != NULL, -1);
|
|
1219
|
+
|
|
1220
|
+
xmlSecAssert2((ctx->uri == NULL) || (xmlStrlen(ctx->uri) == 0), -1);
|
|
1221
|
+
|
|
1222
|
+
ret = xmlSecTransformCtxPrepare(ctx, xmlSecTransformDataTypeXml);
|
|
1223
|
+
if(ret < 0) {
|
|
1224
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1225
|
+
NULL,
|
|
1226
|
+
"xmlSecTransformCtxPrepare",
|
|
1227
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1228
|
+
"type=xml");
|
|
1229
|
+
return(-1);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/* it's better to do push than pop because all XML transform
|
|
1233
|
+
* just don't care and c14n likes push more than pop */
|
|
1234
|
+
ret = xmlSecTransformPushXml(ctx->first, nodes, ctx);
|
|
1235
|
+
if(ret < 0) {
|
|
1236
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1237
|
+
NULL,
|
|
1238
|
+
"xmlSecTransformPushXml",
|
|
1239
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1240
|
+
"transform=%s",
|
|
1241
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(ctx->first)));
|
|
1242
|
+
return(-1);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
ctx->status = xmlSecTransformStatusFinished;
|
|
1246
|
+
return(0);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* xmlSecTransformCtxExecute:
|
|
1251
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
1252
|
+
* @doc: the pointer to input document.
|
|
1253
|
+
*
|
|
1254
|
+
* Executes transforms chain in @ctx.
|
|
1255
|
+
*
|
|
1256
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1257
|
+
*/
|
|
1258
|
+
int
|
|
1259
|
+
xmlSecTransformCtxExecute(xmlSecTransformCtxPtr ctx, xmlDocPtr doc) {
|
|
1260
|
+
int ret;
|
|
1261
|
+
|
|
1262
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1263
|
+
xmlSecAssert2(ctx->result == NULL, -1);
|
|
1264
|
+
xmlSecAssert2(ctx->status == xmlSecTransformStatusNone, -1);
|
|
1265
|
+
xmlSecAssert2(doc != NULL, -1);
|
|
1266
|
+
|
|
1267
|
+
if((ctx->uri == NULL) || (xmlStrlen(ctx->uri) == 0)) {
|
|
1268
|
+
xmlSecNodeSetPtr nodes;
|
|
1269
|
+
|
|
1270
|
+
if((ctx->xptrExpr != NULL) && (xmlStrlen(ctx->xptrExpr) > 0)){
|
|
1271
|
+
/* our xpointer transform takes care of providing correct nodes set */
|
|
1272
|
+
nodes = xmlSecNodeSetCreate(doc, NULL, xmlSecNodeSetNormal);
|
|
1273
|
+
if(nodes == NULL) {
|
|
1274
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1275
|
+
NULL,
|
|
1276
|
+
"xmlSecNodeSetCreate",
|
|
1277
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1278
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1279
|
+
return(-1);
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
} else {
|
|
1283
|
+
/* we do not want to have comments for empty URI */
|
|
1284
|
+
nodes = xmlSecNodeSetGetChildren(doc, NULL, 0, 0);
|
|
1285
|
+
if(nodes == NULL) {
|
|
1286
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1287
|
+
NULL,
|
|
1288
|
+
"xmlSecNodeSetGetChildren",
|
|
1289
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1290
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1291
|
+
return(-1);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
ret = xmlSecTransformCtxXmlExecute(ctx, nodes);
|
|
1295
|
+
if(ret < 0) {
|
|
1296
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1297
|
+
NULL,
|
|
1298
|
+
"xmlSecTransformCtxXmlExecute",
|
|
1299
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1300
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1301
|
+
xmlSecNodeSetDestroy(nodes);
|
|
1302
|
+
return(-1);
|
|
1303
|
+
}
|
|
1304
|
+
/* TODO: don't destroy nodes here */
|
|
1305
|
+
xmlSecNodeSetDestroy(nodes);
|
|
1306
|
+
} else {
|
|
1307
|
+
ret = xmlSecTransformCtxUriExecute(ctx, ctx->uri);
|
|
1308
|
+
if(ret < 0) {
|
|
1309
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1310
|
+
NULL,
|
|
1311
|
+
"xmlSecTransformCtxUriExecute",
|
|
1312
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1313
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1314
|
+
return(-1);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
return(0);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* xmlSecTransformCtxDebugDump:
|
|
1323
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
1324
|
+
* @output: the pointer to output FILE.
|
|
1325
|
+
*
|
|
1326
|
+
* Prints transforms context debug information to @output.
|
|
1327
|
+
*/
|
|
1328
|
+
void
|
|
1329
|
+
xmlSecTransformCtxDebugDump(xmlSecTransformCtxPtr ctx, FILE* output) {
|
|
1330
|
+
xmlSecTransformPtr transform;
|
|
1331
|
+
|
|
1332
|
+
xmlSecAssert(ctx != NULL);
|
|
1333
|
+
xmlSecAssert(output != NULL);
|
|
1334
|
+
|
|
1335
|
+
fprintf(output, "== TRANSFORMS CTX (status=%d)\n", ctx->status);
|
|
1336
|
+
|
|
1337
|
+
fprintf(output, "== flags: 0x%08x\n", ctx->flags);
|
|
1338
|
+
fprintf(output, "== flags2: 0x%08x\n", ctx->flags2);
|
|
1339
|
+
if(xmlSecPtrListGetSize(&(ctx->enabledTransforms)) > 0) {
|
|
1340
|
+
fprintf(output, "== enabled transforms: ");
|
|
1341
|
+
xmlSecTransformIdListDebugDump(&(ctx->enabledTransforms), output);
|
|
1342
|
+
} else {
|
|
1343
|
+
fprintf(output, "== enabled transforms: all\n");
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
fprintf(output, "=== uri: %s\n",
|
|
1347
|
+
(ctx->uri != NULL) ? ctx->uri : BAD_CAST "NULL");
|
|
1348
|
+
fprintf(output, "=== uri xpointer expr: %s\n",
|
|
1349
|
+
(ctx->xptrExpr != NULL) ? ctx->xptrExpr : BAD_CAST "NULL");
|
|
1350
|
+
for(transform = ctx->first; transform != NULL; transform = transform->next) {
|
|
1351
|
+
xmlSecTransformDebugDump(transform, output);
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* xmlSecTransformCtxDebugXmlDump:
|
|
1357
|
+
* @ctx: the pointer to transforms chain processing context.
|
|
1358
|
+
* @output: the pointer to output FILE.
|
|
1359
|
+
*
|
|
1360
|
+
* Prints transforms context debug information to @output in XML format.
|
|
1361
|
+
*/
|
|
1362
|
+
void
|
|
1363
|
+
xmlSecTransformCtxDebugXmlDump(xmlSecTransformCtxPtr ctx, FILE* output) {
|
|
1364
|
+
xmlSecTransformPtr transform;
|
|
1365
|
+
|
|
1366
|
+
xmlSecAssert(ctx != NULL);
|
|
1367
|
+
xmlSecAssert(output != NULL);
|
|
1368
|
+
|
|
1369
|
+
fprintf(output, "<TransformCtx status=\"%d\">\n", ctx->status);
|
|
1370
|
+
|
|
1371
|
+
fprintf(output, "<Flags>%08x</Flags>\n", ctx->flags);
|
|
1372
|
+
fprintf(output, "<Flags2>%08x</Flags2>\n", ctx->flags2);
|
|
1373
|
+
if(xmlSecPtrListGetSize(&(ctx->enabledTransforms)) > 0) {
|
|
1374
|
+
fprintf(output, "<EnabledTransforms>\n");
|
|
1375
|
+
xmlSecTransformIdListDebugXmlDump(&(ctx->enabledTransforms), output);
|
|
1376
|
+
fprintf(output, "</EnabledTransforms>\n");
|
|
1377
|
+
} else {
|
|
1378
|
+
fprintf(output, "<EnabledTransforms>all</EnabledTransforms>\n");
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
fprintf(output, "<Uri>");
|
|
1383
|
+
xmlSecPrintXmlString(output, ctx->uri);
|
|
1384
|
+
fprintf(output, "</Uri>\n");
|
|
1385
|
+
|
|
1386
|
+
fprintf(output, "<UriXPointer>");
|
|
1387
|
+
xmlSecPrintXmlString(output, ctx->xptrExpr);
|
|
1388
|
+
fprintf(output, "</UriXPointer>\n");
|
|
1389
|
+
|
|
1390
|
+
for(transform = ctx->first; transform != NULL; transform = transform->next) {
|
|
1391
|
+
xmlSecTransformDebugXmlDump(transform, output);
|
|
1392
|
+
}
|
|
1393
|
+
fprintf(output, "</TransformCtx>\n");
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
/**************************************************************************
|
|
1397
|
+
*
|
|
1398
|
+
* xmlSecTransform
|
|
1399
|
+
*
|
|
1400
|
+
*************************************************************************/
|
|
1401
|
+
/**
|
|
1402
|
+
* xmlSecTransformCreate:
|
|
1403
|
+
* @id: the transform id to create.
|
|
1404
|
+
*
|
|
1405
|
+
* Creates new transform of the @id klass. The caller is responsible for
|
|
1406
|
+
* destroying returned tansform using #xmlSecTransformDestroy function.
|
|
1407
|
+
*
|
|
1408
|
+
* Returns: pointer to newly created transform or NULL if an error occurs.
|
|
1409
|
+
*/
|
|
1410
|
+
xmlSecTransformPtr
|
|
1411
|
+
xmlSecTransformCreate(xmlSecTransformId id) {
|
|
1412
|
+
xmlSecTransformPtr transform;
|
|
1413
|
+
int ret;
|
|
1414
|
+
|
|
1415
|
+
xmlSecAssert2(id != NULL, NULL);
|
|
1416
|
+
xmlSecAssert2(id->klassSize >= sizeof(xmlSecTransformKlass), NULL);
|
|
1417
|
+
xmlSecAssert2(id->objSize >= sizeof(xmlSecTransform), NULL);
|
|
1418
|
+
xmlSecAssert2(id->name != NULL, NULL);
|
|
1419
|
+
|
|
1420
|
+
/* Allocate a new xmlSecTransform and fill the fields. */
|
|
1421
|
+
transform = (xmlSecTransformPtr)xmlMalloc(id->objSize);
|
|
1422
|
+
if(transform == NULL) {
|
|
1423
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1424
|
+
NULL,
|
|
1425
|
+
NULL,
|
|
1426
|
+
XMLSEC_ERRORS_R_MALLOC_FAILED,
|
|
1427
|
+
"size=%d", id->objSize);
|
|
1428
|
+
return(NULL);
|
|
1429
|
+
}
|
|
1430
|
+
memset(transform, 0, id->objSize);
|
|
1431
|
+
transform->id = id;
|
|
1432
|
+
|
|
1433
|
+
if(id->initialize != NULL) {
|
|
1434
|
+
ret = (id->initialize)(transform);
|
|
1435
|
+
if(ret < 0) {
|
|
1436
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1437
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
1438
|
+
"id->initialize",
|
|
1439
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1440
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1441
|
+
xmlSecTransformDestroy(transform);
|
|
1442
|
+
return(NULL);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
ret = xmlSecBufferInitialize(&(transform->inBuf), 0);
|
|
1447
|
+
if(ret < 0) {
|
|
1448
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1449
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
1450
|
+
"xmlSecBufferInitialize",
|
|
1451
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1452
|
+
"size=%d", 0);
|
|
1453
|
+
xmlSecTransformDestroy(transform);
|
|
1454
|
+
return(NULL);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
ret = xmlSecBufferInitialize(&(transform->outBuf), 0);
|
|
1458
|
+
if(ret < 0) {
|
|
1459
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1460
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
1461
|
+
"xmlSecBufferInitialize",
|
|
1462
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1463
|
+
"size=%d", 0);
|
|
1464
|
+
xmlSecTransformDestroy(transform);
|
|
1465
|
+
return(NULL);
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
return(transform);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* xmlSecTransformDestroy:
|
|
1473
|
+
* @transform: the pointer to transform.
|
|
1474
|
+
*
|
|
1475
|
+
* Destroys transform created with #xmlSecTransformCreate function.
|
|
1476
|
+
*/
|
|
1477
|
+
void
|
|
1478
|
+
xmlSecTransformDestroy(xmlSecTransformPtr transform) {
|
|
1479
|
+
xmlSecAssert(xmlSecTransformIsValid(transform));
|
|
1480
|
+
xmlSecAssert(transform->id->objSize > 0);
|
|
1481
|
+
|
|
1482
|
+
/* first need to remove ourselves from chain */
|
|
1483
|
+
xmlSecTransformRemove(transform);
|
|
1484
|
+
|
|
1485
|
+
xmlSecBufferFinalize(&(transform->inBuf));
|
|
1486
|
+
xmlSecBufferFinalize(&(transform->outBuf));
|
|
1487
|
+
|
|
1488
|
+
/* we never destroy input nodes, output nodes
|
|
1489
|
+
* are destroyed if and only if they are different
|
|
1490
|
+
* from input nodes
|
|
1491
|
+
*/
|
|
1492
|
+
if((transform->outNodes != NULL) && (transform->outNodes != transform->inNodes)) {
|
|
1493
|
+
xmlSecNodeSetDestroy(transform->outNodes);
|
|
1494
|
+
}
|
|
1495
|
+
if(transform->id->finalize != NULL) {
|
|
1496
|
+
(transform->id->finalize)(transform);
|
|
1497
|
+
}
|
|
1498
|
+
memset(transform, 0, transform->id->objSize);
|
|
1499
|
+
xmlFree(transform);
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* xmlSecTransformNodeRead:
|
|
1504
|
+
* @node: the pointer to the transform's node.
|
|
1505
|
+
* @usage: the transform usage (signature, encryption, ...).
|
|
1506
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1507
|
+
*
|
|
1508
|
+
* Reads transform from the @node as follows:
|
|
1509
|
+
*
|
|
1510
|
+
* 1) reads "Algorithm" attribute;
|
|
1511
|
+
*
|
|
1512
|
+
* 2) checks the lists of known and allowed transforms;
|
|
1513
|
+
*
|
|
1514
|
+
* 3) calls transform's create method;
|
|
1515
|
+
*
|
|
1516
|
+
* 4) calls transform's read transform node method.
|
|
1517
|
+
*
|
|
1518
|
+
* Returns: pointer to newly created transform or NULL if an error occurs.
|
|
1519
|
+
*/
|
|
1520
|
+
xmlSecTransformPtr
|
|
1521
|
+
xmlSecTransformNodeRead(xmlNodePtr node, xmlSecTransformUsage usage, xmlSecTransformCtxPtr transformCtx) {
|
|
1522
|
+
xmlSecTransformPtr transform;
|
|
1523
|
+
xmlSecTransformId id;
|
|
1524
|
+
xmlChar *href;
|
|
1525
|
+
int ret;
|
|
1526
|
+
|
|
1527
|
+
xmlSecAssert2(node != NULL, NULL);
|
|
1528
|
+
xmlSecAssert2(transformCtx != NULL, NULL);
|
|
1529
|
+
|
|
1530
|
+
href = xmlGetProp(node, xmlSecAttrAlgorithm);
|
|
1531
|
+
if(href == NULL) {
|
|
1532
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1533
|
+
NULL,
|
|
1534
|
+
xmlSecErrorsSafeString(xmlSecAttrAlgorithm),
|
|
1535
|
+
XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE,
|
|
1536
|
+
"node=%s",
|
|
1537
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(node)));
|
|
1538
|
+
return(NULL);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
id = xmlSecTransformIdListFindByHref(xmlSecTransformIdsGet(), href, usage);
|
|
1542
|
+
if(id == xmlSecTransformIdUnknown) {
|
|
1543
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1544
|
+
NULL,
|
|
1545
|
+
"xmlSecTransformIdListFindByHref",
|
|
1546
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1547
|
+
"href=%s",
|
|
1548
|
+
xmlSecErrorsSafeString(href));
|
|
1549
|
+
xmlFree(href);
|
|
1550
|
+
return(NULL);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
/* check with enabled transforms list */
|
|
1554
|
+
if((xmlSecPtrListGetSize(&(transformCtx->enabledTransforms)) > 0) &&
|
|
1555
|
+
(xmlSecTransformIdListFind(&(transformCtx->enabledTransforms), id) != 1)) {
|
|
1556
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1557
|
+
NULL,
|
|
1558
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(id)),
|
|
1559
|
+
XMLSEC_ERRORS_R_TRANSFORM_DISABLED,
|
|
1560
|
+
"href=%s",
|
|
1561
|
+
xmlSecErrorsSafeString(href));
|
|
1562
|
+
xmlFree(href);
|
|
1563
|
+
return(NULL);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
transform = xmlSecTransformCreate(id);
|
|
1567
|
+
if(!xmlSecTransformIsValid(transform)) {
|
|
1568
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1569
|
+
NULL,
|
|
1570
|
+
"xmlSecTransformCreate",
|
|
1571
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1572
|
+
"transform=%s",
|
|
1573
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(id)));
|
|
1574
|
+
xmlFree(href);
|
|
1575
|
+
return(NULL);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
if(transform->id->readNode != NULL) {
|
|
1579
|
+
ret = transform->id->readNode(transform, node, transformCtx);
|
|
1580
|
+
if(ret < 0) {
|
|
1581
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1582
|
+
NULL,
|
|
1583
|
+
"id->readNode",
|
|
1584
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1585
|
+
"transform=%s",
|
|
1586
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)));
|
|
1587
|
+
xmlSecTransformDestroy(transform);
|
|
1588
|
+
xmlFree(href);
|
|
1589
|
+
return(NULL);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/* finally remember the transform node */
|
|
1594
|
+
transform->hereNode = node;
|
|
1595
|
+
xmlFree(href);
|
|
1596
|
+
return(transform);
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* xmlSecTransformPump:
|
|
1601
|
+
* @left: the source pumping transform.
|
|
1602
|
+
* @right: the destination pumping transform.
|
|
1603
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1604
|
+
*
|
|
1605
|
+
* Pops data from @left transform and pushes to @right transform until
|
|
1606
|
+
* no more data is available.
|
|
1607
|
+
*
|
|
1608
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1609
|
+
*/
|
|
1610
|
+
int
|
|
1611
|
+
xmlSecTransformPump(xmlSecTransformPtr left, xmlSecTransformPtr right, xmlSecTransformCtxPtr transformCtx) {
|
|
1612
|
+
xmlSecTransformDataType leftType;
|
|
1613
|
+
xmlSecTransformDataType rightType;
|
|
1614
|
+
int ret;
|
|
1615
|
+
|
|
1616
|
+
xmlSecAssert2(xmlSecTransformIsValid(left), -1);
|
|
1617
|
+
xmlSecAssert2(xmlSecTransformIsValid(right), -1);
|
|
1618
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1619
|
+
|
|
1620
|
+
leftType = xmlSecTransformGetDataType(left, xmlSecTransformModePop, transformCtx);
|
|
1621
|
+
rightType = xmlSecTransformGetDataType(right, xmlSecTransformModePush, transformCtx);
|
|
1622
|
+
|
|
1623
|
+
if(((leftType & xmlSecTransformDataTypeXml) != 0) &&
|
|
1624
|
+
((rightType & xmlSecTransformDataTypeXml) != 0)) {
|
|
1625
|
+
|
|
1626
|
+
xmlSecNodeSetPtr nodes = NULL;
|
|
1627
|
+
|
|
1628
|
+
ret = xmlSecTransformPopXml(left, &nodes, transformCtx);
|
|
1629
|
+
if(ret < 0) {
|
|
1630
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1631
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(left)),
|
|
1632
|
+
"xmlSecTransformPopXml",
|
|
1633
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1634
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1635
|
+
return(-1);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
ret = xmlSecTransformPushXml(right, nodes, transformCtx);
|
|
1639
|
+
if(ret < 0) {
|
|
1640
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1641
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(right)),
|
|
1642
|
+
"xmlSecTransformPushXml",
|
|
1643
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1644
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1645
|
+
return(-1);
|
|
1646
|
+
}
|
|
1647
|
+
} else if(((leftType & xmlSecTransformDataTypeBin) != 0) &&
|
|
1648
|
+
((rightType & xmlSecTransformDataTypeBin) != 0)) {
|
|
1649
|
+
xmlSecByte buf[XMLSEC_TRANSFORM_BINARY_CHUNK];
|
|
1650
|
+
xmlSecSize bufSize;
|
|
1651
|
+
int final;
|
|
1652
|
+
|
|
1653
|
+
do {
|
|
1654
|
+
ret = xmlSecTransformPopBin(left, buf, sizeof(buf), &bufSize, transformCtx);
|
|
1655
|
+
if(ret < 0) {
|
|
1656
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1657
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(left)),
|
|
1658
|
+
"xmlSecTransformPopBin",
|
|
1659
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1660
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1661
|
+
return(-1);
|
|
1662
|
+
}
|
|
1663
|
+
final = (bufSize == 0) ? 1 : 0;
|
|
1664
|
+
ret = xmlSecTransformPushBin(right, buf, bufSize, final, transformCtx);
|
|
1665
|
+
if(ret < 0) {
|
|
1666
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1667
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(right)),
|
|
1668
|
+
"xmlSecTransformPushBin",
|
|
1669
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1670
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1671
|
+
return(-1);
|
|
1672
|
+
}
|
|
1673
|
+
} while(final == 0);
|
|
1674
|
+
} else {
|
|
1675
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1676
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(left)),
|
|
1677
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(right)),
|
|
1678
|
+
XMLSEC_ERRORS_R_INVALID_TRANSFORM,
|
|
1679
|
+
"transforms input/output data formats do not match");
|
|
1680
|
+
}
|
|
1681
|
+
return(0);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* xmlSecTransformSetKey:
|
|
1687
|
+
* @transform: the pointer to transform.
|
|
1688
|
+
* @key: the pointer to key.
|
|
1689
|
+
*
|
|
1690
|
+
* Sets the transform's key.
|
|
1691
|
+
*
|
|
1692
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1693
|
+
*/
|
|
1694
|
+
int
|
|
1695
|
+
xmlSecTransformSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) {
|
|
1696
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1697
|
+
xmlSecAssert2(key != NULL, -1);
|
|
1698
|
+
|
|
1699
|
+
if(transform->id->setKey != NULL) {
|
|
1700
|
+
return((transform->id->setKey)(transform, key));
|
|
1701
|
+
}
|
|
1702
|
+
return(0);
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* xmlSecTransformSetKeyReq:
|
|
1707
|
+
* @transform: the pointer to transform.
|
|
1708
|
+
* @keyReq: the pointer to keys requirements object.
|
|
1709
|
+
*
|
|
1710
|
+
* Sets the key requirements for @transform in the @keyReq.
|
|
1711
|
+
*
|
|
1712
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
1713
|
+
*/
|
|
1714
|
+
int
|
|
1715
|
+
xmlSecTransformSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) {
|
|
1716
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1717
|
+
xmlSecAssert2(keyReq != NULL, -1);
|
|
1718
|
+
|
|
1719
|
+
keyReq->keyId = xmlSecKeyDataIdUnknown;
|
|
1720
|
+
keyReq->keyType = xmlSecKeyDataTypeUnknown;
|
|
1721
|
+
keyReq->keyUsage = xmlSecKeyUsageAny;
|
|
1722
|
+
keyReq->keyBitsSize = 0;
|
|
1723
|
+
|
|
1724
|
+
if(transform->id->setKeyReq != NULL) {
|
|
1725
|
+
return((transform->id->setKeyReq)(transform, keyReq));
|
|
1726
|
+
}
|
|
1727
|
+
return(0);
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* xmlSecTransformVerify:
|
|
1732
|
+
* @transform: the pointer to transform.
|
|
1733
|
+
* @data: the binary data for verification.
|
|
1734
|
+
* @dataSize: the data size.
|
|
1735
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1736
|
+
*
|
|
1737
|
+
* Verifies the data with transform's processing results
|
|
1738
|
+
* (for digest, HMAC and signature transforms). The verification
|
|
1739
|
+
* result is stored in the #status member of #xmlSecTransform object.
|
|
1740
|
+
*
|
|
1741
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1742
|
+
*/
|
|
1743
|
+
int
|
|
1744
|
+
xmlSecTransformVerify(xmlSecTransformPtr transform, const xmlSecByte* data,
|
|
1745
|
+
xmlSecSize dataSize, xmlSecTransformCtxPtr transformCtx) {
|
|
1746
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1747
|
+
xmlSecAssert2(transform->id->verify != NULL, -1);
|
|
1748
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1749
|
+
|
|
1750
|
+
return((transform->id->verify)(transform, data, dataSize, transformCtx));
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* xmlSecTransformVerifyNodeContent:
|
|
1755
|
+
* @transform: the pointer to transform.
|
|
1756
|
+
* @node: the pointer to node.
|
|
1757
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1758
|
+
*
|
|
1759
|
+
* Gets the @node content, base64 decodes it and calls #xmlSecTransformVerify
|
|
1760
|
+
* function to verify binary results.
|
|
1761
|
+
*
|
|
1762
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1763
|
+
*/
|
|
1764
|
+
int
|
|
1765
|
+
xmlSecTransformVerifyNodeContent(xmlSecTransformPtr transform, xmlNodePtr node,
|
|
1766
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
1767
|
+
xmlSecBuffer buffer;
|
|
1768
|
+
int ret;
|
|
1769
|
+
|
|
1770
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1771
|
+
xmlSecAssert2(node != NULL, -1);
|
|
1772
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1773
|
+
|
|
1774
|
+
ret = xmlSecBufferInitialize(&buffer, 0);
|
|
1775
|
+
if(ret < 0) {
|
|
1776
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1777
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
1778
|
+
"xmlSecBufferInitialize",
|
|
1779
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1780
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1781
|
+
return(-1);
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
ret = xmlSecBufferBase64NodeContentRead(&buffer, node);
|
|
1785
|
+
if((ret < 0) || (xmlSecBufferGetData(&buffer) == NULL)) {
|
|
1786
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1787
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
1788
|
+
"xmlSecBufferBase64NodeContentRead",
|
|
1789
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1790
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1791
|
+
xmlSecBufferFinalize(&buffer);
|
|
1792
|
+
return(-1);
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
ret = xmlSecTransformVerify(transform, xmlSecBufferGetData(&buffer),
|
|
1796
|
+
xmlSecBufferGetSize(&buffer), transformCtx);
|
|
1797
|
+
if(ret < 0) {
|
|
1798
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1799
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
1800
|
+
"xmlSecTransformVerify",
|
|
1801
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1802
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1803
|
+
xmlSecBufferFinalize(&buffer);
|
|
1804
|
+
return(-1);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
xmlSecBufferFinalize(&buffer);
|
|
1808
|
+
return(0);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
/**
|
|
1812
|
+
* xmlSecTransformGetDataType:
|
|
1813
|
+
* @transform: the pointer to transform.
|
|
1814
|
+
* @mode: the data mode (push or pop).
|
|
1815
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1816
|
+
*
|
|
1817
|
+
* Gets transform input (@mode is "push") or output (@mode is "pop") data
|
|
1818
|
+
* type (binary or XML).
|
|
1819
|
+
*
|
|
1820
|
+
* Returns: the transform's data type for the @mode operation.
|
|
1821
|
+
*/
|
|
1822
|
+
xmlSecTransformDataType
|
|
1823
|
+
xmlSecTransformGetDataType(xmlSecTransformPtr transform, xmlSecTransformMode mode,
|
|
1824
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
1825
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), xmlSecTransformDataTypeUnknown);
|
|
1826
|
+
xmlSecAssert2(transform->id->getDataType != NULL, xmlSecTransformDataTypeUnknown);
|
|
1827
|
+
|
|
1828
|
+
return((transform->id->getDataType)(transform, mode, transformCtx));
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
/**
|
|
1832
|
+
* xmlSecTransformPushBin:
|
|
1833
|
+
* @transform: the pointer to transform object.
|
|
1834
|
+
* @data: the input binary data,
|
|
1835
|
+
* @dataSize: the input data size.
|
|
1836
|
+
* @final: the flag: if set to 1 then it's the last
|
|
1837
|
+
* data chunk.
|
|
1838
|
+
* @transformCtx: the pointer to transform context object.
|
|
1839
|
+
*
|
|
1840
|
+
* Process binary @data and pushes results to next transform.
|
|
1841
|
+
*
|
|
1842
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1843
|
+
*/
|
|
1844
|
+
int
|
|
1845
|
+
xmlSecTransformPushBin(xmlSecTransformPtr transform, const xmlSecByte* data,
|
|
1846
|
+
xmlSecSize dataSize, int final, xmlSecTransformCtxPtr transformCtx) {
|
|
1847
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1848
|
+
xmlSecAssert2(transform->id->pushBin != NULL, -1);
|
|
1849
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1850
|
+
|
|
1851
|
+
return((transform->id->pushBin)(transform, data, dataSize, final, transformCtx));
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* xmlSecTransformPopBin:
|
|
1856
|
+
* @transform: the pointer to transform object.
|
|
1857
|
+
* @data: the buffer to store result data.
|
|
1858
|
+
* @maxDataSize: the size of the buffer #data.
|
|
1859
|
+
* @dataSize: the pointer to returned data size.
|
|
1860
|
+
* @transformCtx: the pointer to transform context object.
|
|
1861
|
+
*
|
|
1862
|
+
* Pops data from previous transform in the chain, processes data and
|
|
1863
|
+
* returns result in the @data buffer. The size of returned data is
|
|
1864
|
+
* placed in the @dataSize.
|
|
1865
|
+
*
|
|
1866
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1867
|
+
*/
|
|
1868
|
+
int
|
|
1869
|
+
xmlSecTransformPopBin(xmlSecTransformPtr transform, xmlSecByte* data,
|
|
1870
|
+
xmlSecSize maxDataSize, xmlSecSize* dataSize, xmlSecTransformCtxPtr transformCtx) {
|
|
1871
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1872
|
+
xmlSecAssert2(transform->id->popBin != NULL, -1);
|
|
1873
|
+
xmlSecAssert2(data != NULL, -1);
|
|
1874
|
+
xmlSecAssert2(dataSize != NULL, -1);
|
|
1875
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1876
|
+
|
|
1877
|
+
return((transform->id->popBin)(transform, data, maxDataSize, dataSize, transformCtx));
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* xmlSecTransformPushXml:
|
|
1882
|
+
* @transform: the pointer to transform object.
|
|
1883
|
+
* @nodes: the input nodes.
|
|
1884
|
+
* @transformCtx: the pointer to transform context object.
|
|
1885
|
+
*
|
|
1886
|
+
* Processes @nodes and pushes result to the next transform in the chain.
|
|
1887
|
+
*
|
|
1888
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1889
|
+
*/
|
|
1890
|
+
int
|
|
1891
|
+
xmlSecTransformPushXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr nodes,
|
|
1892
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
1893
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1894
|
+
xmlSecAssert2(transform->id->pushXml != NULL, -1);
|
|
1895
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1896
|
+
|
|
1897
|
+
return((transform->id->pushXml)(transform, nodes, transformCtx));
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
/**
|
|
1901
|
+
* xmlSecTransformPopXml:
|
|
1902
|
+
* @transform: the pointer to transform object.
|
|
1903
|
+
* @nodes: the pointer to store popinter to result nodes.
|
|
1904
|
+
* @transformCtx: the pointer to transform context object.
|
|
1905
|
+
*
|
|
1906
|
+
* Pops data from previous transform in the chain, processes the data and
|
|
1907
|
+
* returns result in @nodes.
|
|
1908
|
+
*
|
|
1909
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1910
|
+
*/
|
|
1911
|
+
int
|
|
1912
|
+
xmlSecTransformPopXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr* nodes,
|
|
1913
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
1914
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1915
|
+
xmlSecAssert2(transform->id->popXml != NULL, -1);
|
|
1916
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1917
|
+
|
|
1918
|
+
return((transform->id->popXml)(transform, nodes, transformCtx));
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* xmlSecTransformExecute:
|
|
1923
|
+
* @transform: the pointer to transform.
|
|
1924
|
+
* @last: the flag: if set to 1 then it's the last data chunk.
|
|
1925
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1926
|
+
*
|
|
1927
|
+
* Executes transform (used by default popBin/pushBin/popXml/pushXml methods).
|
|
1928
|
+
*
|
|
1929
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
1930
|
+
*/
|
|
1931
|
+
int
|
|
1932
|
+
xmlSecTransformExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) {
|
|
1933
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
1934
|
+
xmlSecAssert2(transform->id->execute != NULL, -1);
|
|
1935
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
1936
|
+
|
|
1937
|
+
return((transform->id->execute)(transform, last, transformCtx));
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* xmlSecTransformDebugDump:
|
|
1942
|
+
* @transform: the pointer to transform.
|
|
1943
|
+
* @output: the pointer to output FILE.
|
|
1944
|
+
*
|
|
1945
|
+
* Prints transform's debug information to @output.
|
|
1946
|
+
*/
|
|
1947
|
+
void
|
|
1948
|
+
xmlSecTransformDebugDump(xmlSecTransformPtr transform, FILE* output) {
|
|
1949
|
+
xmlSecAssert(xmlSecTransformIsValid(transform));
|
|
1950
|
+
xmlSecAssert(output != NULL);
|
|
1951
|
+
|
|
1952
|
+
fprintf(output, "=== Transform: %s (href=%s)\n",
|
|
1953
|
+
xmlSecErrorsSafeString(transform->id->name),
|
|
1954
|
+
xmlSecErrorsSafeString(transform->id->href));
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* xmlSecTransformDebugXmlDump:
|
|
1959
|
+
* @transform: the pointer to transform.
|
|
1960
|
+
* @output: the pointer to output FILE.
|
|
1961
|
+
*
|
|
1962
|
+
* Prints transform's debug information to @output in XML format.
|
|
1963
|
+
*/
|
|
1964
|
+
void
|
|
1965
|
+
xmlSecTransformDebugXmlDump(xmlSecTransformPtr transform, FILE* output) {
|
|
1966
|
+
xmlSecAssert(xmlSecTransformIsValid(transform));
|
|
1967
|
+
xmlSecAssert(output != NULL);
|
|
1968
|
+
|
|
1969
|
+
fprintf(output, "<Transform name=\"");
|
|
1970
|
+
xmlSecPrintXmlString(output,transform->id->name);
|
|
1971
|
+
fprintf(output, "\" href=\"");
|
|
1972
|
+
xmlSecPrintXmlString(output, transform->id->href);
|
|
1973
|
+
fprintf(output, "\" />\n");
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
/************************************************************************
|
|
1977
|
+
*
|
|
1978
|
+
* Operations on transforms chain
|
|
1979
|
+
*
|
|
1980
|
+
************************************************************************/
|
|
1981
|
+
/**
|
|
1982
|
+
* xmlSecTransformConnect:
|
|
1983
|
+
* @left: the pointer to left (prev) transform.
|
|
1984
|
+
* @right: the pointer to right (next) transform.
|
|
1985
|
+
* @transformCtx: the transform's chaing processing context.
|
|
1986
|
+
*
|
|
1987
|
+
* If the data object is a node-set and the next transform requires octets,
|
|
1988
|
+
* the signature application MUST attempt to convert the node-set to an octet
|
|
1989
|
+
* stream using Canonical XML [XML-C14N].
|
|
1990
|
+
*
|
|
1991
|
+
* The story is different if the right transform is base64 decode
|
|
1992
|
+
* (http://www.w3.org/TR/xmldsig-core/#sec-Base-64):
|
|
1993
|
+
*
|
|
1994
|
+
* This transform requires an octet stream for input. If an XPath node-set
|
|
1995
|
+
* (or sufficiently functional alternative) is given as input, then it is
|
|
1996
|
+
* converted to an octet stream by performing operations logically equivalent
|
|
1997
|
+
* to 1) applying an XPath transform with expression self::text(), then 2)
|
|
1998
|
+
* taking the string-value of the node-set. Thus, if an XML element is
|
|
1999
|
+
* identified by a barename XPointer in the Reference URI, and its content
|
|
2000
|
+
* consists solely of base64 encoded character data, then this transform
|
|
2001
|
+
* automatically strips away the start and end tags of the identified element
|
|
2002
|
+
* and any of its descendant elements as well as any descendant comments and
|
|
2003
|
+
* processing instructions. The output of this transform is an octet stream.
|
|
2004
|
+
*
|
|
2005
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
2006
|
+
*/
|
|
2007
|
+
int
|
|
2008
|
+
xmlSecTransformConnect(xmlSecTransformPtr left, xmlSecTransformPtr right,
|
|
2009
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
2010
|
+
xmlSecTransformDataType leftType;
|
|
2011
|
+
xmlSecTransformDataType rightType;
|
|
2012
|
+
xmlSecTransformId middleId;
|
|
2013
|
+
xmlSecTransformPtr middle;
|
|
2014
|
+
|
|
2015
|
+
xmlSecAssert2(xmlSecTransformIsValid(left), -1);
|
|
2016
|
+
xmlSecAssert2(xmlSecTransformIsValid(right), -1);
|
|
2017
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
2018
|
+
|
|
2019
|
+
leftType = xmlSecTransformGetDataType(left, xmlSecTransformModePop, transformCtx);
|
|
2020
|
+
rightType = xmlSecTransformGetDataType(right, xmlSecTransformModePush, transformCtx);
|
|
2021
|
+
|
|
2022
|
+
/* happy case first: nothing need to be done */
|
|
2023
|
+
if((((leftType & xmlSecTransformDataTypeBin) != 0) &&
|
|
2024
|
+
((rightType & xmlSecTransformDataTypeBin) != 0)) ||
|
|
2025
|
+
(((leftType & xmlSecTransformDataTypeXml) != 0) &&
|
|
2026
|
+
((rightType & xmlSecTransformDataTypeXml) != 0))) {
|
|
2027
|
+
|
|
2028
|
+
left->next = right;
|
|
2029
|
+
right->prev = left;
|
|
2030
|
+
return(0);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
if(((leftType & xmlSecTransformDataTypeBin) != 0) &&
|
|
2034
|
+
((rightType & xmlSecTransformDataTypeXml) != 0)) {
|
|
2035
|
+
|
|
2036
|
+
/* need to insert parser */
|
|
2037
|
+
middleId = xmlSecTransformXmlParserId;
|
|
2038
|
+
} else if(((leftType & xmlSecTransformDataTypeXml) != 0) &&
|
|
2039
|
+
((rightType & xmlSecTransformDataTypeBin) != 0)) {
|
|
2040
|
+
|
|
2041
|
+
/* need to insert c14n or special pre-base64 transform */
|
|
2042
|
+
if(xmlSecTransformCheckId(right, xmlSecTransformBase64Id)) {
|
|
2043
|
+
middleId = xmlSecTransformRemoveXmlTagsC14NId;
|
|
2044
|
+
} else {
|
|
2045
|
+
middleId = xmlSecTransformInclC14NId;
|
|
2046
|
+
}
|
|
2047
|
+
} else {
|
|
2048
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2049
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(left)),
|
|
2050
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(right)),
|
|
2051
|
+
XMLSEC_ERRORS_R_INVALID_TRANSFORM,
|
|
2052
|
+
"leftType=%d;rightType=%d",
|
|
2053
|
+
leftType, rightType);
|
|
2054
|
+
return(-1);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/* insert transform */
|
|
2058
|
+
middle = xmlSecTransformCreate(middleId);
|
|
2059
|
+
if(middle == NULL) {
|
|
2060
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2061
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(left)),
|
|
2062
|
+
"xmlSecTransformCreate",
|
|
2063
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2064
|
+
"transform=%s",
|
|
2065
|
+
xmlSecErrorsSafeString(xmlSecTransformKlassGetName(middleId)));
|
|
2066
|
+
return(-1);
|
|
2067
|
+
}
|
|
2068
|
+
left->next = middle;
|
|
2069
|
+
middle->prev = left;
|
|
2070
|
+
middle->next = right;
|
|
2071
|
+
right->prev = middle;
|
|
2072
|
+
return(0);
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
/**
|
|
2076
|
+
* xmlSecTransformRemove:
|
|
2077
|
+
* @transform: the pointer to #xmlSecTransform structure.
|
|
2078
|
+
*
|
|
2079
|
+
* Removes @transform from the chain.
|
|
2080
|
+
*/
|
|
2081
|
+
void
|
|
2082
|
+
xmlSecTransformRemove(xmlSecTransformPtr transform) {
|
|
2083
|
+
xmlSecAssert(xmlSecTransformIsValid(transform));
|
|
2084
|
+
|
|
2085
|
+
if(transform->next != NULL) {
|
|
2086
|
+
transform->next->prev = transform->prev;
|
|
2087
|
+
}
|
|
2088
|
+
if(transform->prev != NULL) {
|
|
2089
|
+
transform->prev->next = transform->next;
|
|
2090
|
+
}
|
|
2091
|
+
transform->next = transform->prev = NULL;
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
/************************************************************************
|
|
2096
|
+
*
|
|
2097
|
+
* Default callbacks, most of the transforms can use them
|
|
2098
|
+
*
|
|
2099
|
+
************************************************************************/
|
|
2100
|
+
/**
|
|
2101
|
+
* xmlSecTransformDefaultGetDataType:
|
|
2102
|
+
* @transform: the pointer to transform.
|
|
2103
|
+
* @mode: the data mode (push or pop).
|
|
2104
|
+
* @transformCtx: the transform's chaing processing context.
|
|
2105
|
+
*
|
|
2106
|
+
* Gets transform input (@mode is "push") or output (@mode is "pop") data
|
|
2107
|
+
* type (binary or XML) by analyzing available pushBin/popBin/pushXml/popXml
|
|
2108
|
+
* methods.
|
|
2109
|
+
*
|
|
2110
|
+
* Returns: the transform's data type for the @mode operation.
|
|
2111
|
+
*/
|
|
2112
|
+
xmlSecTransformDataType
|
|
2113
|
+
xmlSecTransformDefaultGetDataType(xmlSecTransformPtr transform, xmlSecTransformMode mode,
|
|
2114
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
2115
|
+
xmlSecTransformDataType type = xmlSecTransformDataTypeUnknown;
|
|
2116
|
+
|
|
2117
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), xmlSecTransformDataTypeUnknown);
|
|
2118
|
+
xmlSecAssert2(transformCtx != NULL, xmlSecTransformDataTypeUnknown);
|
|
2119
|
+
|
|
2120
|
+
/* we'll try to guess the data type based on the handlers we have */
|
|
2121
|
+
switch(mode) {
|
|
2122
|
+
case xmlSecTransformModePush:
|
|
2123
|
+
if(transform->id->pushBin != NULL) {
|
|
2124
|
+
type |= xmlSecTransformDataTypeBin;
|
|
2125
|
+
}
|
|
2126
|
+
if(transform->id->pushXml != NULL) {
|
|
2127
|
+
type |= xmlSecTransformDataTypeXml;
|
|
2128
|
+
}
|
|
2129
|
+
break;
|
|
2130
|
+
case xmlSecTransformModePop:
|
|
2131
|
+
if(transform->id->popBin != NULL) {
|
|
2132
|
+
type |= xmlSecTransformDataTypeBin;
|
|
2133
|
+
}
|
|
2134
|
+
if(transform->id->popXml != NULL) {
|
|
2135
|
+
type |= xmlSecTransformDataTypeXml;
|
|
2136
|
+
}
|
|
2137
|
+
break;
|
|
2138
|
+
default:
|
|
2139
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2140
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2141
|
+
NULL,
|
|
2142
|
+
XMLSEC_ERRORS_R_INVALID_DATA,
|
|
2143
|
+
"mode=%d", mode);
|
|
2144
|
+
return(xmlSecTransformDataTypeUnknown);
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
return(type);
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* xmlSecTransformDefaultPushBin:
|
|
2152
|
+
* @transform: the pointer to transform object.
|
|
2153
|
+
* @data: the input binary data,
|
|
2154
|
+
* @dataSize: the input data size.
|
|
2155
|
+
* @final: the flag: if set to 1 then it's the last
|
|
2156
|
+
* data chunk.
|
|
2157
|
+
* @transformCtx: the pointer to transform context object.
|
|
2158
|
+
*
|
|
2159
|
+
* Process binary @data by calling transform's execute method and pushes
|
|
2160
|
+
* results to next transform.
|
|
2161
|
+
*
|
|
2162
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
2163
|
+
*/
|
|
2164
|
+
int
|
|
2165
|
+
xmlSecTransformDefaultPushBin(xmlSecTransformPtr transform, const xmlSecByte* data,
|
|
2166
|
+
xmlSecSize dataSize, int final, xmlSecTransformCtxPtr transformCtx) {
|
|
2167
|
+
xmlSecSize inSize = 0;
|
|
2168
|
+
xmlSecSize outSize = 0;
|
|
2169
|
+
int finalData = 0;
|
|
2170
|
+
int ret;
|
|
2171
|
+
|
|
2172
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
2173
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
2174
|
+
|
|
2175
|
+
do {
|
|
2176
|
+
/* append data to input buffer */
|
|
2177
|
+
if(dataSize > 0) {
|
|
2178
|
+
xmlSecSize chunkSize;
|
|
2179
|
+
|
|
2180
|
+
xmlSecAssert2(data != NULL, -1);
|
|
2181
|
+
|
|
2182
|
+
chunkSize = dataSize;
|
|
2183
|
+
if(chunkSize > XMLSEC_TRANSFORM_BINARY_CHUNK) {
|
|
2184
|
+
chunkSize = XMLSEC_TRANSFORM_BINARY_CHUNK;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
ret = xmlSecBufferAppend(&(transform->inBuf), data, chunkSize);
|
|
2188
|
+
if(ret < 0) {
|
|
2189
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2190
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2191
|
+
"xmlSecBufferAppend",
|
|
2192
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2193
|
+
"size=%d", chunkSize);
|
|
2194
|
+
return(-1);
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
dataSize -= chunkSize;
|
|
2198
|
+
data += chunkSize;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
/* process data */
|
|
2202
|
+
inSize = xmlSecBufferGetSize(&(transform->inBuf));
|
|
2203
|
+
outSize = xmlSecBufferGetSize(&(transform->outBuf));
|
|
2204
|
+
finalData = (((dataSize == 0) && (final != 0)) ? 1 : 0);
|
|
2205
|
+
ret = xmlSecTransformExecute(transform, finalData, transformCtx);
|
|
2206
|
+
if(ret < 0) {
|
|
2207
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2208
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2209
|
+
"xmlSecTransformExecute",
|
|
2210
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2211
|
+
"final=%d", final);
|
|
2212
|
+
return(-1);
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
/* push data to the next transform */
|
|
2216
|
+
inSize = xmlSecBufferGetSize(&(transform->inBuf));
|
|
2217
|
+
outSize = xmlSecBufferGetSize(&(transform->outBuf));
|
|
2218
|
+
if(inSize > 0) {
|
|
2219
|
+
finalData = 0;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
/* we don't want to puch too much */
|
|
2223
|
+
if(outSize > XMLSEC_TRANSFORM_BINARY_CHUNK) {
|
|
2224
|
+
outSize = XMLSEC_TRANSFORM_BINARY_CHUNK;
|
|
2225
|
+
finalData = 0;
|
|
2226
|
+
}
|
|
2227
|
+
if((transform->next != NULL) && ((outSize > 0) || (finalData != 0))) {
|
|
2228
|
+
ret = xmlSecTransformPushBin(transform->next,
|
|
2229
|
+
xmlSecBufferGetData(&(transform->outBuf)),
|
|
2230
|
+
outSize,
|
|
2231
|
+
finalData,
|
|
2232
|
+
transformCtx);
|
|
2233
|
+
if(ret < 0) {
|
|
2234
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2235
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform->next)),
|
|
2236
|
+
"xmlSecTransformPushBin",
|
|
2237
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2238
|
+
"final=%d;outSize=%d", final, outSize);
|
|
2239
|
+
return(-1);
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
/* remove data anyway */
|
|
2244
|
+
if(outSize > 0) {
|
|
2245
|
+
ret = xmlSecBufferRemoveHead(&(transform->outBuf), outSize);
|
|
2246
|
+
if(ret < 0) {
|
|
2247
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2248
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2249
|
+
"xmlSecBufferAppend",
|
|
2250
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2251
|
+
"size=%d", outSize);
|
|
2252
|
+
return(-1);
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
} while((dataSize > 0) || (outSize > 0));
|
|
2256
|
+
|
|
2257
|
+
return(0);
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
/**
|
|
2261
|
+
* xmlSecTransformDefaultPopBin:
|
|
2262
|
+
* @transform: the pointer to transform object.
|
|
2263
|
+
* @data: the buffer to store result data.
|
|
2264
|
+
* @maxDataSize: the size of the buffer #data.
|
|
2265
|
+
* @dataSize: the pointer to returned data size.
|
|
2266
|
+
* @transformCtx: the pointer to transform context object.
|
|
2267
|
+
*
|
|
2268
|
+
* Pops data from previous transform in the chain, processes data by calling
|
|
2269
|
+
* transform's execute method and returns result in the @data buffer. The
|
|
2270
|
+
* size of returned data is placed in the @dataSize.
|
|
2271
|
+
*
|
|
2272
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
2273
|
+
*/
|
|
2274
|
+
int
|
|
2275
|
+
xmlSecTransformDefaultPopBin(xmlSecTransformPtr transform, xmlSecByte* data,
|
|
2276
|
+
xmlSecSize maxDataSize, xmlSecSize* dataSize, xmlSecTransformCtxPtr transformCtx) {
|
|
2277
|
+
xmlSecSize outSize;
|
|
2278
|
+
int final = 0;
|
|
2279
|
+
int ret;
|
|
2280
|
+
|
|
2281
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
2282
|
+
xmlSecAssert2(data != NULL, -1);
|
|
2283
|
+
xmlSecAssert2(dataSize != NULL, -1);
|
|
2284
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
2285
|
+
|
|
2286
|
+
while((xmlSecBufferGetSize(&(transform->outBuf)) == 0) && (final == 0)) {
|
|
2287
|
+
/* read data from previous transform if exist */
|
|
2288
|
+
if(transform->prev != NULL) {
|
|
2289
|
+
xmlSecSize inSize, chunkSize;
|
|
2290
|
+
|
|
2291
|
+
inSize = xmlSecBufferGetSize(&(transform->inBuf));
|
|
2292
|
+
chunkSize = XMLSEC_TRANSFORM_BINARY_CHUNK;
|
|
2293
|
+
|
|
2294
|
+
/* ensure that we have space for at least one data chunk */
|
|
2295
|
+
ret = xmlSecBufferSetMaxSize(&(transform->inBuf), inSize + chunkSize);
|
|
2296
|
+
if(ret < 0) {
|
|
2297
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2298
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2299
|
+
"xmlSecBufferSetMaxSize",
|
|
2300
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2301
|
+
"size=%d", inSize + chunkSize);
|
|
2302
|
+
return(-1);
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
/* get data from previous transform */
|
|
2306
|
+
ret = xmlSecTransformPopBin(transform->prev,
|
|
2307
|
+
xmlSecBufferGetData(&(transform->inBuf)) + inSize,
|
|
2308
|
+
chunkSize, &chunkSize, transformCtx);
|
|
2309
|
+
if(ret < 0) {
|
|
2310
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2311
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform->prev)),
|
|
2312
|
+
"xmlSecTransformPopBin",
|
|
2313
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2314
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2315
|
+
return(-1);
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
/* adjust our size if needed */
|
|
2319
|
+
if(chunkSize > 0) {
|
|
2320
|
+
ret = xmlSecBufferSetSize(&(transform->inBuf), inSize + chunkSize);
|
|
2321
|
+
if(ret < 0) {
|
|
2322
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2323
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2324
|
+
"xmlSecBufferSetSize",
|
|
2325
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2326
|
+
"size=%d", inSize + chunkSize);
|
|
2327
|
+
return(-1);
|
|
2328
|
+
}
|
|
2329
|
+
final = 0; /* the previous transform returned some data..*/
|
|
2330
|
+
} else {
|
|
2331
|
+
final = 1; /* no data returned from previous transform, we are done */
|
|
2332
|
+
}
|
|
2333
|
+
} else {
|
|
2334
|
+
final = 1; /* no previous transform, we are "permanently final" */
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
/* execute our transform */
|
|
2338
|
+
ret = xmlSecTransformExecute(transform, final, transformCtx);
|
|
2339
|
+
if(ret < 0) {
|
|
2340
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2341
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2342
|
+
"xmlSecTransformExecute",
|
|
2343
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2344
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2345
|
+
return(-1);
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
/* copy result (if any) */
|
|
2350
|
+
outSize = xmlSecBufferGetSize(&(transform->outBuf));
|
|
2351
|
+
if(outSize > maxDataSize) {
|
|
2352
|
+
outSize = maxDataSize;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
/* we don't want to put too much */
|
|
2356
|
+
if(outSize > XMLSEC_TRANSFORM_BINARY_CHUNK) {
|
|
2357
|
+
outSize = XMLSEC_TRANSFORM_BINARY_CHUNK;
|
|
2358
|
+
}
|
|
2359
|
+
if(outSize > 0) {
|
|
2360
|
+
xmlSecAssert2(xmlSecBufferGetData(&(transform->outBuf)), -1);
|
|
2361
|
+
|
|
2362
|
+
memcpy(data, xmlSecBufferGetData(&(transform->outBuf)), outSize);
|
|
2363
|
+
|
|
2364
|
+
ret = xmlSecBufferRemoveHead(&(transform->outBuf), outSize);
|
|
2365
|
+
if(ret < 0) {
|
|
2366
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2367
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2368
|
+
"xmlSecBufferRemoveHead",
|
|
2369
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2370
|
+
"size=%d", outSize);
|
|
2371
|
+
return(-1);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/* set the result size */
|
|
2376
|
+
(*dataSize) = outSize;
|
|
2377
|
+
return(0);
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
/**
|
|
2381
|
+
* xmlSecTransformDefaultPushXml:
|
|
2382
|
+
* @transform: the pointer to transform object.
|
|
2383
|
+
* @nodes: the input nodes.
|
|
2384
|
+
* @transformCtx: the pointer to transform context object.
|
|
2385
|
+
*
|
|
2386
|
+
* Processes @nodes by calling transform's execute method and pushes
|
|
2387
|
+
* result to the next transform in the chain.
|
|
2388
|
+
*
|
|
2389
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
2390
|
+
*/
|
|
2391
|
+
int
|
|
2392
|
+
xmlSecTransformDefaultPushXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr nodes,
|
|
2393
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
2394
|
+
int ret;
|
|
2395
|
+
|
|
2396
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
2397
|
+
xmlSecAssert2(transform->inNodes == NULL, -1);
|
|
2398
|
+
xmlSecAssert2(transform->outNodes == NULL, -1);
|
|
2399
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
2400
|
+
|
|
2401
|
+
/* execute our transform */
|
|
2402
|
+
transform->inNodes = nodes;
|
|
2403
|
+
ret = xmlSecTransformExecute(transform, 1, transformCtx);
|
|
2404
|
+
if(ret < 0) {
|
|
2405
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2406
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2407
|
+
"xmlSecTransformExecute",
|
|
2408
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2409
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2410
|
+
return(-1);
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
/* push result to the next transform (if exist) */
|
|
2414
|
+
if(transform->next != NULL) {
|
|
2415
|
+
ret = xmlSecTransformPushXml(transform->next, transform->outNodes, transformCtx);
|
|
2416
|
+
if(ret < 0) {
|
|
2417
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2418
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2419
|
+
"xmlSecTransformPushXml",
|
|
2420
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2421
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2422
|
+
return(-1);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
return(0);
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
/**
|
|
2429
|
+
* xmlSecTransformDefaultPopXml:
|
|
2430
|
+
* @transform: the pointer to transform object.
|
|
2431
|
+
* @nodes: the pointer to store popinter to result nodes.
|
|
2432
|
+
* @transformCtx: the pointer to transform context object.
|
|
2433
|
+
*
|
|
2434
|
+
* Pops data from previous transform in the chain, processes the data
|
|
2435
|
+
* by calling transform's execute method and returns result in @nodes.
|
|
2436
|
+
*
|
|
2437
|
+
* Returns: 0 on success or a negative value if an error occurs.
|
|
2438
|
+
*/
|
|
2439
|
+
int
|
|
2440
|
+
xmlSecTransformDefaultPopXml(xmlSecTransformPtr transform, xmlSecNodeSetPtr* nodes,
|
|
2441
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
2442
|
+
int ret;
|
|
2443
|
+
|
|
2444
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), -1);
|
|
2445
|
+
xmlSecAssert2(transform->inNodes == NULL, -1);
|
|
2446
|
+
xmlSecAssert2(transform->outNodes == NULL, -1);
|
|
2447
|
+
xmlSecAssert2(transformCtx != NULL, -1);
|
|
2448
|
+
|
|
2449
|
+
/* pop result from the prev transform (if exist) */
|
|
2450
|
+
if(transform->prev != NULL) {
|
|
2451
|
+
ret = xmlSecTransformPopXml(transform->prev, &(transform->inNodes), transformCtx);
|
|
2452
|
+
if(ret < 0) {
|
|
2453
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2454
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2455
|
+
"xmlSecTransformPopXml",
|
|
2456
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2457
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2458
|
+
return(-1);
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
/* execute our transform */
|
|
2463
|
+
ret = xmlSecTransformExecute(transform, 1, transformCtx);
|
|
2464
|
+
if(ret < 0) {
|
|
2465
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2466
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2467
|
+
"xmlSecTransformExecute",
|
|
2468
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2469
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2470
|
+
return(-1);
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
/* return result if requested */
|
|
2474
|
+
if(nodes != NULL) {
|
|
2475
|
+
(*nodes) = transform->outNodes;
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
return(0);
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
/***********************************************************************
|
|
2482
|
+
*
|
|
2483
|
+
* Transform Ids list
|
|
2484
|
+
*
|
|
2485
|
+
**********************************************************************/
|
|
2486
|
+
static xmlSecPtrListKlass xmlSecTransformIdListKlass = {
|
|
2487
|
+
BAD_CAST "transform-ids-list",
|
|
2488
|
+
NULL, /* xmlSecPtrDuplicateItemMethod duplicateItem; */
|
|
2489
|
+
NULL, /* xmlSecPtrDestroyItemMethod destroyItem; */
|
|
2490
|
+
NULL, /* xmlSecPtrDebugDumpItemMethod debugDumpItem; */
|
|
2491
|
+
NULL, /* xmlSecPtrDebugDumpItemMethod debugXmlDumpItem; */
|
|
2492
|
+
};
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* xmlSecTransformIdListGetKlass:
|
|
2496
|
+
*
|
|
2497
|
+
* The transform id list klass.
|
|
2498
|
+
*
|
|
2499
|
+
* Returns: pointer to the transform id list klass.
|
|
2500
|
+
*/
|
|
2501
|
+
xmlSecPtrListId
|
|
2502
|
+
xmlSecTransformIdListGetKlass(void) {
|
|
2503
|
+
return(&xmlSecTransformIdListKlass);
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* xmlSecTransformIdListFind:
|
|
2508
|
+
* @list: the pointer to transform ids list.
|
|
2509
|
+
* @transformId: the transform klass.
|
|
2510
|
+
*
|
|
2511
|
+
* Lookups @dataId in @list.
|
|
2512
|
+
*
|
|
2513
|
+
* Returns: 1 if @dataId is found in the @list, 0 if not and a negative
|
|
2514
|
+
* value if an error occurs.
|
|
2515
|
+
*/
|
|
2516
|
+
int
|
|
2517
|
+
xmlSecTransformIdListFind(xmlSecPtrListPtr list, xmlSecTransformId transformId) {
|
|
2518
|
+
xmlSecSize i, size;
|
|
2519
|
+
|
|
2520
|
+
xmlSecAssert2(xmlSecPtrListCheckId(list, xmlSecTransformIdListId), -1);
|
|
2521
|
+
xmlSecAssert2(transformId != NULL, -1);
|
|
2522
|
+
|
|
2523
|
+
size = xmlSecPtrListGetSize(list);
|
|
2524
|
+
for(i = 0; i < size; ++i) {
|
|
2525
|
+
if((xmlSecTransformId)xmlSecPtrListGetItem(list, i) == transformId) {
|
|
2526
|
+
return(1);
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
return(0);
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* xmlSecTransformIdListFindByHref:
|
|
2534
|
+
* @list: the pointer to transform ids list.
|
|
2535
|
+
* @href: the desired transform klass href.
|
|
2536
|
+
* @usage: the desired transform usage.
|
|
2537
|
+
*
|
|
2538
|
+
* Lookups data klass in the list with given @href and @usage in @list.
|
|
2539
|
+
*
|
|
2540
|
+
* Returns: transform klass is found and NULL otherwise.
|
|
2541
|
+
*/
|
|
2542
|
+
xmlSecTransformId
|
|
2543
|
+
xmlSecTransformIdListFindByHref(xmlSecPtrListPtr list, const xmlChar* href,
|
|
2544
|
+
xmlSecTransformUsage usage) {
|
|
2545
|
+
xmlSecTransformId transformId;
|
|
2546
|
+
xmlSecSize i, size;
|
|
2547
|
+
|
|
2548
|
+
xmlSecAssert2(xmlSecPtrListCheckId(list, xmlSecTransformIdListId), xmlSecTransformIdUnknown);
|
|
2549
|
+
xmlSecAssert2(href != NULL, xmlSecTransformIdUnknown);
|
|
2550
|
+
|
|
2551
|
+
size = xmlSecPtrListGetSize(list);
|
|
2552
|
+
for(i = 0; i < size; ++i) {
|
|
2553
|
+
transformId = (xmlSecTransformId)xmlSecPtrListGetItem(list, i);
|
|
2554
|
+
xmlSecAssert2(transformId != xmlSecTransformIdUnknown, xmlSecTransformIdUnknown);
|
|
2555
|
+
|
|
2556
|
+
if(((usage & transformId->usage) != 0) && (transformId->href != NULL) &&
|
|
2557
|
+
xmlStrEqual(href, transformId->href)) {
|
|
2558
|
+
return(transformId);
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
return(xmlSecTransformIdUnknown);
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* xmlSecTransformIdListFindByName:
|
|
2566
|
+
* @list: the pointer to transform ids list.
|
|
2567
|
+
* @name: the desired transform klass name.
|
|
2568
|
+
* @usage: the desired transform usage.
|
|
2569
|
+
*
|
|
2570
|
+
* Lookups data klass in the list with given @name and @usage in @list.
|
|
2571
|
+
*
|
|
2572
|
+
* Returns: transform klass is found and NULL otherwise.
|
|
2573
|
+
*/
|
|
2574
|
+
xmlSecTransformId
|
|
2575
|
+
xmlSecTransformIdListFindByName(xmlSecPtrListPtr list, const xmlChar* name,
|
|
2576
|
+
xmlSecTransformUsage usage) {
|
|
2577
|
+
xmlSecTransformId transformId;
|
|
2578
|
+
xmlSecSize i, size;
|
|
2579
|
+
|
|
2580
|
+
xmlSecAssert2(xmlSecPtrListCheckId(list, xmlSecTransformIdListId), xmlSecTransformIdUnknown);
|
|
2581
|
+
xmlSecAssert2(name != NULL, xmlSecTransformIdUnknown);
|
|
2582
|
+
|
|
2583
|
+
size = xmlSecPtrListGetSize(list);
|
|
2584
|
+
for(i = 0; i < size; ++i) {
|
|
2585
|
+
transformId = (xmlSecTransformId)xmlSecPtrListGetItem(list, i);
|
|
2586
|
+
xmlSecAssert2(transformId != xmlSecTransformIdUnknown, xmlSecTransformIdUnknown);
|
|
2587
|
+
|
|
2588
|
+
if(((usage & transformId->usage) != 0) && (transformId->name != NULL) &&
|
|
2589
|
+
xmlStrEqual(name, BAD_CAST transformId->name)) {
|
|
2590
|
+
|
|
2591
|
+
return(transformId);
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
return(xmlSecTransformIdUnknown);
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
/**
|
|
2598
|
+
* xmlSecTransformIdListDebugDump:
|
|
2599
|
+
* @list: the pointer to transform ids list.
|
|
2600
|
+
* @output: the pointer to output FILE.
|
|
2601
|
+
*
|
|
2602
|
+
* Prints binary transform debug information to @output.
|
|
2603
|
+
*/
|
|
2604
|
+
void
|
|
2605
|
+
xmlSecTransformIdListDebugDump(xmlSecPtrListPtr list, FILE* output) {
|
|
2606
|
+
xmlSecTransformId transformId;
|
|
2607
|
+
xmlSecSize i, size;
|
|
2608
|
+
|
|
2609
|
+
xmlSecAssert(xmlSecPtrListCheckId(list, xmlSecTransformIdListId));
|
|
2610
|
+
xmlSecAssert(output != NULL);
|
|
2611
|
+
|
|
2612
|
+
size = xmlSecPtrListGetSize(list);
|
|
2613
|
+
for(i = 0; i < size; ++i) {
|
|
2614
|
+
transformId = (xmlSecTransformId)xmlSecPtrListGetItem(list, i);
|
|
2615
|
+
xmlSecAssert(transformId != NULL);
|
|
2616
|
+
xmlSecAssert(transformId->name != NULL);
|
|
2617
|
+
|
|
2618
|
+
if(i > 0) {
|
|
2619
|
+
fprintf(output, ",\"%s\"", transformId->name);
|
|
2620
|
+
} else {
|
|
2621
|
+
fprintf(output, "\"%s\"", transformId->name);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
fprintf(output, "\n");
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
/**
|
|
2628
|
+
* xmlSecTransformIdListDebugXmlDump:
|
|
2629
|
+
* @list: the pointer to transform ids list.
|
|
2630
|
+
* @output: the pointer to output FILE.
|
|
2631
|
+
*
|
|
2632
|
+
* Prints binary transform debug information to @output in XML format.
|
|
2633
|
+
*/
|
|
2634
|
+
void
|
|
2635
|
+
xmlSecTransformIdListDebugXmlDump(xmlSecPtrListPtr list, FILE* output) {
|
|
2636
|
+
xmlSecTransformId transformId;
|
|
2637
|
+
xmlSecSize i, size;
|
|
2638
|
+
|
|
2639
|
+
xmlSecAssert(xmlSecPtrListCheckId(list, xmlSecTransformIdListId));
|
|
2640
|
+
xmlSecAssert(output != NULL);
|
|
2641
|
+
|
|
2642
|
+
fprintf(output, "<TransformIdsList>\n");
|
|
2643
|
+
size = xmlSecPtrListGetSize(list);
|
|
2644
|
+
for(i = 0; i < size; ++i) {
|
|
2645
|
+
transformId = (xmlSecTransformId)xmlSecPtrListGetItem(list, i);
|
|
2646
|
+
xmlSecAssert(transformId != NULL);
|
|
2647
|
+
xmlSecAssert(transformId->name != NULL);
|
|
2648
|
+
|
|
2649
|
+
fprintf(output, "<TransformId name=\"");
|
|
2650
|
+
xmlSecPrintXmlString(output, transformId->name);
|
|
2651
|
+
fprintf(output, "\" />");
|
|
2652
|
+
}
|
|
2653
|
+
fprintf(output, "</TransformIdsList>\n");
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
/************************************************************************
|
|
2657
|
+
*
|
|
2658
|
+
* IO buffers for transforms
|
|
2659
|
+
*
|
|
2660
|
+
************************************************************************/
|
|
2661
|
+
typedef struct _xmlSecTransformIOBuffer xmlSecTransformIOBuffer,
|
|
2662
|
+
*xmlSecTransformIOBufferPtr;
|
|
2663
|
+
typedef enum {
|
|
2664
|
+
xmlSecTransformIOBufferModeRead,
|
|
2665
|
+
xmlSecTransformIOBufferModeWrite
|
|
2666
|
+
} xmlSecTransformIOBufferMode;
|
|
2667
|
+
|
|
2668
|
+
struct _xmlSecTransformIOBuffer {
|
|
2669
|
+
xmlSecTransformIOBufferMode mode;
|
|
2670
|
+
xmlSecTransformPtr transform;
|
|
2671
|
+
xmlSecTransformCtxPtr transformCtx;
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
static xmlSecTransformIOBufferPtr xmlSecTransformIOBufferCreate (xmlSecTransformIOBufferMode mode,
|
|
2675
|
+
xmlSecTransformPtr transform,
|
|
2676
|
+
xmlSecTransformCtxPtr transformCtx);
|
|
2677
|
+
static void xmlSecTransformIOBufferDestroy (xmlSecTransformIOBufferPtr buffer);
|
|
2678
|
+
static int xmlSecTransformIOBufferRead (xmlSecTransformIOBufferPtr buffer,
|
|
2679
|
+
xmlSecByte *buf,
|
|
2680
|
+
xmlSecSize size);
|
|
2681
|
+
static int xmlSecTransformIOBufferWrite (xmlSecTransformIOBufferPtr buffer,
|
|
2682
|
+
const xmlSecByte *buf,
|
|
2683
|
+
xmlSecSize size);
|
|
2684
|
+
static int xmlSecTransformIOBufferClose (xmlSecTransformIOBufferPtr buffer);
|
|
2685
|
+
|
|
2686
|
+
|
|
2687
|
+
/**
|
|
2688
|
+
* xmlSecTransformCreateOutputBuffer:
|
|
2689
|
+
* @transform: the pointer to transform.
|
|
2690
|
+
* @transformCtx: the pointer to transform context object.
|
|
2691
|
+
*
|
|
2692
|
+
* Creates output buffer to write data to @transform.
|
|
2693
|
+
*
|
|
2694
|
+
* Returns: pointer to new output buffer or NULL if an error occurs.
|
|
2695
|
+
*/
|
|
2696
|
+
xmlOutputBufferPtr
|
|
2697
|
+
xmlSecTransformCreateOutputBuffer(xmlSecTransformPtr transform, xmlSecTransformCtxPtr transformCtx) {
|
|
2698
|
+
xmlSecTransformIOBufferPtr buffer;
|
|
2699
|
+
xmlSecTransformDataType type;
|
|
2700
|
+
xmlOutputBufferPtr output;
|
|
2701
|
+
|
|
2702
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), NULL);
|
|
2703
|
+
xmlSecAssert2(transformCtx != NULL, NULL);
|
|
2704
|
+
|
|
2705
|
+
/* check that we have binary push method for this transform */
|
|
2706
|
+
type = xmlSecTransformDefaultGetDataType(transform, xmlSecTransformModePush, transformCtx);
|
|
2707
|
+
if((type & xmlSecTransformDataTypeBin) == 0) {
|
|
2708
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2709
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2710
|
+
NULL,
|
|
2711
|
+
XMLSEC_ERRORS_R_INVALID_TRANSFORM,
|
|
2712
|
+
"push binary data not supported");
|
|
2713
|
+
return(NULL);
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
buffer = xmlSecTransformIOBufferCreate(xmlSecTransformIOBufferModeWrite, transform, transformCtx);
|
|
2717
|
+
if(buffer == NULL) {
|
|
2718
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2719
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2720
|
+
"xmlSecTransformIOBufferCreate",
|
|
2721
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2722
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2723
|
+
return(NULL);
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
output = xmlOutputBufferCreateIO((xmlOutputWriteCallback)xmlSecTransformIOBufferWrite,
|
|
2727
|
+
(xmlOutputCloseCallback)xmlSecTransformIOBufferClose,
|
|
2728
|
+
buffer,
|
|
2729
|
+
NULL);
|
|
2730
|
+
if(output == NULL) {
|
|
2731
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2732
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2733
|
+
"xmlOutputBufferCreateIO",
|
|
2734
|
+
XMLSEC_ERRORS_R_XML_FAILED,
|
|
2735
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2736
|
+
xmlSecTransformIOBufferDestroy(buffer);
|
|
2737
|
+
return(NULL);
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
return(output);
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
/**
|
|
2744
|
+
* xmlSecTransformCreateInputBuffer:
|
|
2745
|
+
* @transform: the pointer to transform.
|
|
2746
|
+
* @transformCtx: the pointer to transform context object.
|
|
2747
|
+
*
|
|
2748
|
+
* Creates input buffer to read data from @transform.
|
|
2749
|
+
*
|
|
2750
|
+
* Returns: pointer to new input buffer or NULL if an error occurs.
|
|
2751
|
+
*/
|
|
2752
|
+
xmlParserInputBufferPtr
|
|
2753
|
+
xmlSecTransformCreateInputBuffer(xmlSecTransformPtr transform, xmlSecTransformCtxPtr transformCtx) {
|
|
2754
|
+
xmlSecTransformIOBufferPtr buffer;
|
|
2755
|
+
xmlSecTransformDataType type;
|
|
2756
|
+
xmlParserInputBufferPtr input;
|
|
2757
|
+
|
|
2758
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), NULL);
|
|
2759
|
+
xmlSecAssert2(transformCtx != NULL, NULL);
|
|
2760
|
+
|
|
2761
|
+
/* check that we have binary pop method for this transform */
|
|
2762
|
+
type = xmlSecTransformDefaultGetDataType(transform, xmlSecTransformModePop, transformCtx);
|
|
2763
|
+
if((type & xmlSecTransformDataTypeBin) == 0) {
|
|
2764
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2765
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2766
|
+
NULL,
|
|
2767
|
+
XMLSEC_ERRORS_R_INVALID_TRANSFORM,
|
|
2768
|
+
"pop binary data not supported");
|
|
2769
|
+
return(NULL);
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
buffer = xmlSecTransformIOBufferCreate(xmlSecTransformIOBufferModeRead, transform, transformCtx);
|
|
2773
|
+
if(buffer == NULL) {
|
|
2774
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2775
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2776
|
+
"xmlSecTransformIOBufferCreate",
|
|
2777
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2778
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2779
|
+
return(NULL);
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
input = xmlParserInputBufferCreateIO((xmlInputReadCallback)xmlSecTransformIOBufferRead,
|
|
2783
|
+
(xmlInputCloseCallback)xmlSecTransformIOBufferClose,
|
|
2784
|
+
buffer,
|
|
2785
|
+
XML_CHAR_ENCODING_NONE);
|
|
2786
|
+
if(input == NULL) {
|
|
2787
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2788
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
|
|
2789
|
+
"xmlParserInputBufferCreateIO",
|
|
2790
|
+
XMLSEC_ERRORS_R_XML_FAILED,
|
|
2791
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2792
|
+
xmlSecTransformIOBufferDestroy(buffer);
|
|
2793
|
+
return(NULL);
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
return(input);
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
static xmlSecTransformIOBufferPtr
|
|
2800
|
+
xmlSecTransformIOBufferCreate(xmlSecTransformIOBufferMode mode, xmlSecTransformPtr transform,
|
|
2801
|
+
xmlSecTransformCtxPtr transformCtx) {
|
|
2802
|
+
xmlSecTransformIOBufferPtr buffer;
|
|
2803
|
+
|
|
2804
|
+
xmlSecAssert2(xmlSecTransformIsValid(transform), NULL);
|
|
2805
|
+
xmlSecAssert2(transformCtx != NULL, NULL);
|
|
2806
|
+
|
|
2807
|
+
buffer = (xmlSecTransformIOBufferPtr)xmlMalloc(sizeof(xmlSecTransformIOBuffer));
|
|
2808
|
+
if(buffer == NULL) {
|
|
2809
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2810
|
+
NULL,
|
|
2811
|
+
NULL,
|
|
2812
|
+
XMLSEC_ERRORS_R_MALLOC_FAILED,
|
|
2813
|
+
"size=%d", sizeof(xmlSecTransformIOBuffer));
|
|
2814
|
+
return(NULL);
|
|
2815
|
+
}
|
|
2816
|
+
memset(buffer, 0, sizeof(xmlSecTransformIOBuffer));
|
|
2817
|
+
|
|
2818
|
+
buffer->mode = mode;
|
|
2819
|
+
buffer->transform = transform;
|
|
2820
|
+
buffer->transformCtx = transformCtx;
|
|
2821
|
+
|
|
2822
|
+
return(buffer);
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
static void
|
|
2826
|
+
xmlSecTransformIOBufferDestroy(xmlSecTransformIOBufferPtr buffer) {
|
|
2827
|
+
xmlSecAssert(buffer != NULL);
|
|
2828
|
+
|
|
2829
|
+
memset(buffer, 0, sizeof(xmlSecTransformIOBuffer));
|
|
2830
|
+
xmlFree(buffer);
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
static int
|
|
2834
|
+
xmlSecTransformIOBufferRead(xmlSecTransformIOBufferPtr buffer,
|
|
2835
|
+
xmlSecByte *buf, xmlSecSize size) {
|
|
2836
|
+
int ret;
|
|
2837
|
+
|
|
2838
|
+
xmlSecAssert2(buffer != NULL, -1);
|
|
2839
|
+
xmlSecAssert2(buffer->mode == xmlSecTransformIOBufferModeRead, -1);
|
|
2840
|
+
xmlSecAssert2(xmlSecTransformIsValid(buffer->transform), -1);
|
|
2841
|
+
xmlSecAssert2(buffer->transformCtx != NULL, -1);
|
|
2842
|
+
xmlSecAssert2(buf != NULL, -1);
|
|
2843
|
+
|
|
2844
|
+
ret = xmlSecTransformPopBin(buffer->transform, buf, size, &size, buffer->transformCtx);
|
|
2845
|
+
if(ret < 0) {
|
|
2846
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2847
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(buffer->transform)),
|
|
2848
|
+
"xmlSecTransformPopBin",
|
|
2849
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2850
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2851
|
+
return(-1);
|
|
2852
|
+
}
|
|
2853
|
+
return(size);
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
static int
|
|
2857
|
+
xmlSecTransformIOBufferWrite(xmlSecTransformIOBufferPtr buffer,
|
|
2858
|
+
const xmlSecByte *buf, xmlSecSize size) {
|
|
2859
|
+
int ret;
|
|
2860
|
+
|
|
2861
|
+
xmlSecAssert2(buffer != NULL, -1);
|
|
2862
|
+
xmlSecAssert2(buffer->mode == xmlSecTransformIOBufferModeWrite, -1);
|
|
2863
|
+
xmlSecAssert2(xmlSecTransformIsValid(buffer->transform), -1);
|
|
2864
|
+
xmlSecAssert2(buffer->transformCtx != NULL, -1);
|
|
2865
|
+
xmlSecAssert2(buf != NULL, -1);
|
|
2866
|
+
|
|
2867
|
+
ret = xmlSecTransformPushBin(buffer->transform, buf, size, 0, buffer->transformCtx);
|
|
2868
|
+
if(ret < 0) {
|
|
2869
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2870
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(buffer->transform)),
|
|
2871
|
+
"xmlSecTransformPushBin",
|
|
2872
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2873
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2874
|
+
return(-1);
|
|
2875
|
+
}
|
|
2876
|
+
return(size);
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
static int
|
|
2880
|
+
xmlSecTransformIOBufferClose(xmlSecTransformIOBufferPtr buffer) {
|
|
2881
|
+
int ret;
|
|
2882
|
+
|
|
2883
|
+
xmlSecAssert2(buffer != NULL, -1);
|
|
2884
|
+
xmlSecAssert2(xmlSecTransformIsValid(buffer->transform), -1);
|
|
2885
|
+
xmlSecAssert2(buffer->transformCtx != NULL, -1);
|
|
2886
|
+
|
|
2887
|
+
/* need to flush write buffer before destroying */
|
|
2888
|
+
if(buffer->mode == xmlSecTransformIOBufferModeWrite) {
|
|
2889
|
+
ret = xmlSecTransformPushBin(buffer->transform, NULL, 0, 1, buffer->transformCtx);
|
|
2890
|
+
if(ret < 0) {
|
|
2891
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2892
|
+
xmlSecErrorsSafeString(xmlSecTransformGetName(buffer->transform)),
|
|
2893
|
+
"xmlSecTransformPushBin",
|
|
2894
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2895
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2896
|
+
return(-1);
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
xmlSecTransformIOBufferDestroy(buffer);
|
|
2901
|
+
return(0);
|
|
2902
|
+
}
|