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,2615 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XMLSec library
|
|
3
|
+
*
|
|
4
|
+
* This is free software; see Copyright file in the source
|
|
5
|
+
* distribution for preciese wording.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2003 Cordys R&D BV, All rights reserved.
|
|
8
|
+
* Copyright (C) 2003 Aleksey Sanin <aleksey@aleksey.com>
|
|
9
|
+
*/
|
|
10
|
+
#include "globals.h"
|
|
11
|
+
|
|
12
|
+
#include <string.h>
|
|
13
|
+
|
|
14
|
+
#include <windows.h>
|
|
15
|
+
#include <wincrypt.h>
|
|
16
|
+
|
|
17
|
+
#ifndef XMLSEC_NO_GOST
|
|
18
|
+
#include "csp_oid.h"
|
|
19
|
+
#include "csp_calg.h"
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#include <xmlsec/xmlsec.h>
|
|
23
|
+
#include <xmlsec/xmltree.h>
|
|
24
|
+
#include <xmlsec/keys.h>
|
|
25
|
+
#include <xmlsec/keyinfo.h>
|
|
26
|
+
#include <xmlsec/transforms.h>
|
|
27
|
+
#include <xmlsec/errors.h>
|
|
28
|
+
#include <xmlsec/bn.h>
|
|
29
|
+
|
|
30
|
+
#include <xmlsec/mscrypto/certkeys.h>
|
|
31
|
+
#include <xmlsec/mscrypto/crypto.h>
|
|
32
|
+
#include <xmlsec/mscrypto/x509.h>
|
|
33
|
+
#include "private.h"
|
|
34
|
+
|
|
35
|
+
// GOST CSP don't support keys duplicating, so we use NT4 analogs for these...
|
|
36
|
+
#ifndef XMLSEC_NO_GOST
|
|
37
|
+
#ifndef XMLSEC_MSCRYPTO_NT4
|
|
38
|
+
#define XMLSEC_MSCRYPTO_NT4
|
|
39
|
+
#endif
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**************************************************************************
|
|
44
|
+
*
|
|
45
|
+
* Internal MSCrypto PCCERT_CONTEXT key CTX
|
|
46
|
+
*
|
|
47
|
+
*************************************************************************/
|
|
48
|
+
typedef struct _xmlSecMSCryptoKeyDataCtx xmlSecMSCryptoKeyDataCtx,
|
|
49
|
+
*xmlSecMSCryptoKeyDataCtxPtr;
|
|
50
|
+
|
|
51
|
+
#ifdef XMLSEC_MSCRYPTO_NT4
|
|
52
|
+
/*-
|
|
53
|
+
* A wrapper of HCRYPTKEY, a reference countor is introduced, the function is
|
|
54
|
+
* the same as CryptDuplicateKey. Because the CryptDuplicateKey is not support
|
|
55
|
+
* by WINNT 4.0, the wrapper will enable the library work on WINNT 4.0
|
|
56
|
+
*/
|
|
57
|
+
struct _mscrypt_key {
|
|
58
|
+
HCRYPTKEY hKey ;
|
|
59
|
+
volatile LONG refcnt ;
|
|
60
|
+
} ;
|
|
61
|
+
|
|
62
|
+
/*-
|
|
63
|
+
* A wrapper of HCRYPTPROV, a reference countor is introduced, the function is
|
|
64
|
+
* the same as CryptContextAddRef. Because the CryptContextAddRef is not support
|
|
65
|
+
* by WINNT 4.0, the wrapper will enable the library work on WINNT 4.0
|
|
66
|
+
*/
|
|
67
|
+
struct _mscrypt_prov {
|
|
68
|
+
HCRYPTPROV hProv ;
|
|
69
|
+
BOOL fCallerFreeProv ;
|
|
70
|
+
volatile LONG refcnt ;
|
|
71
|
+
} ;
|
|
72
|
+
#endif /* XMLSEC_MSCRYPTO_NT4 */
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
* Since MSCrypto does not provide direct handles to private keys, we support
|
|
76
|
+
* only private keys linked to a certificate context. The certificate context
|
|
77
|
+
* also provides the public key. Only when no certificate context is used, and
|
|
78
|
+
* a public key from xml document is provided, we need HCRYPTKEY.... The focus
|
|
79
|
+
* now is however directed to certificates. Wouter
|
|
80
|
+
*/
|
|
81
|
+
struct _xmlSecMSCryptoKeyDataCtx {
|
|
82
|
+
#ifndef XMLSEC_MSCRYPTO_NT4
|
|
83
|
+
HCRYPTPROV hProv;
|
|
84
|
+
BOOL fCallerFreeProv;
|
|
85
|
+
HCRYPTKEY hKey;
|
|
86
|
+
#else /* XMLSEC_MSCRYPTO_NT4 */
|
|
87
|
+
struct _mscrypt_prov* p_prov ;
|
|
88
|
+
struct _mscrypt_key* p_key ;
|
|
89
|
+
#endif /* XMLSEC_MSCRYPTO_NT4 */
|
|
90
|
+
PCCERT_CONTEXT pCert;
|
|
91
|
+
const xmlSecMSCryptoProviderInfo * providers;
|
|
92
|
+
DWORD dwKeySpec;
|
|
93
|
+
xmlSecKeyDataType type;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
#ifndef XMLSEC_MSCRYPTO_NT4
|
|
97
|
+
|
|
98
|
+
/******************************** Provider *****************************************/
|
|
99
|
+
#define xmlSecMSCryptoKeyDataCtxGetProvider(ctx) (ctx)->hProv
|
|
100
|
+
|
|
101
|
+
static void
|
|
102
|
+
xmlSecMSCryptoKeyDataCtxCreateProvider(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
103
|
+
xmlSecAssert(ctx != NULL);
|
|
104
|
+
|
|
105
|
+
ctx->hProv = 0;
|
|
106
|
+
ctx->fCallerFreeProv = FALSE;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static void
|
|
110
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
111
|
+
xmlSecAssert(ctx != NULL);
|
|
112
|
+
|
|
113
|
+
if ((ctx->hProv != 0) && (ctx->fCallerFreeProv)) {
|
|
114
|
+
CryptReleaseContext(ctx->hProv, 0);
|
|
115
|
+
}
|
|
116
|
+
ctx->hProv = 0;
|
|
117
|
+
ctx->fCallerFreeProv = FALSE;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static void
|
|
121
|
+
xmlSecMSCryptoKeyDataCtxSetProvider(xmlSecMSCryptoKeyDataCtxPtr ctx, HCRYPTPROV hProv, BOOL fCallerFreeProv)
|
|
122
|
+
{
|
|
123
|
+
xmlSecAssert(ctx != NULL);
|
|
124
|
+
|
|
125
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
|
|
126
|
+
ctx->hProv = hProv;
|
|
127
|
+
ctx->fCallerFreeProv = fCallerFreeProv;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static int
|
|
131
|
+
xmlSecMSCryptoKeyDataCtxDuplicateProvider(xmlSecMSCryptoKeyDataCtxPtr ctxDst, xmlSecMSCryptoKeyDataCtxPtr ctxSrc) {
|
|
132
|
+
xmlSecAssert2(ctxDst != NULL, -1);
|
|
133
|
+
xmlSecAssert2(ctxSrc != NULL, -1);
|
|
134
|
+
|
|
135
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctxDst);
|
|
136
|
+
|
|
137
|
+
if(ctxSrc->hProv != 0) {
|
|
138
|
+
if(!CryptContextAddRef(ctxSrc->hProv, NULL, 0)) {
|
|
139
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
140
|
+
NULL,
|
|
141
|
+
"CryptContextAddRef",
|
|
142
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
143
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
144
|
+
return(-1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
ctxDst->hProv = ctxSrc->hProv;
|
|
148
|
+
ctxDst->fCallerFreeProv = TRUE;
|
|
149
|
+
}
|
|
150
|
+
return(0);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
/******************************** Key *****************************************/
|
|
155
|
+
#define xmlSecMSCryptoKeyDataCtxGetKey(ctx) ((ctx)->hKey)
|
|
156
|
+
|
|
157
|
+
static void
|
|
158
|
+
xmlSecMSCryptoKeyDataCtxCreateKey(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
159
|
+
xmlSecAssert(ctx != NULL);
|
|
160
|
+
|
|
161
|
+
ctx->hKey = 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static void
|
|
165
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
166
|
+
xmlSecAssert(ctx != NULL);
|
|
167
|
+
|
|
168
|
+
if (ctx->hKey != 0) {
|
|
169
|
+
CryptDestroyKey(ctx->hKey);
|
|
170
|
+
}
|
|
171
|
+
ctx->hKey = 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
static void
|
|
175
|
+
xmlSecMSCryptoKeyDataCtxSetKey(xmlSecMSCryptoKeyDataCtxPtr ctx, HCRYPTKEY hKey) {
|
|
176
|
+
xmlSecAssert(ctx != NULL);
|
|
177
|
+
|
|
178
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(ctx);
|
|
179
|
+
ctx->hKey = hKey;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
static int
|
|
183
|
+
xmlSecMSCryptoKeyDataCtxDuplicateKey(xmlSecMSCryptoKeyDataCtxPtr ctxDst, xmlSecMSCryptoKeyDataCtxPtr ctxSrc) {
|
|
184
|
+
xmlSecAssert2(ctxDst != NULL, -1);
|
|
185
|
+
xmlSecAssert2(ctxSrc != NULL, -1);
|
|
186
|
+
|
|
187
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(ctxDst);
|
|
188
|
+
if (ctxSrc->hKey != 0) {
|
|
189
|
+
if (!CryptDuplicateKey(ctxSrc->hKey, NULL, 0, &(ctxDst->hKey))) {
|
|
190
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
191
|
+
NULL,
|
|
192
|
+
"CryptDuplicateKey",
|
|
193
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
194
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
195
|
+
return(-1);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return(0);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#else /* XMLSEC_MSCRYPTO_NT4 */
|
|
203
|
+
|
|
204
|
+
/******************************** Provider *****************************************/
|
|
205
|
+
#define xmlSecMSCryptoKeyDataCtxGetProvider(ctx) (((ctx)->p_prov) ? ((ctx)->p_prov->hProv) : 0)
|
|
206
|
+
|
|
207
|
+
static void
|
|
208
|
+
xmlSecMSCryptoKeyDataCtxCreateProvider(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
209
|
+
xmlSecAssert(ctx != NULL);
|
|
210
|
+
|
|
211
|
+
ctx->p_prov = (struct _mscrypt_prov*)xmlMalloc(sizeof(struct _mscrypt_prov));
|
|
212
|
+
if(ctx->p_prov == NULL ) {
|
|
213
|
+
xmlSecError( XMLSEC_ERRORS_HERE,
|
|
214
|
+
"mscrypt_create_prov" ,
|
|
215
|
+
NULL,
|
|
216
|
+
XMLSEC_ERRORS_R_MALLOC_FAILED ,
|
|
217
|
+
XMLSEC_ERRORS_NO_MESSAGE
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
memset(ctx->p_prov, 0, sizeof(struct _mscrypt_prov));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static void
|
|
224
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
225
|
+
xmlSecAssert(ctx != NULL);
|
|
226
|
+
|
|
227
|
+
if(ctx->p_prov != NULL) {
|
|
228
|
+
if(InterlockedDecrement(&(ctx->p_prov->refcnt)) <= 0) {
|
|
229
|
+
if((ctx->p_prov->hProv != 0) && (ctx->p_prov->fCallerFreeProv)) {
|
|
230
|
+
CryptReleaseContext(ctx->p_prov->hProv, 0) ;
|
|
231
|
+
}
|
|
232
|
+
memset(ctx->p_prov, 0, sizeof(struct _mscrypt_prov));
|
|
233
|
+
xmlFree(ctx->p_prov) ;
|
|
234
|
+
}
|
|
235
|
+
ctx->p_prov = NULL;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static void
|
|
240
|
+
xmlSecMSCryptoKeyDataCtxSetProvider(xmlSecMSCryptoKeyDataCtxPtr ctx, HCRYPTPROV hProv, BOOL fCallerFreeProv)
|
|
241
|
+
{
|
|
242
|
+
xmlSecAssert(ctx != NULL);
|
|
243
|
+
|
|
244
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
|
|
245
|
+
|
|
246
|
+
if((ctx->p_prov != NULL) && (ctx->p_prov->refcnt == 1)) {
|
|
247
|
+
if((ctx->p_prov->hProv != 0) && (ctx->p_prov->fCallerFreeProv)) {
|
|
248
|
+
CryptReleaseContext(ctx->p_prov->hProv, 0) ;
|
|
249
|
+
}
|
|
250
|
+
memset(ctx->p_prov, 0, sizeof(struct _mscrypt_prov));
|
|
251
|
+
} else {
|
|
252
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
|
|
253
|
+
xmlSecMSCryptoKeyDataCtxCreateProvider(ctx);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
ctx->p_prov->hProv = hProv;
|
|
257
|
+
ctx->p_prov->fCallerFreeProv = fCallerFreeProv;
|
|
258
|
+
ctx->p_prov->refcnt = 1;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
static int
|
|
262
|
+
xmlSecMSCryptoKeyDataCtxDuplicateProvider(xmlSecMSCryptoKeyDataCtxPtr ctxDst, xmlSecMSCryptoKeyDataCtxPtr ctxSrc) {
|
|
263
|
+
xmlSecAssert2(ctxDst != NULL, -1);
|
|
264
|
+
xmlSecAssert2(ctxSrc != NULL, -1);
|
|
265
|
+
|
|
266
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctxDst);
|
|
267
|
+
|
|
268
|
+
if (ctxSrc->p_prov != NULL) {
|
|
269
|
+
ctxDst->p_prov = ctxSrc->p_prov;
|
|
270
|
+
InterlockedIncrement(&(ctxDst->p_prov->refcnt));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return(0);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/******************************** Key *****************************************/
|
|
277
|
+
#define xmlSecMSCryptoKeyDataCtxGetKey(ctx) (((ctx)->p_key) ? ((ctx)->p_key->hKey) : 0)
|
|
278
|
+
|
|
279
|
+
static void
|
|
280
|
+
xmlSecMSCryptoKeyDataCtxCreateKey(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
281
|
+
xmlSecAssert(ctx != NULL);
|
|
282
|
+
|
|
283
|
+
ctx->p_key = (struct _mscrypt_key*)xmlMalloc(sizeof(struct _mscrypt_key));
|
|
284
|
+
if(ctx->p_key == NULL ) {
|
|
285
|
+
xmlSecError( XMLSEC_ERRORS_HERE,
|
|
286
|
+
"mscrypt_create_key" ,
|
|
287
|
+
NULL,
|
|
288
|
+
XMLSEC_ERRORS_R_MALLOC_FAILED ,
|
|
289
|
+
XMLSEC_ERRORS_NO_MESSAGE
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
memset(ctx->p_key, 0, sizeof(struct _mscrypt_key));
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
static void
|
|
296
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
297
|
+
xmlSecAssert(ctx != NULL);
|
|
298
|
+
|
|
299
|
+
if(ctx->p_key != NULL) {
|
|
300
|
+
if(InterlockedDecrement(&(ctx->p_key->refcnt)) <= 0) {
|
|
301
|
+
if(ctx->p_key->hKey != 0) {
|
|
302
|
+
CryptDestroyKey(ctx->p_key->hKey) ;
|
|
303
|
+
}
|
|
304
|
+
memset(ctx->p_key, 0, sizeof(struct _mscrypt_key));
|
|
305
|
+
xmlFree(ctx->p_key) ;
|
|
306
|
+
}
|
|
307
|
+
ctx->p_key = NULL;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
static void
|
|
312
|
+
xmlSecMSCryptoKeyDataCtxSetKey(xmlSecMSCryptoKeyDataCtxPtr ctx, HCRYPTKEY hKey) {
|
|
313
|
+
xmlSecAssert(ctx != NULL);
|
|
314
|
+
|
|
315
|
+
if((ctx->p_key != NULL) && (ctx->p_key->refcnt == 1)) {
|
|
316
|
+
if(ctx->p_key->hKey != 0) {
|
|
317
|
+
CryptDestroyKey(ctx->p_key->hKey) ;
|
|
318
|
+
}
|
|
319
|
+
memset(ctx->p_key, 0, sizeof(struct _mscrypt_key));
|
|
320
|
+
} else {
|
|
321
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(ctx);
|
|
322
|
+
xmlSecMSCryptoKeyDataCtxCreateKey(ctx);
|
|
323
|
+
}
|
|
324
|
+
ctx->p_key->hKey = hKey;
|
|
325
|
+
ctx->p_key->refcnt = 1;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
static int
|
|
329
|
+
xmlSecMSCryptoKeyDataCtxDuplicateKey(xmlSecMSCryptoKeyDataCtxPtr ctxDst, xmlSecMSCryptoKeyDataCtxPtr ctxSrc) {
|
|
330
|
+
xmlSecAssert2(ctxDst != NULL, -1);
|
|
331
|
+
xmlSecAssert2(ctxSrc != NULL, -1);
|
|
332
|
+
|
|
333
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(ctxDst);
|
|
334
|
+
if (ctxSrc->p_key != NULL) {
|
|
335
|
+
ctxDst->p_key = ctxSrc->p_key;
|
|
336
|
+
InterlockedIncrement(&(ctxDst->p_key->refcnt));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return(0);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
#endif /* XMLSEC_MSCRYPTO_NT4 */
|
|
343
|
+
|
|
344
|
+
/******************************** Cert *****************************************/
|
|
345
|
+
#define xmlSecMSCryptoKeyDataCtxGetCert(ctx) ((ctx)->pCert)
|
|
346
|
+
|
|
347
|
+
static void
|
|
348
|
+
xmlSecMSCryptoKeyDataCtxCreateCert(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
349
|
+
xmlSecAssert(ctx != NULL);
|
|
350
|
+
|
|
351
|
+
ctx->pCert = NULL;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
static void
|
|
355
|
+
xmlSecMSCryptoKeyDataCtxDestroyCert(xmlSecMSCryptoKeyDataCtxPtr ctx) {
|
|
356
|
+
xmlSecAssert(ctx != NULL);
|
|
357
|
+
|
|
358
|
+
if(ctx->pCert != NULL) {
|
|
359
|
+
CertFreeCertificateContext(ctx->pCert);
|
|
360
|
+
}
|
|
361
|
+
ctx->pCert = NULL;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
static void
|
|
365
|
+
xmlSecMSCryptoKeyDataCtxSetCert(xmlSecMSCryptoKeyDataCtxPtr ctx, PCCERT_CONTEXT pCert) {
|
|
366
|
+
xmlSecAssert(ctx != NULL);
|
|
367
|
+
|
|
368
|
+
xmlSecMSCryptoKeyDataCtxDestroyCert(ctx);
|
|
369
|
+
ctx->pCert = pCert;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
static int
|
|
373
|
+
xmlSecMSCryptoKeyDataCtxDuplicateCert(xmlSecMSCryptoKeyDataCtxPtr ctxDst, xmlSecMSCryptoKeyDataCtxPtr ctxSrc) {
|
|
374
|
+
xmlSecAssert2(ctxDst != NULL, -1);
|
|
375
|
+
xmlSecAssert2(ctxSrc != NULL, -1);
|
|
376
|
+
|
|
377
|
+
xmlSecMSCryptoKeyDataCtxDestroyCert(ctxDst);
|
|
378
|
+
if(ctxSrc->pCert != NULL) {
|
|
379
|
+
ctxDst->pCert = xmlSecMSCryptoCertDup(ctxSrc->pCert);
|
|
380
|
+
if(ctxDst->pCert == NULL) {
|
|
381
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
382
|
+
NULL,
|
|
383
|
+
"xmlSecMSCryptoPCCDup",
|
|
384
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
385
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
386
|
+
return(-1);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return(0);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/******************************************************************************
|
|
393
|
+
*
|
|
394
|
+
* xmlSecMSCryptoKeyDataCtx is located after xmlSecTransform
|
|
395
|
+
*
|
|
396
|
+
*****************************************************************************/
|
|
397
|
+
#define xmlSecMSCryptoKeyDataSize \
|
|
398
|
+
(sizeof(xmlSecKeyData) + sizeof(xmlSecMSCryptoKeyDataCtx))
|
|
399
|
+
#define xmlSecMSCryptoKeyDataGetCtx(data) \
|
|
400
|
+
((xmlSecMSCryptoKeyDataCtxPtr)(((xmlSecByte*)(data)) + sizeof(xmlSecKeyData)))
|
|
401
|
+
|
|
402
|
+
static int xmlSecMSCryptoKeyDataDuplicate (xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src);
|
|
403
|
+
static void xmlSecMSCryptoKeyDataFinalize (xmlSecKeyDataPtr data);
|
|
404
|
+
static int xmlSecMSCryptoKeyDataGetSize (xmlSecKeyDataPtr data);
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* xmlSecMSCryptoKeyDataAdoptCert:
|
|
408
|
+
* @data: the pointer to MSCrypto pccert data.
|
|
409
|
+
* @pCert: the pointer to PCCERT key.
|
|
410
|
+
*
|
|
411
|
+
* Sets the value of key data.
|
|
412
|
+
*
|
|
413
|
+
* Returns: 0 on success or a negative value otherwise.
|
|
414
|
+
*/
|
|
415
|
+
static int
|
|
416
|
+
xmlSecMSCryptoKeyDataAdoptCert(xmlSecKeyDataPtr data, PCCERT_CONTEXT pCert, xmlSecKeyDataType type) {
|
|
417
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
418
|
+
HCRYPTKEY hKey = 0;
|
|
419
|
+
|
|
420
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), -1);
|
|
421
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), -1);
|
|
422
|
+
xmlSecAssert2(pCert != NULL, -1);
|
|
423
|
+
xmlSecAssert2(pCert->pCertInfo != NULL, -1);
|
|
424
|
+
xmlSecAssert2((type & (xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate)) != 0, -1);
|
|
425
|
+
|
|
426
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
427
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
428
|
+
|
|
429
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
|
|
430
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(ctx);
|
|
431
|
+
xmlSecMSCryptoKeyDataCtxDestroyCert(ctx);
|
|
432
|
+
|
|
433
|
+
ctx->type = type;
|
|
434
|
+
|
|
435
|
+
/* Now we acquire a context for this key(pair). The context is needed
|
|
436
|
+
* for the real crypto stuff in MS Crypto.
|
|
437
|
+
*/
|
|
438
|
+
if((type & xmlSecKeyDataTypePrivate) != 0){
|
|
439
|
+
HCRYPTPROV hProv = 0;
|
|
440
|
+
BOOL fCallerFreeProv = FALSE;
|
|
441
|
+
|
|
442
|
+
if (!CryptAcquireCertificatePrivateKey(pCert,
|
|
443
|
+
CRYPT_ACQUIRE_SILENT_FLAG | CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
|
|
444
|
+
NULL,
|
|
445
|
+
&hProv,
|
|
446
|
+
&(ctx->dwKeySpec),
|
|
447
|
+
&fCallerFreeProv)) {
|
|
448
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
449
|
+
NULL,
|
|
450
|
+
"CryptAcquireCertificatePrivateKey",
|
|
451
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
452
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
453
|
+
return(-1);
|
|
454
|
+
}
|
|
455
|
+
xmlSecMSCryptoKeyDataCtxSetProvider(ctx, hProv, fCallerFreeProv);
|
|
456
|
+
} else if((type & xmlSecKeyDataTypePublic) != 0){
|
|
457
|
+
HCRYPTPROV hProv;
|
|
458
|
+
|
|
459
|
+
hProv = xmlSecMSCryptoFindProvider(ctx->providers, NULL, CRYPT_VERIFYCONTEXT, FALSE);
|
|
460
|
+
if (hProv == 0) {
|
|
461
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
462
|
+
NULL,
|
|
463
|
+
"xmlSecMSCryptoFindProvider",
|
|
464
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
465
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
466
|
+
return(-1);
|
|
467
|
+
}
|
|
468
|
+
xmlSecMSCryptoKeyDataCtxSetProvider(ctx, hProv, TRUE);
|
|
469
|
+
ctx->dwKeySpec = 0;
|
|
470
|
+
} else {
|
|
471
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
472
|
+
NULL,
|
|
473
|
+
NULL,
|
|
474
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
475
|
+
"Unsupported keytype");
|
|
476
|
+
return(-1);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* CryptImportPublicKeyInfo is only needed when a real key handle
|
|
480
|
+
* is needed. The key handle is needed for de/encrypting and for
|
|
481
|
+
* verifying of a signature, *not* for signing. We could call
|
|
482
|
+
* CryptImportPublicKeyInfo in xmlSecMSCryptoKeyDataGetKey instead
|
|
483
|
+
* so no unnessecary calls to CryptImportPublicKeyInfo are being
|
|
484
|
+
* made. WK
|
|
485
|
+
*/
|
|
486
|
+
if(!CryptImportPublicKeyInfo(xmlSecMSCryptoKeyDataCtxGetProvider(ctx),
|
|
487
|
+
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
|
|
488
|
+
&(pCert->pCertInfo->SubjectPublicKeyInfo),
|
|
489
|
+
&hKey)) {
|
|
490
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
491
|
+
NULL,
|
|
492
|
+
"CryptImportPublicKeyInfo",
|
|
493
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
494
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
495
|
+
return(-1);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
xmlSecMSCryptoKeyDataCtxSetKey(ctx, hKey);
|
|
499
|
+
xmlSecMSCryptoKeyDataCtxSetCert(ctx, pCert);
|
|
500
|
+
return(0);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
static int
|
|
504
|
+
xmlSecMSCryptoKeyDataAdoptKey(xmlSecKeyDataPtr data,
|
|
505
|
+
HCRYPTPROV hProv,
|
|
506
|
+
BOOL fCallerFreeProv,
|
|
507
|
+
HCRYPTKEY hKey,
|
|
508
|
+
DWORD dwKeySpec,
|
|
509
|
+
xmlSecKeyDataType type) {
|
|
510
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
511
|
+
|
|
512
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), -1);
|
|
513
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), -1);
|
|
514
|
+
xmlSecAssert2(hKey != 0, -1);
|
|
515
|
+
xmlSecAssert2(type & (xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate), -1);
|
|
516
|
+
|
|
517
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
518
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
519
|
+
|
|
520
|
+
xmlSecMSCryptoKeyDataCtxSetProvider(ctx, hProv, fCallerFreeProv);
|
|
521
|
+
xmlSecMSCryptoKeyDataCtxSetKey(ctx, hKey);
|
|
522
|
+
xmlSecMSCryptoKeyDataCtxSetCert(ctx, NULL);
|
|
523
|
+
|
|
524
|
+
ctx->dwKeySpec = dwKeySpec;
|
|
525
|
+
ctx->type = type;
|
|
526
|
+
|
|
527
|
+
return(0);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* xmlSecMSCryptoKeyDataGetKey:
|
|
532
|
+
* @data: the key data to retrieve certificate from.
|
|
533
|
+
* @type: type of key requested (public/private)
|
|
534
|
+
*
|
|
535
|
+
* Native MSCrypto key retrieval from xmlsec keydata. The
|
|
536
|
+
* returned HKEY must not be destroyed by the caller.
|
|
537
|
+
*
|
|
538
|
+
* Returns: HKEY on success or NULL otherwise.
|
|
539
|
+
*/
|
|
540
|
+
HCRYPTKEY
|
|
541
|
+
xmlSecMSCryptoKeyDataGetKey(xmlSecKeyDataPtr data, xmlSecKeyDataType type) {
|
|
542
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
543
|
+
|
|
544
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), 0);
|
|
545
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), 0);
|
|
546
|
+
|
|
547
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
548
|
+
xmlSecAssert2(ctx != NULL, 0);
|
|
549
|
+
|
|
550
|
+
return(xmlSecMSCryptoKeyDataCtxGetKey(ctx));
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* xmlSecMSCryptoKeyDataGetDecryptKey:
|
|
555
|
+
* @data: the key data pointer
|
|
556
|
+
*
|
|
557
|
+
* Native MSCrypto decrypt key retrieval from xmlsec keydata. The
|
|
558
|
+
* returned HKEY must not be destroyed by the caller.
|
|
559
|
+
*
|
|
560
|
+
* Returns: HKEY on success or NULL otherwise.
|
|
561
|
+
*/
|
|
562
|
+
HCRYPTKEY
|
|
563
|
+
xmlSecMSCryptoKeyDataGetDecryptKey(xmlSecKeyDataPtr data) {
|
|
564
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
565
|
+
HCRYPTKEY hKey;
|
|
566
|
+
|
|
567
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), 0);
|
|
568
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), 0);
|
|
569
|
+
|
|
570
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
571
|
+
xmlSecAssert2(ctx != NULL, 0);
|
|
572
|
+
|
|
573
|
+
if( !CryptGetUserKey(xmlSecMSCryptoKeyDataCtxGetProvider(ctx), AT_KEYEXCHANGE, &(hKey))) {
|
|
574
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
575
|
+
NULL,
|
|
576
|
+
"CryptGetUserKey",
|
|
577
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
578
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
579
|
+
return(0);
|
|
580
|
+
}
|
|
581
|
+
return (hKey);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* xmlSecMSCryptoKeyDataGetCert:
|
|
586
|
+
* @data: the key data to retrieve certificate from.
|
|
587
|
+
*
|
|
588
|
+
* Native MSCrypto certificate retrieval from xmlsec keydata. The
|
|
589
|
+
* returned PCCERT_CONTEXT must not be released by the caller.
|
|
590
|
+
*
|
|
591
|
+
* Returns: PCCERT_CONTEXT on success or NULL otherwise.
|
|
592
|
+
*/
|
|
593
|
+
PCCERT_CONTEXT
|
|
594
|
+
xmlSecMSCryptoKeyDataGetCert(xmlSecKeyDataPtr data) {
|
|
595
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
596
|
+
|
|
597
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), 0);
|
|
598
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), 0);
|
|
599
|
+
|
|
600
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
601
|
+
xmlSecAssert2(ctx != NULL, 0);
|
|
602
|
+
|
|
603
|
+
return(xmlSecMSCryptoKeyDataCtxGetCert(ctx));
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* xmlSecMSCryptoKeyDataGetMSCryptoProvider:
|
|
608
|
+
* @data: the key data
|
|
609
|
+
*
|
|
610
|
+
* Gets crypto provider handle
|
|
611
|
+
*
|
|
612
|
+
* Returns: the crypto provider handler or 0 if there is an error.
|
|
613
|
+
*/
|
|
614
|
+
HCRYPTPROV
|
|
615
|
+
xmlSecMSCryptoKeyDataGetMSCryptoProvider(xmlSecKeyDataPtr data) {
|
|
616
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
617
|
+
|
|
618
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), 0);
|
|
619
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), 0);
|
|
620
|
+
|
|
621
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
622
|
+
xmlSecAssert2(ctx != NULL, 0);
|
|
623
|
+
|
|
624
|
+
return(xmlSecMSCryptoKeyDataCtxGetProvider(ctx));
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* xmlSecMSCryptoKeyDataGetMSCryptoKeySpec:
|
|
629
|
+
* @data: the key data
|
|
630
|
+
*
|
|
631
|
+
* Gets key spec info.
|
|
632
|
+
*
|
|
633
|
+
* Returns: the key spec info from key data
|
|
634
|
+
*/
|
|
635
|
+
DWORD
|
|
636
|
+
xmlSecMSCryptoKeyDataGetMSCryptoKeySpec(xmlSecKeyDataPtr data) {
|
|
637
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
638
|
+
|
|
639
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), 0);
|
|
640
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), 0);
|
|
641
|
+
|
|
642
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
643
|
+
xmlSecAssert2(ctx != NULL, 0);
|
|
644
|
+
|
|
645
|
+
return(ctx->dwKeySpec);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
static int
|
|
649
|
+
xmlSecMSCryptoKeyDataDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) {
|
|
650
|
+
xmlSecMSCryptoKeyDataCtxPtr ctxDst;
|
|
651
|
+
xmlSecMSCryptoKeyDataCtxPtr ctxSrc;
|
|
652
|
+
|
|
653
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(dst), -1);
|
|
654
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(dst, xmlSecMSCryptoKeyDataSize), -1);
|
|
655
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(src), -1);
|
|
656
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(src, xmlSecMSCryptoKeyDataSize), -1);
|
|
657
|
+
|
|
658
|
+
ctxDst = xmlSecMSCryptoKeyDataGetCtx(dst);
|
|
659
|
+
xmlSecAssert2(ctxDst != NULL, -1);
|
|
660
|
+
|
|
661
|
+
ctxSrc = xmlSecMSCryptoKeyDataGetCtx(src);
|
|
662
|
+
xmlSecAssert2(ctxSrc != NULL, -1);
|
|
663
|
+
|
|
664
|
+
if(xmlSecMSCryptoKeyDataCtxDuplicateProvider(ctxDst, ctxSrc) < 0) {
|
|
665
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
666
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)),
|
|
667
|
+
"xmlSecMSCryptoKeyDataCtxDuplicateProvider",
|
|
668
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
669
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
670
|
+
return(-1);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if(xmlSecMSCryptoKeyDataCtxDuplicateKey(ctxDst, ctxSrc) < 0) {
|
|
674
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
675
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)),
|
|
676
|
+
"xmlSecMSCryptoKeyDataCtxDuplicateKey",
|
|
677
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
678
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
679
|
+
return(-1);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
if(xmlSecMSCryptoKeyDataCtxDuplicateCert(ctxDst, ctxSrc) < 0) {
|
|
683
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
684
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)),
|
|
685
|
+
"xmlSecMSCryptoKeyDataCtxDuplicateCert",
|
|
686
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
687
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
688
|
+
return(-1);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
ctxDst->dwKeySpec = ctxSrc->dwKeySpec;
|
|
692
|
+
ctxDst->providers = ctxSrc->providers;
|
|
693
|
+
ctxDst->type = ctxSrc->type;
|
|
694
|
+
|
|
695
|
+
return(0);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
static void
|
|
699
|
+
xmlSecMSCryptoKeyDataInitialize(xmlSecKeyDataPtr data) {
|
|
700
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
701
|
+
|
|
702
|
+
xmlSecAssert(xmlSecKeyDataIsValid(data));
|
|
703
|
+
xmlSecAssert(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize));
|
|
704
|
+
|
|
705
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
706
|
+
xmlSecAssert(ctx != NULL);
|
|
707
|
+
|
|
708
|
+
memset(ctx, 0, sizeof(xmlSecMSCryptoKeyDataCtx));
|
|
709
|
+
|
|
710
|
+
xmlSecMSCryptoKeyDataCtxCreateProvider(ctx);
|
|
711
|
+
xmlSecMSCryptoKeyDataCtxCreateKey(ctx);
|
|
712
|
+
xmlSecMSCryptoKeyDataCtxCreateCert(ctx);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
static void
|
|
716
|
+
xmlSecMSCryptoKeyDataFinalize(xmlSecKeyDataPtr data) {
|
|
717
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
718
|
+
|
|
719
|
+
xmlSecAssert(xmlSecKeyDataIsValid(data));
|
|
720
|
+
xmlSecAssert(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize));
|
|
721
|
+
|
|
722
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
723
|
+
xmlSecAssert(ctx != NULL);
|
|
724
|
+
|
|
725
|
+
xmlSecMSCryptoKeyDataCtxDestroyKey(ctx);
|
|
726
|
+
xmlSecMSCryptoKeyDataCtxDestroyCert(ctx);
|
|
727
|
+
xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
|
|
728
|
+
|
|
729
|
+
memset(ctx, 0, sizeof(xmlSecMSCryptoKeyDataCtx));
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
static int
|
|
733
|
+
xmlSecMSCryptoKeyDataGetSize(xmlSecKeyDataPtr data) {
|
|
734
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
735
|
+
|
|
736
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), 0);
|
|
737
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), 0);
|
|
738
|
+
|
|
739
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
740
|
+
xmlSecAssert2(ctx != NULL, 0);
|
|
741
|
+
|
|
742
|
+
if(xmlSecMSCryptoKeyDataCtxGetCert(ctx) != NULL) {
|
|
743
|
+
xmlSecAssert2(xmlSecMSCryptoKeyDataCtxGetCert(ctx)->pCertInfo != NULL, 0);
|
|
744
|
+
return (CertGetPublicKeyLength(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
|
|
745
|
+
&(xmlSecMSCryptoKeyDataCtxGetCert(ctx)->pCertInfo->SubjectPublicKeyInfo)));
|
|
746
|
+
} else if (xmlSecMSCryptoKeyDataCtxGetKey(ctx) != 0) {
|
|
747
|
+
DWORD length = 0;
|
|
748
|
+
DWORD lenlen = sizeof(DWORD);
|
|
749
|
+
|
|
750
|
+
if (!CryptGetKeyParam(xmlSecMSCryptoKeyDataCtxGetKey(ctx), KP_KEYLEN, (BYTE *)&length, &lenlen, 0)) {
|
|
751
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
752
|
+
NULL,
|
|
753
|
+
"CertDuplicateCertificateContext",
|
|
754
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
755
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
756
|
+
return(0);
|
|
757
|
+
}
|
|
758
|
+
return(length);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return (0);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
static xmlSecKeyDataType
|
|
765
|
+
xmlSecMSCryptoKeyDataGetType(xmlSecKeyDataPtr data) {
|
|
766
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
767
|
+
|
|
768
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), xmlSecKeyDataTypeUnknown);
|
|
769
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), xmlSecKeyDataTypeUnknown);
|
|
770
|
+
|
|
771
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
772
|
+
xmlSecAssert2(ctx != NULL, xmlSecKeyDataTypeUnknown);
|
|
773
|
+
|
|
774
|
+
/* We could make a call to CryptFindCertificateKeyProvInfo here, to find out if
|
|
775
|
+
* we *really* have a private key or not. However if the certificate is not
|
|
776
|
+
* linked to a private key, the call takes an ridiculous amount of time.
|
|
777
|
+
* the way it is now is better I think. WK.
|
|
778
|
+
*/
|
|
779
|
+
return(ctx->type);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* xmlSecMSCryptoCertDup:
|
|
784
|
+
* @pCert: the pointer to cert.
|
|
785
|
+
*
|
|
786
|
+
* Duplicates the @pCert.
|
|
787
|
+
*
|
|
788
|
+
* Returns: pointer to newly created PCCERT_CONTEXT object or
|
|
789
|
+
* NULL if an error occurs.
|
|
790
|
+
*/
|
|
791
|
+
PCCERT_CONTEXT xmlSecMSCryptoCertDup(PCCERT_CONTEXT pCert) {
|
|
792
|
+
PCCERT_CONTEXT ret;
|
|
793
|
+
|
|
794
|
+
xmlSecAssert2(pCert != NULL, NULL);
|
|
795
|
+
|
|
796
|
+
ret = CertDuplicateCertificateContext(pCert);
|
|
797
|
+
if(ret == NULL) {
|
|
798
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
799
|
+
NULL,
|
|
800
|
+
"CertDuplicateCertificateContext",
|
|
801
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
802
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
803
|
+
return(NULL);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
return(ret);
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* xmlSecMSCryptoCertAdopt:
|
|
812
|
+
* @pCert: the pointer to cert.
|
|
813
|
+
* @type: the expected key type.
|
|
814
|
+
*
|
|
815
|
+
* Creates key data value from the cert.
|
|
816
|
+
*
|
|
817
|
+
* Returns: pointer to newly created xmlsec key or NULL if an error occurs.
|
|
818
|
+
*/
|
|
819
|
+
xmlSecKeyDataPtr
|
|
820
|
+
xmlSecMSCryptoCertAdopt(PCCERT_CONTEXT pCert, xmlSecKeyDataType type) {
|
|
821
|
+
xmlSecKeyDataPtr data = NULL;
|
|
822
|
+
int ret;
|
|
823
|
+
|
|
824
|
+
xmlSecAssert2(pCert != NULL, NULL);
|
|
825
|
+
xmlSecAssert2(pCert->pCertInfo != NULL, NULL);
|
|
826
|
+
xmlSecAssert2(pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId != NULL, NULL);
|
|
827
|
+
|
|
828
|
+
#ifndef XMLSEC_NO_RSA
|
|
829
|
+
if (!strcmp(pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, szOID_RSA_RSA)) {
|
|
830
|
+
data = xmlSecKeyDataCreate(xmlSecMSCryptoKeyDataRsaId);
|
|
831
|
+
if(data == NULL) {
|
|
832
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
833
|
+
NULL,
|
|
834
|
+
"xmlSecKeyDataCreate",
|
|
835
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
836
|
+
"xmlSecMSCryptoDataRsaId");
|
|
837
|
+
return(NULL);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
#endif /* XMLSEC_NO_RSA */
|
|
841
|
+
|
|
842
|
+
#ifndef XMLSEC_NO_DSA
|
|
843
|
+
if (!strcmp(pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, szOID_X957_DSA /*szOID_DSALG_SIGN*/)) {
|
|
844
|
+
data = xmlSecKeyDataCreate(xmlSecMSCryptoKeyDataDsaId);
|
|
845
|
+
if(data == NULL) {
|
|
846
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
847
|
+
NULL,
|
|
848
|
+
"xmlSecKeyDataCreate",
|
|
849
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
850
|
+
"xmlSecMSCryptoKeyDataDsaId");
|
|
851
|
+
return(NULL);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
#endif /* XMLSEC_NO_DSA */
|
|
855
|
+
|
|
856
|
+
#ifndef XMLSEC_NO_GOST
|
|
857
|
+
if (!strcmp(pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, szOID_MAGPRO_PUBKEY_SIGN_R3410_2001_CP) ||
|
|
858
|
+
!strcmp(pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, szOID_MAGPRO_PUBKEY_SIGN_R3410_2001) ||
|
|
859
|
+
!strcmp(pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId, szOID_MAGPRO_PUBKEY_SIGN_R3410_94_CP)) {
|
|
860
|
+
data = xmlSecKeyDataCreate(xmlSecMSCryptoKeyDataGost2001Id);
|
|
861
|
+
if(data == NULL) {
|
|
862
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
863
|
+
NULL,
|
|
864
|
+
"xmlSecKeyDataCreate",
|
|
865
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
866
|
+
"xmlSecMSCryptoKeyDataGost2001Id");
|
|
867
|
+
return(NULL);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
#endif /* XMLSEC_NO_GOST*/
|
|
871
|
+
|
|
872
|
+
if (NULL == data) {
|
|
873
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
874
|
+
NULL,
|
|
875
|
+
NULL,
|
|
876
|
+
XMLSEC_ERRORS_R_INVALID_TYPE,
|
|
877
|
+
"PCCERT_CONTEXT key type %s not supported", pCert->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId);
|
|
878
|
+
return(NULL);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
xmlSecAssert2(data != NULL, NULL);
|
|
882
|
+
|
|
883
|
+
ret = xmlSecMSCryptoKeyDataAdoptCert(data, pCert, type);
|
|
884
|
+
if(ret < 0) {
|
|
885
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
886
|
+
NULL,
|
|
887
|
+
"xmlSecMSCryptoPCCDataAdoptPCC",
|
|
888
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
889
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
890
|
+
xmlSecKeyDataDestroy(data);
|
|
891
|
+
return(NULL);
|
|
892
|
+
}
|
|
893
|
+
return(data);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
#ifndef XMLSEC_NO_RSA
|
|
898
|
+
/**************************************************************************
|
|
899
|
+
*
|
|
900
|
+
* <dsig:RSAKeyValue> processing
|
|
901
|
+
*
|
|
902
|
+
* http://www.w3.org/TR/xmldsig-core/#sec-RSAKeyValue
|
|
903
|
+
* The RSAKeyValue Element
|
|
904
|
+
*
|
|
905
|
+
* RSA key values have two fields: Modulus and Exponent.
|
|
906
|
+
*
|
|
907
|
+
* <RSAKeyValue>
|
|
908
|
+
* <Modulus>xA7SEU+e0yQH5rm9kbCDN9o3aPIo7HbP7tX6WOocLZAtNfyxSZDU16ksL6W
|
|
909
|
+
* jubafOqNEpcwR3RdFsT7bCqnXPBe5ELh5u4VEy19MzxkXRgrMvavzyBpVRgBUwUlV
|
|
910
|
+
* 5foK5hhmbktQhyNdy/6LpQRhDUDsTvK+g9Ucj47es9AQJ3U=
|
|
911
|
+
* </Modulus>
|
|
912
|
+
* <Exponent>AQAB</Exponent>
|
|
913
|
+
* </RSAKeyValue>
|
|
914
|
+
*
|
|
915
|
+
* Arbitrary-length integers (e.g. "bignums" such as RSA moduli) are
|
|
916
|
+
* represented in XML as octet strings as defined by the ds:CryptoBinary type.
|
|
917
|
+
*
|
|
918
|
+
* Schema Definition:
|
|
919
|
+
*
|
|
920
|
+
* <element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
|
|
921
|
+
* <complexType name="RSAKeyValueType">
|
|
922
|
+
* <sequence>
|
|
923
|
+
* <element name="Modulus" type="ds:CryptoBinary"/>
|
|
924
|
+
* <element name="Exponent" type="ds:CryptoBinary"/>
|
|
925
|
+
* </sequence>
|
|
926
|
+
* </complexType>
|
|
927
|
+
*
|
|
928
|
+
* DTD Definition:
|
|
929
|
+
*
|
|
930
|
+
* <!ELEMENT RSAKeyValue (Modulus, Exponent) >
|
|
931
|
+
* <!ELEMENT Modulus (#PCDATA) >
|
|
932
|
+
* <!ELEMENT Exponent (#PCDATA) >
|
|
933
|
+
*
|
|
934
|
+
* ============================================================================
|
|
935
|
+
*
|
|
936
|
+
*
|
|
937
|
+
*************************************************************************/
|
|
938
|
+
|
|
939
|
+
static int xmlSecMSCryptoKeyDataRsaInitialize(xmlSecKeyDataPtr data);
|
|
940
|
+
static int xmlSecMSCryptoKeyDataRsaDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src);
|
|
941
|
+
static void xmlSecMSCryptoKeyDataRsaFinalize(xmlSecKeyDataPtr data);
|
|
942
|
+
static int xmlSecMSCryptoKeyDataRsaXmlRead(xmlSecKeyDataId id,
|
|
943
|
+
xmlSecKeyPtr key,
|
|
944
|
+
xmlNodePtr node,
|
|
945
|
+
xmlSecKeyInfoCtxPtr keyInfoCtx);
|
|
946
|
+
static int xmlSecMSCryptoKeyDataRsaXmlWrite(xmlSecKeyDataId id,
|
|
947
|
+
xmlSecKeyPtr key,
|
|
948
|
+
xmlNodePtr node,
|
|
949
|
+
xmlSecKeyInfoCtxPtr keyInfoCtx);
|
|
950
|
+
static int xmlSecMSCryptoKeyDataRsaGenerate(xmlSecKeyDataPtr data,
|
|
951
|
+
xmlSecSize sizeBits,
|
|
952
|
+
xmlSecKeyDataType type);
|
|
953
|
+
|
|
954
|
+
static xmlSecKeyDataType xmlSecMSCryptoKeyDataRsaGetType(xmlSecKeyDataPtr data);
|
|
955
|
+
static xmlSecSize xmlSecMSCryptoKeyDataRsaGetSize(xmlSecKeyDataPtr data);
|
|
956
|
+
static void xmlSecMSCryptoKeyDataRsaDebugDump(xmlSecKeyDataPtr data, FILE* output);
|
|
957
|
+
static void xmlSecMSCryptoKeyDataRsaDebugXmlDump(xmlSecKeyDataPtr data, FILE* output);
|
|
958
|
+
|
|
959
|
+
static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataRsaKlass = {
|
|
960
|
+
sizeof(xmlSecKeyDataKlass),
|
|
961
|
+
xmlSecMSCryptoKeyDataSize,
|
|
962
|
+
|
|
963
|
+
/* data */
|
|
964
|
+
xmlSecNameRSAKeyValue,
|
|
965
|
+
xmlSecKeyDataUsageKeyValueNode | xmlSecKeyDataUsageRetrievalMethodNodeXml,
|
|
966
|
+
/* xmlSecKeyDataUsage usage; */
|
|
967
|
+
xmlSecHrefRSAKeyValue, /* const xmlChar* href; */
|
|
968
|
+
xmlSecNodeRSAKeyValue, /* const xmlChar* dataNodeName; */
|
|
969
|
+
xmlSecDSigNs, /* const xmlChar* dataNodeNs; */
|
|
970
|
+
|
|
971
|
+
/* constructors/destructor */
|
|
972
|
+
xmlSecMSCryptoKeyDataRsaInitialize, /* xmlSecKeyDataInitializeMethod initialize; */
|
|
973
|
+
xmlSecMSCryptoKeyDataRsaDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */
|
|
974
|
+
xmlSecMSCryptoKeyDataRsaFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */
|
|
975
|
+
xmlSecMSCryptoKeyDataRsaGenerate, /* xmlSecKeyDataGenerateMethod generate; */
|
|
976
|
+
|
|
977
|
+
/* get info */
|
|
978
|
+
xmlSecMSCryptoKeyDataRsaGetType, /* xmlSecKeyDataGetTypeMethod getType; */
|
|
979
|
+
xmlSecMSCryptoKeyDataRsaGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */
|
|
980
|
+
NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */
|
|
981
|
+
|
|
982
|
+
/* read/write */
|
|
983
|
+
xmlSecMSCryptoKeyDataRsaXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */
|
|
984
|
+
xmlSecMSCryptoKeyDataRsaXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */
|
|
985
|
+
NULL, /* xmlSecKeyDataBinReadMethod binRead; */
|
|
986
|
+
NULL, /* xmlSecKeyDataBinWriteMethod binWrite; */
|
|
987
|
+
|
|
988
|
+
/* debug */
|
|
989
|
+
xmlSecMSCryptoKeyDataRsaDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */
|
|
990
|
+
xmlSecMSCryptoKeyDataRsaDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */
|
|
991
|
+
|
|
992
|
+
/* reserved for the future */
|
|
993
|
+
NULL, /* void* reserved0; */
|
|
994
|
+
NULL, /* void* reserved1; */
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
/* Ordered list of providers to search for algorithm implementation using
|
|
998
|
+
* xmlSecMSCryptoFindProvider() function
|
|
999
|
+
*
|
|
1000
|
+
* MUST END with { NULL, 0 } !!!
|
|
1001
|
+
*/
|
|
1002
|
+
static xmlSecMSCryptoProviderInfo xmlSecMSCryptoProviderInfo_Rsa[] = {
|
|
1003
|
+
{ XMLSEC_CRYPTO_MS_ENH_RSA_AES_PROV, PROV_RSA_AES},
|
|
1004
|
+
{ XMLSEC_CRYPTO_MS_ENH_RSA_AES_PROV_PROTOTYPE, PROV_RSA_AES },
|
|
1005
|
+
{ MS_STRONG_PROV, PROV_RSA_FULL },
|
|
1006
|
+
{ MS_ENHANCED_PROV, PROV_RSA_FULL },
|
|
1007
|
+
{ MS_DEF_PROV, PROV_RSA_FULL },
|
|
1008
|
+
{ NULL, 0 }
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* xmlSecMSCryptoKeyDataRsaGetKlass:
|
|
1013
|
+
*
|
|
1014
|
+
* The MSCrypto RSA CertKey data klass.
|
|
1015
|
+
*
|
|
1016
|
+
* Returns: pointer to MSCrypto RSA key data klass.
|
|
1017
|
+
*/
|
|
1018
|
+
xmlSecKeyDataId
|
|
1019
|
+
xmlSecMSCryptoKeyDataRsaGetKlass(void) {
|
|
1020
|
+
return(&xmlSecMSCryptoKeyDataRsaKlass);
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
static int
|
|
1024
|
+
xmlSecMSCryptoKeyDataRsaInitialize(xmlSecKeyDataPtr data) {
|
|
1025
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
1026
|
+
|
|
1027
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataRsaId), xmlSecKeyDataTypeUnknown);
|
|
1028
|
+
|
|
1029
|
+
xmlSecMSCryptoKeyDataInitialize(data);
|
|
1030
|
+
|
|
1031
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
1032
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1033
|
+
|
|
1034
|
+
ctx->providers = xmlSecMSCryptoProviderInfo_Rsa;
|
|
1035
|
+
return(0);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
static int
|
|
1039
|
+
xmlSecMSCryptoKeyDataRsaDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) {
|
|
1040
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(dst, xmlSecMSCryptoKeyDataRsaId), -1);
|
|
1041
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(src, xmlSecMSCryptoKeyDataRsaId), -1);
|
|
1042
|
+
|
|
1043
|
+
return(xmlSecMSCryptoKeyDataDuplicate(dst, src));
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
static void
|
|
1047
|
+
xmlSecMSCryptoKeyDataRsaFinalize(xmlSecKeyDataPtr data) {
|
|
1048
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataRsaId));
|
|
1049
|
+
|
|
1050
|
+
xmlSecMSCryptoKeyDataFinalize(data);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
static int
|
|
1054
|
+
xmlSecMSCryptoKeyDataRsaXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
|
|
1055
|
+
xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
|
|
1056
|
+
xmlSecBn modulus, exponent;
|
|
1057
|
+
xmlSecBuffer blob;
|
|
1058
|
+
unsigned int blobBufferLen;
|
|
1059
|
+
PUBLICKEYSTRUC* pubKeyStruc = NULL;
|
|
1060
|
+
RSAPUBKEY* pubKey = NULL;
|
|
1061
|
+
xmlSecByte* modulusBlob = NULL;
|
|
1062
|
+
xmlSecKeyDataPtr data = NULL;
|
|
1063
|
+
HCRYPTPROV hProv = 0;
|
|
1064
|
+
HCRYPTKEY hKey = 0;
|
|
1065
|
+
xmlNodePtr cur;
|
|
1066
|
+
int res = -1;
|
|
1067
|
+
int ret;
|
|
1068
|
+
|
|
1069
|
+
xmlSecAssert2(id == xmlSecMSCryptoKeyDataRsaId, -1);
|
|
1070
|
+
xmlSecAssert2(key != NULL, -1);
|
|
1071
|
+
xmlSecAssert2(node != NULL, -1);
|
|
1072
|
+
xmlSecAssert2(keyInfoCtx != NULL, -1);
|
|
1073
|
+
|
|
1074
|
+
if(xmlSecKeyGetValue(key) != NULL) {
|
|
1075
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1076
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1077
|
+
NULL,
|
|
1078
|
+
XMLSEC_ERRORS_R_INVALID_KEY_DATA,
|
|
1079
|
+
"key already has a value");
|
|
1080
|
+
return(-1);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/* initialize buffers */
|
|
1084
|
+
ret = xmlSecBnInitialize(&modulus, 0);
|
|
1085
|
+
if(ret < 0) {
|
|
1086
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1087
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1088
|
+
"xmlSecBnInitialize",
|
|
1089
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1090
|
+
"modulus");
|
|
1091
|
+
return(-1);
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
ret = xmlSecBnInitialize(&exponent, 0);
|
|
1095
|
+
if(ret < 0) {
|
|
1096
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1097
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1098
|
+
"xmlSecBnInitialize",
|
|
1099
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1100
|
+
"exponent");
|
|
1101
|
+
xmlSecBnFinalize(&modulus);
|
|
1102
|
+
return(-1);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
ret = xmlSecBufferInitialize(&blob, 0);
|
|
1106
|
+
if(ret < 0) {
|
|
1107
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1108
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1109
|
+
"xmlSecBufferInitialize",
|
|
1110
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1111
|
+
"blob");
|
|
1112
|
+
xmlSecBnFinalize(&modulus);
|
|
1113
|
+
xmlSecBnFinalize(&exponent);
|
|
1114
|
+
return(-1);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/* read xml */
|
|
1118
|
+
cur = xmlSecGetNextElementNode(node->children);
|
|
1119
|
+
|
|
1120
|
+
/* first is Modulus node. It is REQUIRED because we do not support Seed and PgenCounter*/
|
|
1121
|
+
if((cur == NULL) || (!xmlSecCheckNodeName(cur, xmlSecNodeRSAModulus, xmlSecDSigNs))) {
|
|
1122
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1123
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1124
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1125
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1126
|
+
"node=%s",
|
|
1127
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAModulus));
|
|
1128
|
+
goto done;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
ret = xmlSecBnGetNodeValue(&modulus, cur, xmlSecBnBase64, 1);
|
|
1132
|
+
if((ret < 0) || (xmlSecBnGetSize(&modulus) == 0)){
|
|
1133
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1134
|
+
NULL,
|
|
1135
|
+
"xmlSecBnGetNodeValue",
|
|
1136
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1137
|
+
"node=%s",
|
|
1138
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAModulus));
|
|
1139
|
+
goto done;
|
|
1140
|
+
}
|
|
1141
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1142
|
+
|
|
1143
|
+
/* next is Exponent node. It is REQUIRED because we do not support Seed and PgenCounter*/
|
|
1144
|
+
if((cur == NULL) || (!xmlSecCheckNodeName(cur, xmlSecNodeRSAExponent, xmlSecDSigNs))) {
|
|
1145
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1146
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1147
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1148
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1149
|
+
"node=%s",
|
|
1150
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAExponent));
|
|
1151
|
+
goto done;
|
|
1152
|
+
}
|
|
1153
|
+
ret = xmlSecBnGetNodeValue(&exponent, cur, xmlSecBnBase64, 1);
|
|
1154
|
+
if((ret < 0) || (xmlSecBnGetSize(&exponent) == 0)) {
|
|
1155
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1156
|
+
NULL,
|
|
1157
|
+
"xmlSecBnGetNodeValue",
|
|
1158
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1159
|
+
"node=%s",
|
|
1160
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAExponent));
|
|
1161
|
+
goto done;
|
|
1162
|
+
}
|
|
1163
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1164
|
+
|
|
1165
|
+
if((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeRSAPrivateExponent, xmlSecNs))) {
|
|
1166
|
+
/* next is X node. It is REQUIRED for private key but
|
|
1167
|
+
* MSCrypto does not support it. We just ignore it */
|
|
1168
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
if(cur != NULL) {
|
|
1172
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1173
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1174
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1175
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1176
|
+
"no nodes expected");
|
|
1177
|
+
goto done;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
/* Now try to create the key */
|
|
1181
|
+
blobBufferLen = sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY) + xmlSecBnGetSize(&modulus);
|
|
1182
|
+
ret = xmlSecBufferSetSize(&blob, blobBufferLen);
|
|
1183
|
+
if(ret < 0) {
|
|
1184
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1185
|
+
NULL,
|
|
1186
|
+
"xmlSecBufferSetSize",
|
|
1187
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1188
|
+
"size=%d", blobBufferLen);
|
|
1189
|
+
goto done;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/* Set the PUBLICKEYSTRUC */
|
|
1193
|
+
pubKeyStruc = (PUBLICKEYSTRUC *)xmlSecBufferGetData(&blob);
|
|
1194
|
+
pubKeyStruc->bType = PUBLICKEYBLOB;
|
|
1195
|
+
pubKeyStruc->bVersion = 0x02;
|
|
1196
|
+
pubKeyStruc->reserved = 0;
|
|
1197
|
+
pubKeyStruc->aiKeyAlg = CALG_RSA_KEYX | CALG_RSA_SIGN;
|
|
1198
|
+
|
|
1199
|
+
/* Set the public key header */
|
|
1200
|
+
pubKey = (RSAPUBKEY*) (xmlSecBufferGetData(&blob) + sizeof(PUBLICKEYSTRUC));
|
|
1201
|
+
pubKey->magic = 0x31415352; /* == RSA1 public */
|
|
1202
|
+
pubKey->bitlen = xmlSecBnGetSize(&modulus) * 8; /* Number of bits in prime modulus */
|
|
1203
|
+
pubKey->pubexp = 0;
|
|
1204
|
+
if(sizeof(pubKey->pubexp) < xmlSecBnGetSize(&exponent)) {
|
|
1205
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1206
|
+
NULL,
|
|
1207
|
+
NULL,
|
|
1208
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1209
|
+
"exponent size=%d",
|
|
1210
|
+
xmlSecBnGetSize(&exponent));
|
|
1211
|
+
goto done;
|
|
1212
|
+
}
|
|
1213
|
+
xmlSecAssert2(xmlSecBnGetData(&exponent) != NULL, -1);
|
|
1214
|
+
memcpy(&(pubKey->pubexp), xmlSecBnGetData(&exponent), xmlSecBnGetSize(&exponent));
|
|
1215
|
+
|
|
1216
|
+
modulusBlob = (xmlSecByte*) (xmlSecBufferGetData(&blob) + sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY));
|
|
1217
|
+
xmlSecAssert2(xmlSecBnGetData(&modulus) != NULL, -1);
|
|
1218
|
+
memcpy(modulusBlob, xmlSecBnGetData(&modulus), xmlSecBnGetSize(&modulus));
|
|
1219
|
+
|
|
1220
|
+
/* Now that we have the blob, import */
|
|
1221
|
+
hProv = xmlSecMSCryptoFindProvider(xmlSecMSCryptoProviderInfo_Rsa, NULL, CRYPT_VERIFYCONTEXT, TRUE);
|
|
1222
|
+
if(hProv == 0) {
|
|
1223
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1224
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1225
|
+
"xmlSecMSCryptoFindProvider",
|
|
1226
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1227
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1228
|
+
goto done;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
if (!CryptImportKey(hProv, xmlSecBufferGetData(&blob), xmlSecBufferGetSize(&blob), 0, 0, &hKey)) {
|
|
1232
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1233
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1234
|
+
"CryptImportKey",
|
|
1235
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1236
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1237
|
+
goto done;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
data = xmlSecKeyDataCreate(id);
|
|
1241
|
+
if(data == NULL ) {
|
|
1242
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1243
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1244
|
+
"xmlSecKeyDataCreate",
|
|
1245
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1246
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1247
|
+
goto done;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
ret = xmlSecMSCryptoKeyDataAdoptKey(data, hProv, TRUE, hKey, 0, xmlSecKeyDataTypePublic);
|
|
1251
|
+
if(ret < 0) {
|
|
1252
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1253
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1254
|
+
"xmlSecMSCryptoKeyDataAdoptKey",
|
|
1255
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1256
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1257
|
+
goto done;
|
|
1258
|
+
}
|
|
1259
|
+
hProv = 0;
|
|
1260
|
+
hKey = 0;
|
|
1261
|
+
|
|
1262
|
+
ret = xmlSecKeySetValue(key, data);
|
|
1263
|
+
if(ret < 0) {
|
|
1264
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1265
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1266
|
+
"xmlSecKeySetValue",
|
|
1267
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1268
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1269
|
+
xmlSecKeyDataDestroy(data);
|
|
1270
|
+
goto done;
|
|
1271
|
+
}
|
|
1272
|
+
data = NULL;
|
|
1273
|
+
|
|
1274
|
+
/* success */
|
|
1275
|
+
res = 0;
|
|
1276
|
+
|
|
1277
|
+
done:
|
|
1278
|
+
if (hProv == 0) {
|
|
1279
|
+
CryptReleaseContext(hProv, 0);
|
|
1280
|
+
}
|
|
1281
|
+
if (hKey != 0) {
|
|
1282
|
+
CryptDestroyKey(hKey);
|
|
1283
|
+
}
|
|
1284
|
+
if (data != 0) {
|
|
1285
|
+
xmlSecKeyDataDestroy(data);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
xmlSecBnFinalize(&modulus);
|
|
1289
|
+
xmlSecBnFinalize(&exponent);
|
|
1290
|
+
xmlSecBufferFinalize(&blob);
|
|
1291
|
+
return(res);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
static int
|
|
1295
|
+
xmlSecMSCryptoKeyDataRsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
|
|
1296
|
+
xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
|
|
1297
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
1298
|
+
xmlSecBuffer buf;
|
|
1299
|
+
DWORD dwBlobLen;
|
|
1300
|
+
xmlSecByte* blob;
|
|
1301
|
+
PUBLICKEYSTRUC* pubKeyStruc;
|
|
1302
|
+
RSAPUBKEY *pubKey;
|
|
1303
|
+
xmlSecSize modulusLen, exponentLen;
|
|
1304
|
+
xmlNodePtr cur;
|
|
1305
|
+
int ret;
|
|
1306
|
+
|
|
1307
|
+
xmlSecAssert2(id == xmlSecMSCryptoKeyDataRsaId, -1);
|
|
1308
|
+
xmlSecAssert2(key != NULL, -1);
|
|
1309
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(xmlSecKeyGetValue(key), xmlSecMSCryptoKeyDataRsaId), -1);
|
|
1310
|
+
xmlSecAssert2(node != NULL, -1);
|
|
1311
|
+
xmlSecAssert2(keyInfoCtx != NULL, -1);
|
|
1312
|
+
|
|
1313
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(xmlSecKeyGetValue(key));
|
|
1314
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1315
|
+
xmlSecAssert2(xmlSecMSCryptoKeyDataCtxGetKey(ctx) != 0, -1);
|
|
1316
|
+
|
|
1317
|
+
if (!CryptExportKey(xmlSecMSCryptoKeyDataCtxGetKey(ctx), 0, PUBLICKEYBLOB, 0, NULL, &dwBlobLen)) {
|
|
1318
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1319
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1320
|
+
"CryptExportKey",
|
|
1321
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1322
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1323
|
+
return(-1);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
ret = xmlSecBufferInitialize(&buf, dwBlobLen);
|
|
1327
|
+
if(ret < 0) {
|
|
1328
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1329
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1330
|
+
"xmlSecBufferInitialize",
|
|
1331
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1332
|
+
"size=%ld", dwBlobLen);
|
|
1333
|
+
return(-1);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
blob = xmlSecBufferGetData(&buf);
|
|
1337
|
+
if (!CryptExportKey(xmlSecMSCryptoKeyDataCtxGetKey(ctx), 0, PUBLICKEYBLOB, 0, blob, &dwBlobLen)) {
|
|
1338
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1339
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1340
|
+
"CryptExportKey",
|
|
1341
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1342
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1343
|
+
xmlSecBufferFinalize(&buf);
|
|
1344
|
+
return(-1);
|
|
1345
|
+
}
|
|
1346
|
+
if (dwBlobLen < sizeof(PUBLICKEYSTRUC)) {
|
|
1347
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1348
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1349
|
+
NULL,
|
|
1350
|
+
XMLSEC_ERRORS_R_INVALID_DATA,
|
|
1351
|
+
"blobLen=%ld", dwBlobLen);
|
|
1352
|
+
xmlSecBufferFinalize(&buf);
|
|
1353
|
+
return(-1);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/* check PUBLICKEYSTRUC */
|
|
1357
|
+
pubKeyStruc = (PUBLICKEYSTRUC*)blob;
|
|
1358
|
+
if(pubKeyStruc->bVersion != 0x02) {
|
|
1359
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1360
|
+
NULL,
|
|
1361
|
+
"CryptExportKey",
|
|
1362
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1363
|
+
"pubKeyStruc->bVersion=%d", pubKeyStruc->bVersion);
|
|
1364
|
+
xmlSecBufferFinalize(&buf);
|
|
1365
|
+
return(-1);
|
|
1366
|
+
}
|
|
1367
|
+
if(pubKeyStruc->bType != PUBLICKEYBLOB) {
|
|
1368
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1369
|
+
NULL,
|
|
1370
|
+
"CryptExportKey",
|
|
1371
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1372
|
+
"pubKeyStruc->bType=%d", (int)pubKeyStruc->bType);
|
|
1373
|
+
xmlSecBufferFinalize(&buf);
|
|
1374
|
+
return(-1);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
/* check RSAPUBKEY */
|
|
1378
|
+
pubKey = (RSAPUBKEY *)(blob + sizeof(PUBLICKEYSTRUC));
|
|
1379
|
+
if(pubKey->magic != 0x31415352) { /* RSA public key magic */
|
|
1380
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1381
|
+
NULL,
|
|
1382
|
+
"CryptExportKey",
|
|
1383
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1384
|
+
"pubKey->magic=0x%08lx", pubKey->magic);
|
|
1385
|
+
xmlSecBufferFinalize(&buf);
|
|
1386
|
+
return(-1);
|
|
1387
|
+
}
|
|
1388
|
+
modulusLen = pubKey->bitlen / 8;
|
|
1389
|
+
|
|
1390
|
+
if (dwBlobLen < sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY) + modulusLen) {
|
|
1391
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1392
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1393
|
+
NULL,
|
|
1394
|
+
XMLSEC_ERRORS_R_INVALID_DATA,
|
|
1395
|
+
"blobLen=%ld; modulusLen=%d", dwBlobLen, modulusLen);
|
|
1396
|
+
xmlSecBufferFinalize(&buf);
|
|
1397
|
+
return(-1);
|
|
1398
|
+
}
|
|
1399
|
+
blob += sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY);
|
|
1400
|
+
|
|
1401
|
+
/* first is Modulus node */
|
|
1402
|
+
cur = xmlSecAddChild(node, xmlSecNodeRSAModulus, xmlSecDSigNs);
|
|
1403
|
+
if(cur == NULL) {
|
|
1404
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1405
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1406
|
+
"xmlSecAddChild",
|
|
1407
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1408
|
+
"node=%s",
|
|
1409
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAModulus));
|
|
1410
|
+
xmlSecBufferFinalize(&buf);
|
|
1411
|
+
return(-1);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
ret = xmlSecBnBlobSetNodeValue(blob, modulusLen, cur, xmlSecBnBase64, 1, 1);
|
|
1415
|
+
if(ret < 0) {
|
|
1416
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1417
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1418
|
+
"xmlSecBnBlobSetNodeValue",
|
|
1419
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1420
|
+
"node=%s",
|
|
1421
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAModulus));
|
|
1422
|
+
xmlSecBufferFinalize(&buf);
|
|
1423
|
+
return(-1);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
/* next is Exponent node. */
|
|
1427
|
+
cur = xmlSecAddChild(node, xmlSecNodeRSAExponent, xmlSecDSigNs);
|
|
1428
|
+
if(cur == NULL) {
|
|
1429
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1430
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1431
|
+
"xmlSecAddChild",
|
|
1432
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1433
|
+
"node=%s",
|
|
1434
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAExponent));
|
|
1435
|
+
xmlSecBufferFinalize(&buf);
|
|
1436
|
+
return(-1);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/* Remove leading zero's (from least significant end) */
|
|
1440
|
+
blob = (xmlSecByte*)(&(pubKey->pubexp));
|
|
1441
|
+
exponentLen = sizeof(pubKey->pubexp);
|
|
1442
|
+
while (exponentLen > 0 && blob[exponentLen - 1] == 0) {
|
|
1443
|
+
exponentLen--;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
ret = xmlSecBnBlobSetNodeValue(blob, exponentLen, cur, xmlSecBnBase64, 1, 1);
|
|
1447
|
+
if(ret < 0) {
|
|
1448
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1449
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1450
|
+
"xmlSecBnBlobSetNodeValue",
|
|
1451
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1452
|
+
"node=%s",
|
|
1453
|
+
xmlSecErrorsSafeString(xmlSecNodeRSAExponent));
|
|
1454
|
+
xmlSecBufferFinalize(&buf);
|
|
1455
|
+
return(-1);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/* next is PrivateExponent node: not supported in MSCrypto */
|
|
1459
|
+
|
|
1460
|
+
xmlSecBufferFinalize(&buf);
|
|
1461
|
+
return(0);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
static int
|
|
1465
|
+
xmlSecMSCryptoKeyDataRsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits,
|
|
1466
|
+
xmlSecKeyDataType type ATTRIBUTE_UNUSED) {
|
|
1467
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
1468
|
+
HCRYPTPROV hProv = 0;
|
|
1469
|
+
HCRYPTKEY hKey = 0;
|
|
1470
|
+
DWORD dwKeySpec;
|
|
1471
|
+
DWORD dwSize;
|
|
1472
|
+
int res = -1;
|
|
1473
|
+
int ret;
|
|
1474
|
+
|
|
1475
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), xmlSecKeyDataTypeUnknown);
|
|
1476
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), xmlSecKeyDataTypeUnknown);
|
|
1477
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataRsaId), -1);
|
|
1478
|
+
xmlSecAssert2(sizeBits > 0, -1);
|
|
1479
|
+
|
|
1480
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
1481
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1482
|
+
|
|
1483
|
+
/* get provider */
|
|
1484
|
+
hProv = xmlSecMSCryptoFindProvider(ctx->providers, NULL, CRYPT_VERIFYCONTEXT, TRUE);
|
|
1485
|
+
if(hProv == 0) {
|
|
1486
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1487
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
1488
|
+
"xmlSecMSCryptoFindProvider",
|
|
1489
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1490
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1491
|
+
goto done;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
dwKeySpec = AT_KEYEXCHANGE | AT_SIGNATURE;
|
|
1495
|
+
dwSize = ((sizeBits << 16) | CRYPT_EXPORTABLE);
|
|
1496
|
+
if (!CryptGenKey(hProv, CALG_RSA_SIGN, dwSize, &hKey)) {
|
|
1497
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1498
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
1499
|
+
"CryptGenKey",
|
|
1500
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
1501
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1502
|
+
goto done;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
ret = xmlSecMSCryptoKeyDataAdoptKey(data, hProv, TRUE, hKey, dwKeySpec,
|
|
1506
|
+
xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate);
|
|
1507
|
+
if(ret < 0) {
|
|
1508
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1509
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
1510
|
+
"xmlSecMSCryptoKeyDataAdoptKey",
|
|
1511
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1512
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1513
|
+
goto done;
|
|
1514
|
+
}
|
|
1515
|
+
hProv = 0;
|
|
1516
|
+
hKey = 0;
|
|
1517
|
+
|
|
1518
|
+
/* success */
|
|
1519
|
+
res = 0;
|
|
1520
|
+
|
|
1521
|
+
done:
|
|
1522
|
+
if (hProv != 0) {
|
|
1523
|
+
CryptReleaseContext(hProv, 0);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
if (hKey != 0) {
|
|
1527
|
+
CryptDestroyKey(hKey);
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
return(res);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
static xmlSecKeyDataType
|
|
1534
|
+
xmlSecMSCryptoKeyDataRsaGetType(xmlSecKeyDataPtr data) {
|
|
1535
|
+
return(xmlSecMSCryptoKeyDataGetType(data));
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
static xmlSecSize
|
|
1539
|
+
xmlSecMSCryptoKeyDataRsaGetSize(xmlSecKeyDataPtr data) {
|
|
1540
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataRsaId), 0);
|
|
1541
|
+
|
|
1542
|
+
return (xmlSecMSCryptoKeyDataGetSize(data));
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
static void
|
|
1546
|
+
xmlSecMSCryptoKeyDataRsaDebugDump(xmlSecKeyDataPtr data, FILE* output) {
|
|
1547
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataRsaId));
|
|
1548
|
+
xmlSecAssert(output != NULL);
|
|
1549
|
+
|
|
1550
|
+
fprintf(output, "=== rsa key: size = %d\n",
|
|
1551
|
+
xmlSecMSCryptoKeyDataRsaGetSize(data));
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
static void xmlSecMSCryptoKeyDataRsaDebugXmlDump(xmlSecKeyDataPtr data, FILE* output) {
|
|
1555
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataRsaId));
|
|
1556
|
+
xmlSecAssert(output != NULL);
|
|
1557
|
+
|
|
1558
|
+
fprintf(output, "<RSAKeyValue size=\"%d\" />\n",
|
|
1559
|
+
xmlSecMSCryptoKeyDataRsaGetSize(data));
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
#endif /* XMLSEC_NO_RSA */
|
|
1563
|
+
|
|
1564
|
+
#ifndef XMLSEC_NO_DSA
|
|
1565
|
+
/**************************************************************************
|
|
1566
|
+
*
|
|
1567
|
+
* <dsig:DSAKeyValue> processing
|
|
1568
|
+
*
|
|
1569
|
+
*
|
|
1570
|
+
* The DSAKeyValue Element (http://www.w3.org/TR/xmldsig-core/#sec-DSAKeyValue)
|
|
1571
|
+
*
|
|
1572
|
+
* DSA keys and the DSA signature algorithm are specified in [DSS].
|
|
1573
|
+
* DSA public key values can have the following fields:
|
|
1574
|
+
*
|
|
1575
|
+
* * P - a prime modulus meeting the [DSS] requirements
|
|
1576
|
+
* * Q - an integer in the range 2**159 < Q < 2**160 which is a prime
|
|
1577
|
+
* divisor of P-1
|
|
1578
|
+
* * G - an integer with certain properties with respect to P and Q
|
|
1579
|
+
* * Y - G**X mod P (where X is part of the private key and not made
|
|
1580
|
+
* public)
|
|
1581
|
+
* * J - (P - 1) / Q
|
|
1582
|
+
* * seed - a DSA prime generation seed
|
|
1583
|
+
* * pgenCounter - a DSA prime generation counter
|
|
1584
|
+
*
|
|
1585
|
+
* Parameter J is available for inclusion solely for efficiency as it is
|
|
1586
|
+
* calculatable from P and Q. Parameters seed and pgenCounter are used in the
|
|
1587
|
+
* DSA prime number generation algorithm specified in [DSS]. As such, they are
|
|
1588
|
+
* optional but must either both be present or both be absent. This prime
|
|
1589
|
+
* generation algorithm is designed to provide assurance that a weak prime is
|
|
1590
|
+
* not being used and it yields a P and Q value. Parameters P, Q, and G can be
|
|
1591
|
+
* public and common to a group of users. They might be known from application
|
|
1592
|
+
* context. As such, they are optional but P and Q must either both appear or
|
|
1593
|
+
* both be absent. If all of P, Q, seed, and pgenCounter are present,
|
|
1594
|
+
* implementations are not required to check if they are consistent and are
|
|
1595
|
+
* free to use either P and Q or seed and pgenCounter. All parameters are
|
|
1596
|
+
* encoded as base64 [MIME] values.
|
|
1597
|
+
*
|
|
1598
|
+
* Arbitrary-length integers (e.g. "bignums" such as RSA moduli) are
|
|
1599
|
+
* represented in XML as octet strings as defined by the ds:CryptoBinary type.
|
|
1600
|
+
*
|
|
1601
|
+
* Schema Definition:
|
|
1602
|
+
*
|
|
1603
|
+
* <element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
|
|
1604
|
+
* <complexType name="DSAKeyValueType">
|
|
1605
|
+
* <sequence>
|
|
1606
|
+
* <sequence minOccurs="0">
|
|
1607
|
+
* <element name="P" type="ds:CryptoBinary"/>
|
|
1608
|
+
* <element name="Q" type="ds:CryptoBinary"/>
|
|
1609
|
+
* </sequence>
|
|
1610
|
+
* <element name="G" type="ds:CryptoBinary" minOccurs="0"/>
|
|
1611
|
+
* <element name="Y" type="ds:CryptoBinary"/>
|
|
1612
|
+
* <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
|
|
1613
|
+
* <sequence minOccurs="0">
|
|
1614
|
+
* <element name="Seed" type="ds:CryptoBinary"/>
|
|
1615
|
+
* <element name="PgenCounter" type="ds:CryptoBinary"/>
|
|
1616
|
+
* </sequence>
|
|
1617
|
+
* </sequence>
|
|
1618
|
+
* </complexType>
|
|
1619
|
+
*
|
|
1620
|
+
* DTD Definition:
|
|
1621
|
+
*
|
|
1622
|
+
* <!ELEMENT DSAKeyValue ((P, Q)?, G?, Y, J?, (Seed, PgenCounter)?) >
|
|
1623
|
+
* <!ELEMENT P (#PCDATA) >
|
|
1624
|
+
* <!ELEMENT Q (#PCDATA) >
|
|
1625
|
+
* <!ELEMENT G (#PCDATA) >
|
|
1626
|
+
* <!ELEMENT Y (#PCDATA) >
|
|
1627
|
+
* <!ELEMENT J (#PCDATA) >
|
|
1628
|
+
* <!ELEMENT Seed (#PCDATA) >
|
|
1629
|
+
* <!ELEMENT PgenCounter (#PCDATA) >
|
|
1630
|
+
*
|
|
1631
|
+
* ============================================================================
|
|
1632
|
+
*
|
|
1633
|
+
* To support reading/writing private keys an X element added (before Y).
|
|
1634
|
+
* todo: The current implementation does not support Seed and PgenCounter!
|
|
1635
|
+
* by this the P, Q and G are *required*!
|
|
1636
|
+
*
|
|
1637
|
+
*************************************************************************/
|
|
1638
|
+
static int xmlSecMSCryptoKeyDataDsaInitialize(xmlSecKeyDataPtr data);
|
|
1639
|
+
static int xmlSecMSCryptoKeyDataDsaDuplicate(xmlSecKeyDataPtr dst,
|
|
1640
|
+
xmlSecKeyDataPtr src);
|
|
1641
|
+
static void xmlSecMSCryptoKeyDataDsaFinalize(xmlSecKeyDataPtr data);
|
|
1642
|
+
static int xmlSecMSCryptoKeyDataDsaXmlRead (xmlSecKeyDataId id,
|
|
1643
|
+
xmlSecKeyPtr key,
|
|
1644
|
+
xmlNodePtr node,
|
|
1645
|
+
xmlSecKeyInfoCtxPtr keyInfoCtx);
|
|
1646
|
+
static int xmlSecMSCryptoKeyDataDsaXmlWrite(xmlSecKeyDataId id,
|
|
1647
|
+
xmlSecKeyPtr key,
|
|
1648
|
+
xmlNodePtr node,
|
|
1649
|
+
xmlSecKeyInfoCtxPtr keyInfoCtx);
|
|
1650
|
+
static int xmlSecMSCryptoKeyDataDsaGenerate(xmlSecKeyDataPtr data,
|
|
1651
|
+
xmlSecSize sizeBits,
|
|
1652
|
+
xmlSecKeyDataType type);
|
|
1653
|
+
|
|
1654
|
+
static xmlSecKeyDataType xmlSecMSCryptoKeyDataDsaGetType(xmlSecKeyDataPtr data);
|
|
1655
|
+
static xmlSecSize xmlSecMSCryptoKeyDataDsaGetSize(xmlSecKeyDataPtr data);
|
|
1656
|
+
static void xmlSecMSCryptoKeyDataDsaDebugDump(xmlSecKeyDataPtr data,
|
|
1657
|
+
FILE* output);
|
|
1658
|
+
static void xmlSecMSCryptoKeyDataDsaDebugXmlDump(xmlSecKeyDataPtr data,
|
|
1659
|
+
FILE* output);
|
|
1660
|
+
|
|
1661
|
+
static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataDsaKlass = {
|
|
1662
|
+
sizeof(xmlSecKeyDataKlass),
|
|
1663
|
+
xmlSecMSCryptoKeyDataSize,
|
|
1664
|
+
|
|
1665
|
+
/* data */
|
|
1666
|
+
xmlSecNameDSAKeyValue,
|
|
1667
|
+
xmlSecKeyDataUsageKeyValueNode | xmlSecKeyDataUsageRetrievalMethodNodeXml,
|
|
1668
|
+
/* xmlSecKeyDataUsage usage; */
|
|
1669
|
+
xmlSecHrefDSAKeyValue, /* const xmlChar* href; */
|
|
1670
|
+
xmlSecNodeDSAKeyValue, /* const xmlChar* dataNodeName; */
|
|
1671
|
+
xmlSecDSigNs, /* const xmlChar* dataNodeNs; */
|
|
1672
|
+
|
|
1673
|
+
/* constructors/destructor */
|
|
1674
|
+
xmlSecMSCryptoKeyDataDsaInitialize, /* xmlSecKeyDataInitializeMethod initialize; */
|
|
1675
|
+
xmlSecMSCryptoKeyDataDsaDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */
|
|
1676
|
+
xmlSecMSCryptoKeyDataDsaFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */
|
|
1677
|
+
xmlSecMSCryptoKeyDataDsaGenerate, /* xmlSecKeyDataGenerateMethod generate; */
|
|
1678
|
+
|
|
1679
|
+
/* get info */
|
|
1680
|
+
xmlSecMSCryptoKeyDataDsaGetType, /* xmlSecKeyDataGetTypeMethod getType; */
|
|
1681
|
+
xmlSecMSCryptoKeyDataDsaGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */
|
|
1682
|
+
NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */
|
|
1683
|
+
|
|
1684
|
+
/* read/write */
|
|
1685
|
+
xmlSecMSCryptoKeyDataDsaXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */
|
|
1686
|
+
xmlSecMSCryptoKeyDataDsaXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */
|
|
1687
|
+
NULL, /* xmlSecKeyDataBinReadMethod binRead; */
|
|
1688
|
+
NULL, /* xmlSecKeyDataBinWriteMethod binWrite; */
|
|
1689
|
+
|
|
1690
|
+
/* debug */
|
|
1691
|
+
xmlSecMSCryptoKeyDataDsaDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */
|
|
1692
|
+
xmlSecMSCryptoKeyDataDsaDebugXmlDump,/* xmlSecKeyDataDebugDumpMethod debugXmlDump; */
|
|
1693
|
+
|
|
1694
|
+
/* reserved for the future */
|
|
1695
|
+
NULL, /* void* reserved0; */
|
|
1696
|
+
NULL, /* void* reserved1; */
|
|
1697
|
+
};
|
|
1698
|
+
|
|
1699
|
+
/* Ordered list of providers to search for algorithm implementation using
|
|
1700
|
+
* xmlSecMSCryptoFindProvider() function
|
|
1701
|
+
*
|
|
1702
|
+
* MUST END with { NULL, 0 } !!!
|
|
1703
|
+
*/
|
|
1704
|
+
static xmlSecMSCryptoProviderInfo xmlSecMSCryptoProviderInfo_Dss[] = {
|
|
1705
|
+
{ MS_DEF_DSS_PROV, PROV_DSS },
|
|
1706
|
+
{ NULL, 0 }
|
|
1707
|
+
};
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* xmlSecMSCryptoKeyDataDsaGetKlass:
|
|
1712
|
+
*
|
|
1713
|
+
* The DSA key data klass.
|
|
1714
|
+
*
|
|
1715
|
+
* Returns: pointer to DSA key data klass.
|
|
1716
|
+
*/
|
|
1717
|
+
xmlSecKeyDataId
|
|
1718
|
+
xmlSecMSCryptoKeyDataDsaGetKlass(void) {
|
|
1719
|
+
return(&xmlSecMSCryptoKeyDataDsaKlass);
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
static int
|
|
1724
|
+
xmlSecMSCryptoKeyDataDsaInitialize(xmlSecKeyDataPtr data) {
|
|
1725
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
1726
|
+
|
|
1727
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataDsaId), xmlSecKeyDataTypeUnknown);
|
|
1728
|
+
|
|
1729
|
+
xmlSecMSCryptoKeyDataInitialize(data);
|
|
1730
|
+
|
|
1731
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
1732
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
1733
|
+
|
|
1734
|
+
ctx->providers = xmlSecMSCryptoProviderInfo_Dss;
|
|
1735
|
+
return(0);
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
static int
|
|
1739
|
+
xmlSecMSCryptoKeyDataDsaDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) {
|
|
1740
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(dst, xmlSecMSCryptoKeyDataDsaId), -1);
|
|
1741
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(src, xmlSecMSCryptoKeyDataDsaId), -1);
|
|
1742
|
+
|
|
1743
|
+
return(xmlSecMSCryptoKeyDataDuplicate(dst, src));
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
static void
|
|
1747
|
+
xmlSecMSCryptoKeyDataDsaFinalize(xmlSecKeyDataPtr data) {
|
|
1748
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataDsaId));
|
|
1749
|
+
|
|
1750
|
+
xmlSecMSCryptoKeyDataFinalize(data);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
static int
|
|
1754
|
+
xmlSecMSCryptoKeyDataDsaXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
|
|
1755
|
+
xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
|
|
1756
|
+
xmlSecKeyDataPtr data = NULL;
|
|
1757
|
+
xmlNodePtr cur;
|
|
1758
|
+
xmlSecBn p, q, g, y;
|
|
1759
|
+
xmlSecBuffer blob;
|
|
1760
|
+
unsigned int blobBufferLen;
|
|
1761
|
+
PUBLICKEYSTRUC *pubKeyStruc = NULL;
|
|
1762
|
+
DSSPUBKEY *pubKey = NULL;
|
|
1763
|
+
DSSSEED* seed = NULL;
|
|
1764
|
+
BYTE *buf = NULL;
|
|
1765
|
+
HCRYPTPROV hProv = 0;
|
|
1766
|
+
HCRYPTKEY hKey = 0;
|
|
1767
|
+
xmlSecSize i;
|
|
1768
|
+
int res = -1;
|
|
1769
|
+
int ret;
|
|
1770
|
+
|
|
1771
|
+
xmlSecAssert2(id == xmlSecMSCryptoKeyDataDsaId, -1);
|
|
1772
|
+
xmlSecAssert2(key != NULL, -1);
|
|
1773
|
+
xmlSecAssert2(node != NULL, -1);
|
|
1774
|
+
xmlSecAssert2(keyInfoCtx != NULL, -1);
|
|
1775
|
+
|
|
1776
|
+
if(xmlSecKeyGetValue(key) != NULL) {
|
|
1777
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1778
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1779
|
+
NULL,
|
|
1780
|
+
XMLSEC_ERRORS_R_INVALID_KEY_DATA,
|
|
1781
|
+
"key already has a value");
|
|
1782
|
+
return(-1);
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
/* initialize buffers */
|
|
1786
|
+
ret = xmlSecBnInitialize(&p, 0);
|
|
1787
|
+
if(ret < 0) {
|
|
1788
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1789
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1790
|
+
"xmlSecBnInitialize",
|
|
1791
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1792
|
+
"p");
|
|
1793
|
+
return(-1);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
ret = xmlSecBnInitialize(&q, 0);
|
|
1797
|
+
if(ret < 0) {
|
|
1798
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1799
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1800
|
+
"xmlSecBnInitialize",
|
|
1801
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1802
|
+
"q");
|
|
1803
|
+
xmlSecBnFinalize(&p);
|
|
1804
|
+
return(-1);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
ret = xmlSecBnInitialize(&g, 0);
|
|
1808
|
+
if(ret < 0) {
|
|
1809
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1810
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1811
|
+
"xmlSecBnInitialize",
|
|
1812
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1813
|
+
"g");
|
|
1814
|
+
xmlSecBnFinalize(&p);
|
|
1815
|
+
xmlSecBnFinalize(&q);
|
|
1816
|
+
return(-1);
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
ret = xmlSecBnInitialize(&y, 0);
|
|
1820
|
+
if(ret < 0) {
|
|
1821
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1822
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1823
|
+
"xmlSecBnInitialize",
|
|
1824
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1825
|
+
"y");
|
|
1826
|
+
xmlSecBnFinalize(&p);
|
|
1827
|
+
xmlSecBnFinalize(&q);
|
|
1828
|
+
xmlSecBnFinalize(&g);
|
|
1829
|
+
return(-1);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
ret = xmlSecBufferInitialize(&blob, 0);
|
|
1833
|
+
if(ret < 0) {
|
|
1834
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1835
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1836
|
+
"xmlSecBufferInitialize",
|
|
1837
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1838
|
+
"blob");
|
|
1839
|
+
xmlSecBnFinalize(&p);
|
|
1840
|
+
xmlSecBnFinalize(&q);
|
|
1841
|
+
xmlSecBnFinalize(&g);
|
|
1842
|
+
xmlSecBnFinalize(&y);
|
|
1843
|
+
return(-1);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
/* read xml */
|
|
1847
|
+
cur = xmlSecGetNextElementNode(node->children);
|
|
1848
|
+
|
|
1849
|
+
/* first is P node. It is REQUIRED because we do not support Seed and PgenCounter*/
|
|
1850
|
+
if((cur == NULL) || (!xmlSecCheckNodeName(cur, xmlSecNodeDSAP, xmlSecDSigNs))) {
|
|
1851
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1852
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1853
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1854
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1855
|
+
"node=%s",
|
|
1856
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAP));
|
|
1857
|
+
goto done;
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
ret = xmlSecBnGetNodeValue(&p, cur, xmlSecBnBase64, 1);
|
|
1861
|
+
if((ret < 0) || (xmlSecBnGetSize(&p) == 0)){
|
|
1862
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1863
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1864
|
+
"xmlSecBnGetNodeValue",
|
|
1865
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1866
|
+
"node=%s",
|
|
1867
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAP));
|
|
1868
|
+
goto done;
|
|
1869
|
+
}
|
|
1870
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1871
|
+
|
|
1872
|
+
/* next is Q node. It is REQUIRED because we do not support Seed and PgenCounter*/
|
|
1873
|
+
if((cur == NULL) || (!xmlSecCheckNodeName(cur, xmlSecNodeDSAQ, xmlSecDSigNs))) {
|
|
1874
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1875
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1876
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1877
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1878
|
+
"node=%s",
|
|
1879
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAQ));
|
|
1880
|
+
goto done;
|
|
1881
|
+
}
|
|
1882
|
+
ret = xmlSecBnGetNodeValue(&q, cur, xmlSecBnBase64, 1);
|
|
1883
|
+
if((ret < 0) || (xmlSecBnGetSize(&q) == 0)){
|
|
1884
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1885
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1886
|
+
"xmlSecBnGetNodeValue",
|
|
1887
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1888
|
+
"node=%s",
|
|
1889
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAQ));
|
|
1890
|
+
goto done;
|
|
1891
|
+
}
|
|
1892
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1893
|
+
|
|
1894
|
+
/* next is G node. It is REQUIRED because we do not support Seed and PgenCounter*/
|
|
1895
|
+
if((cur == NULL) || (!xmlSecCheckNodeName(cur, xmlSecNodeDSAG, xmlSecDSigNs))) {
|
|
1896
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1897
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1898
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1899
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1900
|
+
"node=%s",
|
|
1901
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAG));
|
|
1902
|
+
goto done;
|
|
1903
|
+
}
|
|
1904
|
+
ret = xmlSecBnGetNodeValue(&g, cur, xmlSecBnBase64, 1);
|
|
1905
|
+
if((ret < 0) || (xmlSecBnGetSize(&q) == 0)) {
|
|
1906
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1907
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1908
|
+
"xmlSecBnGetNodeValue",
|
|
1909
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1910
|
+
"node=%s",
|
|
1911
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAG));
|
|
1912
|
+
goto done;
|
|
1913
|
+
}
|
|
1914
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1915
|
+
|
|
1916
|
+
if((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeDSAX, xmlSecNs))) {
|
|
1917
|
+
/* next is X node. It is REQUIRED for private key but
|
|
1918
|
+
* MSCrypto does not support it, we just ignore it */
|
|
1919
|
+
|
|
1920
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
/* next is Y node. */
|
|
1924
|
+
if((cur == NULL) || (!xmlSecCheckNodeName(cur, xmlSecNodeDSAY, xmlSecDSigNs))) {
|
|
1925
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1926
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1927
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1928
|
+
XMLSEC_ERRORS_R_INVALID_NODE,
|
|
1929
|
+
"node=%s",
|
|
1930
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAY));
|
|
1931
|
+
goto done;
|
|
1932
|
+
}
|
|
1933
|
+
ret = xmlSecBnGetNodeValue(&y, cur, xmlSecBnBase64, 1);
|
|
1934
|
+
if((ret < 0) || (xmlSecBnGetSize(&y) == 0)) {
|
|
1935
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1936
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1937
|
+
"xmlSecBnGetNodeValue",
|
|
1938
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1939
|
+
"node=%s", xmlSecErrorsSafeString(xmlSecNodeDSAY));
|
|
1940
|
+
goto done;
|
|
1941
|
+
}
|
|
1942
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1943
|
+
|
|
1944
|
+
/* todo: add support for J */
|
|
1945
|
+
if((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeDSAJ, xmlSecDSigNs))) {
|
|
1946
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
/* todo: add support for seed */
|
|
1950
|
+
if((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeDSASeed, xmlSecDSigNs))) {
|
|
1951
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
/* todo: add support for pgencounter */
|
|
1955
|
+
if((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeDSAPgenCounter, xmlSecDSigNs))) {
|
|
1956
|
+
cur = xmlSecGetNextElementNode(cur->next);
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
if(cur != NULL) {
|
|
1960
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1961
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
1962
|
+
xmlSecErrorsSafeString(xmlSecNodeGetName(cur)),
|
|
1963
|
+
XMLSEC_ERRORS_R_UNEXPECTED_NODE,
|
|
1964
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
1965
|
+
goto done;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
/* we assume that sizeof(q) < 0x14, sizeof(g) <= sizeof(p) and sizeof(y) <= sizeof(p) */
|
|
1969
|
+
blobBufferLen = sizeof(PUBLICKEYSTRUC) + sizeof(DSSPUBKEY) + 3 * xmlSecBnGetSize(&p) + 0x14 + sizeof(DSSSEED);
|
|
1970
|
+
ret = xmlSecBufferSetSize(&blob, blobBufferLen);
|
|
1971
|
+
if(ret < 0) {
|
|
1972
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
1973
|
+
NULL,
|
|
1974
|
+
"xmlSecBufferSetSize",
|
|
1975
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
1976
|
+
"size=%d", blobBufferLen);
|
|
1977
|
+
goto done;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
/* Set PUBLICKEYSTRUC */
|
|
1981
|
+
pubKeyStruc = (PUBLICKEYSTRUC *)xmlSecBufferGetData(&blob);
|
|
1982
|
+
pubKeyStruc->bType = PUBLICKEYBLOB;
|
|
1983
|
+
pubKeyStruc->bVersion = 0x02;
|
|
1984
|
+
pubKeyStruc->reserved = 0;
|
|
1985
|
+
pubKeyStruc->aiKeyAlg = CALG_DSS_SIGN;
|
|
1986
|
+
|
|
1987
|
+
/* Set the public key header */
|
|
1988
|
+
pubKey = (DSSPUBKEY *) (xmlSecBufferGetData(&blob) + sizeof(PUBLICKEYSTRUC));
|
|
1989
|
+
pubKey->magic = 0x31535344; /* == DSS1 pub key */
|
|
1990
|
+
pubKey->bitlen = xmlSecBnGetSize(&p) * 8; /* Number of bits in prime modulus */
|
|
1991
|
+
|
|
1992
|
+
/* copy the key data */
|
|
1993
|
+
buf = (BYTE*) (xmlSecBufferGetData(&blob) + sizeof(PUBLICKEYSTRUC) + sizeof(DSSPUBKEY));
|
|
1994
|
+
|
|
1995
|
+
/* set p */
|
|
1996
|
+
xmlSecAssert2(xmlSecBnGetData(&p) != NULL, -1);
|
|
1997
|
+
memcpy(buf, xmlSecBnGetData(&p), xmlSecBnGetSize(&p));
|
|
1998
|
+
buf += xmlSecBnGetSize(&p);
|
|
1999
|
+
|
|
2000
|
+
/* set q */
|
|
2001
|
+
if(xmlSecBnGetSize(&q) > 0x14) {
|
|
2002
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2003
|
+
NULL,
|
|
2004
|
+
"q",
|
|
2005
|
+
XMLSEC_ERRORS_R_INVALID_SIZE,
|
|
2006
|
+
"size=%d > 0x14", xmlSecBnGetSize(&q));
|
|
2007
|
+
goto done;
|
|
2008
|
+
}
|
|
2009
|
+
xmlSecAssert2(xmlSecBnGetData(&q) != NULL, -1);
|
|
2010
|
+
memcpy(buf, xmlSecBnGetData(&q), xmlSecBnGetSize(&q));
|
|
2011
|
+
buf += xmlSecBnGetSize(&q);
|
|
2012
|
+
|
|
2013
|
+
/* Pad with zeros */
|
|
2014
|
+
for(i = xmlSecBnGetSize(&q); i < 0x14; ++i) {
|
|
2015
|
+
*(buf++) = 0;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
/* set generator */
|
|
2019
|
+
if(xmlSecBnGetSize(&g) > xmlSecBnGetSize(&p)) {
|
|
2020
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2021
|
+
NULL,
|
|
2022
|
+
"g",
|
|
2023
|
+
XMLSEC_ERRORS_R_INVALID_SIZE,
|
|
2024
|
+
"size=%d > %d",
|
|
2025
|
+
xmlSecBnGetSize(&g),
|
|
2026
|
+
xmlSecBnGetSize(&p));
|
|
2027
|
+
goto done;
|
|
2028
|
+
}
|
|
2029
|
+
xmlSecAssert2(xmlSecBnGetData(&g) != NULL, -1);
|
|
2030
|
+
memcpy(buf, xmlSecBnGetData(&g), xmlSecBnGetSize(&g));
|
|
2031
|
+
buf += xmlSecBnGetSize(&g);
|
|
2032
|
+
/* Pad with zeros */
|
|
2033
|
+
for(i = xmlSecBnGetSize(&g); i < xmlSecBnGetSize(&p); ++i) {
|
|
2034
|
+
*(buf++) = 0;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
/* Public key */
|
|
2038
|
+
if(xmlSecBnGetSize(&y) > xmlSecBnGetSize(&p)) {
|
|
2039
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2040
|
+
NULL,
|
|
2041
|
+
"y",
|
|
2042
|
+
XMLSEC_ERRORS_R_INVALID_SIZE,
|
|
2043
|
+
"size=%d > %d",
|
|
2044
|
+
xmlSecBnGetSize(&y),
|
|
2045
|
+
xmlSecBnGetSize(&p));
|
|
2046
|
+
goto done;
|
|
2047
|
+
}
|
|
2048
|
+
xmlSecAssert2(xmlSecBnGetData(&y) != NULL, -1);
|
|
2049
|
+
memcpy(buf, xmlSecBnGetData(&y), xmlSecBnGetSize(&y));
|
|
2050
|
+
buf += xmlSecBnGetSize(&y);
|
|
2051
|
+
/* Pad with zeros */
|
|
2052
|
+
for(i = xmlSecBnGetSize(&y); i < xmlSecBnGetSize(&p); ++i) {
|
|
2053
|
+
*(buf++) = 0;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
/* Set seed to 0xFFFFFFFFF */
|
|
2057
|
+
seed = (DSSSEED*)buf;
|
|
2058
|
+
memset(seed, 0, sizeof(*seed));
|
|
2059
|
+
seed->counter = 0xFFFFFFFF; /* SEED Counter set to 0xFFFFFFFF will cause seed to be ignored */
|
|
2060
|
+
|
|
2061
|
+
hProv = xmlSecMSCryptoFindProvider(xmlSecMSCryptoProviderInfo_Dss, NULL, CRYPT_VERIFYCONTEXT, TRUE);
|
|
2062
|
+
if(hProv == 0) {
|
|
2063
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2064
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2065
|
+
"xmlSecMSCryptoFindProvider",
|
|
2066
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2067
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2068
|
+
goto done;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/* import the key blob */
|
|
2072
|
+
if (!CryptImportKey(hProv, xmlSecBufferGetData(&blob), xmlSecBufferGetSize(&blob), 0, 0, &hKey)) {
|
|
2073
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2074
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2075
|
+
"CryptImportKey",
|
|
2076
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
2077
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2078
|
+
goto done;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
data = xmlSecKeyDataCreate(id);
|
|
2082
|
+
if(data == NULL ) {
|
|
2083
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2084
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2085
|
+
"xmlSecKeyDataCreate",
|
|
2086
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2087
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2088
|
+
goto done;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
ret = xmlSecMSCryptoKeyDataAdoptKey(data, hProv, TRUE, hKey, 0, xmlSecKeyDataTypePublic);
|
|
2092
|
+
if(ret < 0) {
|
|
2093
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2094
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
2095
|
+
"xmlSecMSCryptoKeyDataAdoptKey",
|
|
2096
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2097
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2098
|
+
goto done;
|
|
2099
|
+
}
|
|
2100
|
+
hProv = 0;
|
|
2101
|
+
hKey = 0;
|
|
2102
|
+
|
|
2103
|
+
ret = xmlSecKeySetValue(key, data);
|
|
2104
|
+
if(ret < 0) {
|
|
2105
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2106
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
2107
|
+
"xmlSecKeySetValue",
|
|
2108
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2109
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2110
|
+
goto done;
|
|
2111
|
+
}
|
|
2112
|
+
data = NULL;
|
|
2113
|
+
|
|
2114
|
+
/* success */
|
|
2115
|
+
res = 0;
|
|
2116
|
+
|
|
2117
|
+
done:
|
|
2118
|
+
if (hKey != 0) {
|
|
2119
|
+
CryptDestroyKey(hKey);
|
|
2120
|
+
}
|
|
2121
|
+
if (hProv != 0) {
|
|
2122
|
+
CryptReleaseContext(hProv, 0);
|
|
2123
|
+
}
|
|
2124
|
+
if (data != NULL) {
|
|
2125
|
+
xmlSecKeyDataDestroy(data);
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
xmlSecBufferFinalize(&blob);
|
|
2129
|
+
xmlSecBnFinalize(&p);
|
|
2130
|
+
xmlSecBnFinalize(&q);
|
|
2131
|
+
xmlSecBnFinalize(&g);
|
|
2132
|
+
xmlSecBnFinalize(&y);
|
|
2133
|
+
|
|
2134
|
+
return(res);
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
static int
|
|
2138
|
+
xmlSecMSCryptoKeyDataDsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
|
|
2139
|
+
xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
|
|
2140
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
2141
|
+
xmlSecBuffer buf;
|
|
2142
|
+
DWORD dwBlobLen;
|
|
2143
|
+
xmlSecByte* blob;
|
|
2144
|
+
PUBLICKEYSTRUC* pubKeyStruc;
|
|
2145
|
+
DSSPUBKEY *pubKey;
|
|
2146
|
+
xmlSecSize keyLen, len;
|
|
2147
|
+
xmlNodePtr cur;
|
|
2148
|
+
int ret;
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
xmlSecAssert2(id == xmlSecMSCryptoKeyDataDsaId, -1);
|
|
2152
|
+
xmlSecAssert2(key != NULL, -1);
|
|
2153
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(xmlSecKeyGetValue(key), xmlSecMSCryptoKeyDataDsaId), -1);
|
|
2154
|
+
xmlSecAssert2(node != NULL, -1);
|
|
2155
|
+
xmlSecAssert2(keyInfoCtx != NULL, -1);
|
|
2156
|
+
|
|
2157
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(xmlSecKeyGetValue(key));
|
|
2158
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
2159
|
+
xmlSecAssert2(xmlSecMSCryptoKeyDataCtxGetKey(ctx) != 0, -1);
|
|
2160
|
+
|
|
2161
|
+
if (!CryptExportKey(xmlSecMSCryptoKeyDataCtxGetKey(ctx), 0, PUBLICKEYBLOB, 0, NULL, &dwBlobLen)) {
|
|
2162
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2163
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2164
|
+
"CryptExportKey",
|
|
2165
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2166
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2167
|
+
return(-1);
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
ret = xmlSecBufferInitialize(&buf, dwBlobLen);
|
|
2171
|
+
if(ret < 0) {
|
|
2172
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2173
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2174
|
+
"xmlSecBufferInitialize",
|
|
2175
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2176
|
+
"size=%ld", dwBlobLen);
|
|
2177
|
+
return(-1);
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
blob = xmlSecBufferGetData(&buf);
|
|
2181
|
+
if (!CryptExportKey(xmlSecMSCryptoKeyDataCtxGetKey(ctx), 0, PUBLICKEYBLOB, 0, blob, &dwBlobLen)) {
|
|
2182
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2183
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2184
|
+
"CryptExportKey",
|
|
2185
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
2186
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2187
|
+
xmlSecBufferFinalize(&buf);
|
|
2188
|
+
return(-1);
|
|
2189
|
+
}
|
|
2190
|
+
if (dwBlobLen < sizeof(PUBLICKEYSTRUC)) {
|
|
2191
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2192
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2193
|
+
NULL,
|
|
2194
|
+
XMLSEC_ERRORS_R_INVALID_DATA,
|
|
2195
|
+
"blobLen=%ld", dwBlobLen);
|
|
2196
|
+
xmlSecBufferFinalize(&buf);
|
|
2197
|
+
return(-1);
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
/* check PUBLICKEYSTRUC */
|
|
2201
|
+
pubKeyStruc = (PUBLICKEYSTRUC*)blob;
|
|
2202
|
+
if(pubKeyStruc->bVersion != 0x02) {
|
|
2203
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2204
|
+
NULL,
|
|
2205
|
+
"CryptExportKey",
|
|
2206
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
2207
|
+
"pubKeyStruc->bVersion=%d", pubKeyStruc->bVersion);
|
|
2208
|
+
xmlSecBufferFinalize(&buf);
|
|
2209
|
+
return(-1);
|
|
2210
|
+
}
|
|
2211
|
+
if(pubKeyStruc->bType != PUBLICKEYBLOB) {
|
|
2212
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2213
|
+
NULL,
|
|
2214
|
+
"CryptExportKey",
|
|
2215
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
2216
|
+
"pubKeyStruc->bType=%d", (int)pubKeyStruc->bType);
|
|
2217
|
+
xmlSecBufferFinalize(&buf);
|
|
2218
|
+
return(-1);
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
/* check DSSPUBKEY */
|
|
2222
|
+
pubKey = (DSSPUBKEY*)(blob + sizeof(PUBLICKEYSTRUC));
|
|
2223
|
+
if(pubKey->magic != 0x31535344) { /* DSS key magic */
|
|
2224
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2225
|
+
NULL,
|
|
2226
|
+
"CryptExportKey",
|
|
2227
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
2228
|
+
"pubKey->magic=0x%08lx", pubKey->magic);
|
|
2229
|
+
xmlSecBufferFinalize(&buf);
|
|
2230
|
+
return(-1);
|
|
2231
|
+
}
|
|
2232
|
+
keyLen = pubKey->bitlen / 8;
|
|
2233
|
+
|
|
2234
|
+
/* we assume that sizeof(q) < 0x14, sizeof(g) <= sizeof(p) and sizeof(y) <= sizeof(p) */
|
|
2235
|
+
if (dwBlobLen < sizeof(PUBLICKEYSTRUC) + sizeof(DSSPUBKEY) + 3 * keyLen + 0x14 + sizeof(DSSSEED)) {
|
|
2236
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2237
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2238
|
+
NULL,
|
|
2239
|
+
XMLSEC_ERRORS_R_INVALID_DATA,
|
|
2240
|
+
"blobLen=%ld; keyLen=%d", dwBlobLen, keyLen);
|
|
2241
|
+
xmlSecBufferFinalize(&buf);
|
|
2242
|
+
return(-1);
|
|
2243
|
+
}
|
|
2244
|
+
blob += sizeof(PUBLICKEYSTRUC) + sizeof(DSSPUBKEY);
|
|
2245
|
+
|
|
2246
|
+
/* first is P node */
|
|
2247
|
+
cur = xmlSecAddChild(node, xmlSecNodeDSAP, xmlSecDSigNs);
|
|
2248
|
+
if(cur == NULL) {
|
|
2249
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2250
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2251
|
+
"xmlSecAddChild",
|
|
2252
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2253
|
+
"node=%s",
|
|
2254
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAP));
|
|
2255
|
+
xmlSecBufferFinalize(&buf);
|
|
2256
|
+
return(-1);
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
ret = xmlSecBnBlobSetNodeValue(blob, keyLen, cur, xmlSecBnBase64, 1, 1);
|
|
2260
|
+
if(ret < 0) {
|
|
2261
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2262
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2263
|
+
"xmlSecBnBlobSetNodeValue",
|
|
2264
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2265
|
+
"node=%s",
|
|
2266
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAP));
|
|
2267
|
+
xmlSecBufferFinalize(&buf);
|
|
2268
|
+
return(-1);
|
|
2269
|
+
}
|
|
2270
|
+
blob += keyLen;
|
|
2271
|
+
|
|
2272
|
+
/* next is Q node. */
|
|
2273
|
+
cur = xmlSecAddChild(node, xmlSecNodeDSAQ, xmlSecDSigNs);
|
|
2274
|
+
if(cur == NULL) {
|
|
2275
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2276
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2277
|
+
"xmlSecAddChild",
|
|
2278
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2279
|
+
"node=%s",
|
|
2280
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAQ));
|
|
2281
|
+
xmlSecBufferFinalize(&buf);
|
|
2282
|
+
return(-1);
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
/* we think that the size of q is 0x14, skip trailing zeros */
|
|
2286
|
+
for(len = 0x14; len > 0 && blob[len - 1] == 0; --len);
|
|
2287
|
+
|
|
2288
|
+
ret = xmlSecBnBlobSetNodeValue(blob, len, cur, xmlSecBnBase64, 1, 1);
|
|
2289
|
+
if(ret < 0) {
|
|
2290
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2291
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2292
|
+
"xmlSecBnBlobSetNodeValue",
|
|
2293
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2294
|
+
"node=%s",
|
|
2295
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAQ));
|
|
2296
|
+
xmlSecBufferFinalize(&buf);
|
|
2297
|
+
return(-1);
|
|
2298
|
+
}
|
|
2299
|
+
blob += 0x14;
|
|
2300
|
+
|
|
2301
|
+
/* next is G node. */
|
|
2302
|
+
cur = xmlSecAddChild(node, xmlSecNodeDSAG, xmlSecDSigNs);
|
|
2303
|
+
if(cur == NULL) {
|
|
2304
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2305
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2306
|
+
"xmlSecAddChild",
|
|
2307
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2308
|
+
"node=%s",
|
|
2309
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAG));
|
|
2310
|
+
xmlSecBufferFinalize(&buf);
|
|
2311
|
+
return(-1);
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
/* skip trailing zeros */
|
|
2315
|
+
for(len = keyLen; len > 0 && blob[len - 1] == 0; --len);
|
|
2316
|
+
|
|
2317
|
+
ret = xmlSecBnBlobSetNodeValue(blob, len, cur, xmlSecBnBase64, 1, 1);
|
|
2318
|
+
if(ret < 0) {
|
|
2319
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2320
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2321
|
+
"xmlSecBnBlobSetNodeValue",
|
|
2322
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2323
|
+
"node=%s",
|
|
2324
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAG));
|
|
2325
|
+
xmlSecBufferFinalize(&buf);
|
|
2326
|
+
return(-1);
|
|
2327
|
+
}
|
|
2328
|
+
blob += keyLen;
|
|
2329
|
+
|
|
2330
|
+
/* next is X node: not supported in MSCrypto */
|
|
2331
|
+
|
|
2332
|
+
/* next is Y node. */
|
|
2333
|
+
cur = xmlSecAddChild(node, xmlSecNodeDSAY, xmlSecDSigNs);
|
|
2334
|
+
if(cur == NULL) {
|
|
2335
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2336
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2337
|
+
"xmlSecAddChild",
|
|
2338
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2339
|
+
"node=%s",
|
|
2340
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAY));
|
|
2341
|
+
xmlSecBufferFinalize(&buf);
|
|
2342
|
+
return(-1);
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
/* skip trailing zeros */
|
|
2346
|
+
for(len = keyLen; len > 0 && blob[len - 1] == 0; --len);
|
|
2347
|
+
|
|
2348
|
+
ret = xmlSecBnBlobSetNodeValue(blob, len, cur, xmlSecBnBase64, 1, 1);
|
|
2349
|
+
if(ret < 0) {
|
|
2350
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2351
|
+
xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
|
|
2352
|
+
"xmlSecBnBlobSetNodeValue",
|
|
2353
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2354
|
+
"node=%s",
|
|
2355
|
+
xmlSecErrorsSafeString(xmlSecNodeDSAY));
|
|
2356
|
+
xmlSecBufferFinalize(&buf);
|
|
2357
|
+
return(-1);
|
|
2358
|
+
}
|
|
2359
|
+
blob += keyLen;
|
|
2360
|
+
|
|
2361
|
+
xmlSecBufferFinalize(&buf);
|
|
2362
|
+
return(0);
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
static int
|
|
2366
|
+
xmlSecMSCryptoKeyDataDsaGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type ATTRIBUTE_UNUSED) {
|
|
2367
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
2368
|
+
HCRYPTPROV hProv = 0;
|
|
2369
|
+
HCRYPTKEY hKey = 0;
|
|
2370
|
+
DWORD dwKeySpec;
|
|
2371
|
+
DWORD dwSize;
|
|
2372
|
+
int res = -1;
|
|
2373
|
+
int ret;
|
|
2374
|
+
|
|
2375
|
+
xmlSecAssert2(xmlSecKeyDataIsValid(data), xmlSecKeyDataTypeUnknown);
|
|
2376
|
+
xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), xmlSecKeyDataTypeUnknown);
|
|
2377
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataDsaId), -1);
|
|
2378
|
+
xmlSecAssert2(sizeBits > 0, -1);
|
|
2379
|
+
|
|
2380
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
2381
|
+
|
|
2382
|
+
hProv = xmlSecMSCryptoFindProvider(ctx->providers, NULL, CRYPT_VERIFYCONTEXT, TRUE);
|
|
2383
|
+
if(hProv == 0) {
|
|
2384
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2385
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
2386
|
+
"xmlSecMSCryptoFindProvider",
|
|
2387
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2388
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2389
|
+
return(-1);
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
dwKeySpec = AT_SIGNATURE;
|
|
2393
|
+
dwSize = ((sizeBits << 16) | CRYPT_EXPORTABLE);
|
|
2394
|
+
if (!CryptGenKey(hProv, CALG_DSS_SIGN, dwSize, &hKey)) {
|
|
2395
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2396
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
2397
|
+
"CryptGenKey",
|
|
2398
|
+
XMLSEC_ERRORS_R_CRYPTO_FAILED,
|
|
2399
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2400
|
+
goto done;
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
ret = xmlSecMSCryptoKeyDataAdoptKey(data, hProv, TRUE, hKey, dwKeySpec,
|
|
2404
|
+
xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate);
|
|
2405
|
+
if(ret < 0) {
|
|
2406
|
+
xmlSecError(XMLSEC_ERRORS_HERE,
|
|
2407
|
+
xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
|
|
2408
|
+
"xmlSecMSCryptoKeyDataAdoptKey",
|
|
2409
|
+
XMLSEC_ERRORS_R_XMLSEC_FAILED,
|
|
2410
|
+
XMLSEC_ERRORS_NO_MESSAGE);
|
|
2411
|
+
goto done;
|
|
2412
|
+
}
|
|
2413
|
+
hProv = 0;
|
|
2414
|
+
hKey = 0;
|
|
2415
|
+
|
|
2416
|
+
/* success */
|
|
2417
|
+
res = 0;
|
|
2418
|
+
|
|
2419
|
+
done:
|
|
2420
|
+
if (hProv != 0) {
|
|
2421
|
+
CryptReleaseContext(hProv, 0);
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
if (hKey != 0) {
|
|
2425
|
+
CryptDestroyKey(hKey);
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
return(res);
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
static xmlSecKeyDataType
|
|
2432
|
+
xmlSecMSCryptoKeyDataDsaGetType(xmlSecKeyDataPtr data) {
|
|
2433
|
+
return(xmlSecMSCryptoKeyDataGetType(data));
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
static xmlSecSize
|
|
2437
|
+
xmlSecMSCryptoKeyDataDsaGetSize(xmlSecKeyDataPtr data) {
|
|
2438
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataDsaId), 0);
|
|
2439
|
+
|
|
2440
|
+
return xmlSecMSCryptoKeyDataGetSize(data);
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
static void
|
|
2444
|
+
xmlSecMSCryptoKeyDataDsaDebugDump(xmlSecKeyDataPtr data, FILE* output) {
|
|
2445
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataDsaId));
|
|
2446
|
+
xmlSecAssert(output != NULL);
|
|
2447
|
+
|
|
2448
|
+
fprintf(output, "=== dsa key: size = %d\n",
|
|
2449
|
+
xmlSecMSCryptoKeyDataDsaGetSize(data));
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
static void
|
|
2453
|
+
xmlSecMSCryptoKeyDataDsaDebugXmlDump(xmlSecKeyDataPtr data, FILE* output) {
|
|
2454
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataDsaId));
|
|
2455
|
+
xmlSecAssert(output != NULL);
|
|
2456
|
+
|
|
2457
|
+
fprintf(output, "<DSAKeyValue size=\"%d\" />\n",
|
|
2458
|
+
xmlSecMSCryptoKeyDataDsaGetSize(data));
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
#endif /* XMLSEC_NO_DSA */
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
#ifndef XMLSEC_NO_GOST
|
|
2465
|
+
/**************************************************************************
|
|
2466
|
+
*
|
|
2467
|
+
* GOST2001 xml key representation processing. Contain errors.
|
|
2468
|
+
*
|
|
2469
|
+
*************************************************************************/
|
|
2470
|
+
static int xmlSecMSCryptoKeyDataGost2001Initialize(xmlSecKeyDataPtr data);
|
|
2471
|
+
static int xmlSecMSCryptoKeyDataGost2001Duplicate(xmlSecKeyDataPtr dst,
|
|
2472
|
+
xmlSecKeyDataPtr src);
|
|
2473
|
+
static void xmlSecMSCryptoKeyDataGost2001Finalize(xmlSecKeyDataPtr data);
|
|
2474
|
+
static int xmlSecMSCryptoKeyDataGost2001XmlRead (xmlSecKeyDataId id,
|
|
2475
|
+
xmlSecKeyPtr key,
|
|
2476
|
+
xmlNodePtr node,
|
|
2477
|
+
xmlSecKeyInfoCtxPtr keyInfoCtx);
|
|
2478
|
+
static int xmlSecMSCryptoKeyDataGost2001XmlWrite(xmlSecKeyDataId id,
|
|
2479
|
+
xmlSecKeyPtr key,
|
|
2480
|
+
xmlNodePtr node,
|
|
2481
|
+
xmlSecKeyInfoCtxPtr keyInfoCtx);
|
|
2482
|
+
static int xmlSecMSCryptoKeyDataGost2001Generate(xmlSecKeyDataPtr data,
|
|
2483
|
+
xmlSecSize sizeBits,
|
|
2484
|
+
xmlSecKeyDataType type);
|
|
2485
|
+
|
|
2486
|
+
static xmlSecKeyDataType xmlSecMSCryptoKeyDataGost2001GetType(xmlSecKeyDataPtr data);
|
|
2487
|
+
static xmlSecSize xmlSecMSCryptoKeyDataGost2001GetSize(xmlSecKeyDataPtr data);
|
|
2488
|
+
static void xmlSecMSCryptoKeyDataGost2001DebugDump(xmlSecKeyDataPtr data,
|
|
2489
|
+
FILE* output);
|
|
2490
|
+
static void xmlSecMSCryptoKeyDataGost2001DebugXmlDump(xmlSecKeyDataPtr data,
|
|
2491
|
+
FILE* output);
|
|
2492
|
+
|
|
2493
|
+
static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataGost2001Klass = {
|
|
2494
|
+
sizeof(xmlSecKeyDataKlass),
|
|
2495
|
+
xmlSecMSCryptoKeyDataSize,
|
|
2496
|
+
|
|
2497
|
+
/* data */
|
|
2498
|
+
xmlSecNameGOST2001KeyValue,
|
|
2499
|
+
xmlSecKeyDataUsageKeyValueNode | xmlSecKeyDataUsageRetrievalMethodNodeXml,
|
|
2500
|
+
/* xmlSecKeyDataUsage usage; */
|
|
2501
|
+
xmlSecHrefGOST2001KeyValue, /* const xmlChar* href; */
|
|
2502
|
+
xmlSecNodeGOST2001KeyValue, /* const xmlChar* dataNodeName; */
|
|
2503
|
+
xmlSecDSigNs, /* const xmlChar* dataNodeNs; */
|
|
2504
|
+
|
|
2505
|
+
/* constructors/destructor */
|
|
2506
|
+
xmlSecMSCryptoKeyDataGost2001Initialize, /* xmlSecKeyDataInitializeMethod initialize; */
|
|
2507
|
+
xmlSecMSCryptoKeyDataGost2001Duplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */
|
|
2508
|
+
xmlSecMSCryptoKeyDataGost2001Finalize, /* xmlSecKeyDataFinalizeMethod finalize; */
|
|
2509
|
+
NULL, /* xmlSecMSCryptoKeyDataGost2001Generate,*/ /* xmlSecKeyDataGenerateMethod generate; */
|
|
2510
|
+
|
|
2511
|
+
/* get info */
|
|
2512
|
+
xmlSecMSCryptoKeyDataGost2001GetType, /* xmlSecKeyDataGetTypeMethod getType; */
|
|
2513
|
+
xmlSecMSCryptoKeyDataGost2001GetSize, /* xmlSecKeyDataGetSizeMethod getSize; */
|
|
2514
|
+
NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */
|
|
2515
|
+
|
|
2516
|
+
/* read/write */
|
|
2517
|
+
NULL, /* xmlSecKeyDataXmlReadMethod xmlRead; */
|
|
2518
|
+
NULL, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */
|
|
2519
|
+
NULL, /* xmlSecKeyDataBinReadMethod binRead; */
|
|
2520
|
+
NULL, /* xmlSecKeyDataBinWriteMethod binWrite; */
|
|
2521
|
+
|
|
2522
|
+
/* debug */
|
|
2523
|
+
xmlSecMSCryptoKeyDataGost2001DebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */
|
|
2524
|
+
xmlSecMSCryptoKeyDataGost2001DebugXmlDump,/* xmlSecKeyDataDebugDumpMethod debugXmlDump; */
|
|
2525
|
+
|
|
2526
|
+
/* reserved for the future */
|
|
2527
|
+
NULL, /* void* reserved0; */
|
|
2528
|
+
NULL, /* void* reserved1; */
|
|
2529
|
+
};
|
|
2530
|
+
|
|
2531
|
+
/* Ordered list of providers to search for algorithm implementation using
|
|
2532
|
+
* xmlSecMSCryptoFindProvider() function
|
|
2533
|
+
*
|
|
2534
|
+
* MUST END with { NULL, 0 } !!!
|
|
2535
|
+
*/
|
|
2536
|
+
static xmlSecMSCryptoProviderInfo xmlSecMSCryptoProviderInfo_Gost[] = {
|
|
2537
|
+
{ MAGPRO_CSP, PROV_MAGPRO_GOST },
|
|
2538
|
+
{ CRYPTOPRO_CSP, PROV_CRYPTOPRO_GOST },
|
|
2539
|
+
{ NULL, 0 }
|
|
2540
|
+
};
|
|
2541
|
+
|
|
2542
|
+
/**
|
|
2543
|
+
* xmlSecMSCryptoKeyDataGost2001GetKlass:
|
|
2544
|
+
*
|
|
2545
|
+
* The GOST2001 key data klass.
|
|
2546
|
+
*
|
|
2547
|
+
* Returns: pointer to GOST2001 key data klass.
|
|
2548
|
+
*/
|
|
2549
|
+
xmlSecKeyDataId
|
|
2550
|
+
xmlSecMSCryptoKeyDataGost2001GetKlass(void) {
|
|
2551
|
+
return(&xmlSecMSCryptoKeyDataGost2001Klass);
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
static int
|
|
2556
|
+
xmlSecMSCryptoKeyDataGost2001Initialize(xmlSecKeyDataPtr data) {
|
|
2557
|
+
xmlSecMSCryptoKeyDataCtxPtr ctx;
|
|
2558
|
+
|
|
2559
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataGost2001Id), xmlSecKeyDataTypeUnknown);
|
|
2560
|
+
|
|
2561
|
+
xmlSecMSCryptoKeyDataInitialize(data);
|
|
2562
|
+
|
|
2563
|
+
ctx = xmlSecMSCryptoKeyDataGetCtx(data);
|
|
2564
|
+
xmlSecAssert2(ctx != NULL, -1);
|
|
2565
|
+
|
|
2566
|
+
ctx->providers = xmlSecMSCryptoProviderInfo_Gost;
|
|
2567
|
+
return(0);
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
static int
|
|
2571
|
+
xmlSecMSCryptoKeyDataGost2001Duplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) {
|
|
2572
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(dst, xmlSecMSCryptoKeyDataGost2001Id), -1);
|
|
2573
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(src, xmlSecMSCryptoKeyDataGost2001Id), -1);
|
|
2574
|
+
|
|
2575
|
+
return(xmlSecMSCryptoKeyDataDuplicate(dst, src));
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
static void
|
|
2579
|
+
xmlSecMSCryptoKeyDataGost2001Finalize(xmlSecKeyDataPtr data) {
|
|
2580
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataGost2001Id));
|
|
2581
|
+
|
|
2582
|
+
xmlSecMSCryptoKeyDataFinalize(data);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
static xmlSecKeyDataType
|
|
2586
|
+
xmlSecMSCryptoKeyDataGost2001GetType(xmlSecKeyDataPtr data) {
|
|
2587
|
+
return(xmlSecMSCryptoKeyDataGetType(data));
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
static xmlSecSize
|
|
2591
|
+
xmlSecMSCryptoKeyDataGost2001GetSize(xmlSecKeyDataPtr data) {
|
|
2592
|
+
xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataGost2001Id), 0);
|
|
2593
|
+
|
|
2594
|
+
return xmlSecMSCryptoKeyDataGetSize(data);
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
static void
|
|
2598
|
+
xmlSecMSCryptoKeyDataGost2001DebugDump(xmlSecKeyDataPtr data, FILE* output) {
|
|
2599
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataGost2001Id));
|
|
2600
|
+
xmlSecAssert(output != NULL);
|
|
2601
|
+
|
|
2602
|
+
fprintf(output, "=== dsa key: size = %d\n",
|
|
2603
|
+
xmlSecMSCryptoKeyDataGost2001GetSize(data));
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
static void
|
|
2607
|
+
xmlSecMSCryptoKeyDataGost2001DebugXmlDump(xmlSecKeyDataPtr data, FILE* output) {
|
|
2608
|
+
xmlSecAssert(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataGost2001Id));
|
|
2609
|
+
xmlSecAssert(output != NULL);
|
|
2610
|
+
|
|
2611
|
+
fprintf(output, "<GOST2001KeyValue size=\"%d\" />\n",
|
|
2612
|
+
xmlSecMSCryptoKeyDataGost2001GetSize(data));
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
#endif /* XMLSEC_NO_GOST*/
|