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.
Files changed (969) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/README.md +2 -0
  4. data/Rakefile +2 -0
  5. data/ext/xmlsec/extconf.rb +14 -0
  6. data/lib/xmlsec-shim.rb +27 -0
  7. data/lib/xmlsec-shim/version.rb +5 -0
  8. data/vendor/xmlsec1-1.2.18/AUTHORS +8 -0
  9. data/vendor/xmlsec1-1.2.18/COPYING +105 -0
  10. data/vendor/xmlsec1-1.2.18/ChangeLog +1810 -0
  11. data/vendor/xmlsec1-1.2.18/Copyright +105 -0
  12. data/vendor/xmlsec1-1.2.18/HACKING +199 -0
  13. data/vendor/xmlsec1-1.2.18/INSTALL +38 -0
  14. data/vendor/xmlsec1-1.2.18/Makefile.am +186 -0
  15. data/vendor/xmlsec1-1.2.18/Makefile.in +1155 -0
  16. data/vendor/xmlsec1-1.2.18/NEWS +1 -0
  17. data/vendor/xmlsec1-1.2.18/README +15 -0
  18. data/vendor/xmlsec1-1.2.18/TODO +156 -0
  19. data/vendor/xmlsec1-1.2.18/aclocal.m4 +1197 -0
  20. data/vendor/xmlsec1-1.2.18/apps/Makefile.am +84 -0
  21. data/vendor/xmlsec1-1.2.18/apps/Makefile.in +694 -0
  22. data/vendor/xmlsec1-1.2.18/apps/cmdline.c +355 -0
  23. data/vendor/xmlsec1-1.2.18/apps/cmdline.h +89 -0
  24. data/vendor/xmlsec1-1.2.18/apps/crypto.c +396 -0
  25. data/vendor/xmlsec1-1.2.18/apps/crypto.h +70 -0
  26. data/vendor/xmlsec1-1.2.18/apps/xmlsec.c +3058 -0
  27. data/vendor/xmlsec1-1.2.18/config.guess +1502 -0
  28. data/vendor/xmlsec1-1.2.18/config.h.in +134 -0
  29. data/vendor/xmlsec1-1.2.18/config.sub +1714 -0
  30. data/vendor/xmlsec1-1.2.18/configure +17363 -0
  31. data/vendor/xmlsec1-1.2.18/configure.in +1633 -0
  32. data/vendor/xmlsec1-1.2.18/depcomp +630 -0
  33. data/vendor/xmlsec1-1.2.18/docs/Makefile.am +65 -0
  34. data/vendor/xmlsec1-1.2.18/docs/Makefile.in +721 -0
  35. data/vendor/xmlsec1-1.2.18/docs/api/Makefile.am +209 -0
  36. data/vendor/xmlsec1-1.2.18/docs/api/Makefile.in +664 -0
  37. data/vendor/xmlsec1-1.2.18/docs/api/chapters/compiling-and-linking.sgml +252 -0
  38. data/vendor/xmlsec1-1.2.18/docs/api/chapters/creating-templates.sgml +325 -0
  39. data/vendor/xmlsec1-1.2.18/docs/api/chapters/examples.sgml +102 -0
  40. data/vendor/xmlsec1-1.2.18/docs/api/chapters/init-and-shutdown.sgml +104 -0
  41. data/vendor/xmlsec1-1.2.18/docs/api/chapters/new-crypto.sgml +487 -0
  42. data/vendor/xmlsec1-1.2.18/docs/api/chapters/sign-and-encrypt.sgml +286 -0
  43. data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-contexts.sgml +138 -0
  44. data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-keys.sgml +26 -0
  45. data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-keysmngr.sgml +592 -0
  46. data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-transforms.sgml +67 -0
  47. data/vendor/xmlsec1-1.2.18/docs/api/chapters/using-x509-certs.sgml +197 -0
  48. data/vendor/xmlsec1-1.2.18/docs/api/chapters/verify-and-decrypt.sgml +265 -0
  49. data/vendor/xmlsec1-1.2.18/docs/api/home.png +0 -0
  50. data/vendor/xmlsec1-1.2.18/docs/api/images/diagrams.sxd +0 -0
  51. data/vendor/xmlsec1-1.2.18/docs/api/images/encryption-structure.png +0 -0
  52. data/vendor/xmlsec1-1.2.18/docs/api/images/key.png +0 -0
  53. data/vendor/xmlsec1-1.2.18/docs/api/images/keysmngr.png +0 -0
  54. data/vendor/xmlsec1-1.2.18/docs/api/images/sign-enc-model.png +0 -0
  55. data/vendor/xmlsec1-1.2.18/docs/api/images/signature-structure.png +0 -0
  56. data/vendor/xmlsec1-1.2.18/docs/api/images/structure.png +0 -0
  57. data/vendor/xmlsec1-1.2.18/docs/api/images/transform.png +0 -0
  58. data/vendor/xmlsec1-1.2.18/docs/api/images/transforms-chain.png +0 -0
  59. data/vendor/xmlsec1-1.2.18/docs/api/images/verif-dec-model.png +0 -0
  60. data/vendor/xmlsec1-1.2.18/docs/api/index.html +307 -0
  61. data/vendor/xmlsec1-1.2.18/docs/api/index.sgml +43 -0
  62. data/vendor/xmlsec1-1.2.18/docs/api/left.png +0 -0
  63. data/vendor/xmlsec1-1.2.18/docs/api/right.png +0 -0
  64. data/vendor/xmlsec1-1.2.18/docs/api/up.png +0 -0
  65. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-app.html +1525 -0
  66. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-base64.html +357 -0
  67. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-bn.html +705 -0
  68. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-buffer.html +603 -0
  69. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-custom-keys-manager.html +475 -0
  70. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-decrypt-with-keys-mngr.html +396 -0
  71. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-decrypt-with-signle-key.html +326 -0
  72. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-dl.html +245 -0
  73. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encrypt-dynamic-template.html +386 -0
  74. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encrypt-template-file.html +364 -0
  75. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encrypt-with-session-key.html +495 -0
  76. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-encryption-klasses.html +101 -0
  77. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-errors.html +744 -0
  78. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples-sign-dynamimc-template.html +406 -0
  79. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples-sign-template-file.html +388 -0
  80. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples-sign-x509.html +447 -0
  81. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-examples.html +119 -0
  82. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt-app.html +578 -0
  83. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt-crypto.html +1128 -0
  84. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt-ref.html +107 -0
  85. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gcrypt.sgml +15 -0
  86. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls-app.html +576 -0
  87. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls-crypto.html +1076 -0
  88. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls-ref.html +107 -0
  89. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-gnutls.sgml +15 -0
  90. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-index.html +1570 -0
  91. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-index.sgml +1471 -0
  92. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-io.html +226 -0
  93. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keyinfo.html +700 -0
  94. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keys.html +1161 -0
  95. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keysdata.html +2067 -0
  96. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-keysmngr.html +743 -0
  97. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-list.html +643 -0
  98. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-membuf.html +143 -0
  99. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-app.html +747 -0
  100. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-certkeys.html +252 -0
  101. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-crypto.html +1153 -0
  102. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-keysstore.html +209 -0
  103. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-ref.html +113 -0
  104. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto-x509.html +478 -0
  105. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-mscrypto.sgml +21 -0
  106. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nodeset.html +542 -0
  107. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling-others.html +102 -0
  108. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling-unix.html +223 -0
  109. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling-windows.html +138 -0
  110. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-compiling.html +117 -0
  111. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-contexts.html +229 -0
  112. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-custom-keys-store.html +250 -0
  113. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-decrypt.html +205 -0
  114. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-dynamic-encryption-templates.html +240 -0
  115. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-dynamic-signature-templates.html +250 -0
  116. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-encrypt.html +223 -0
  117. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-include-files.html +141 -0
  118. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-init-shutdown.html +194 -0
  119. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keys-manager-sign-enc.html +307 -0
  120. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keys-mngr-verify-decrypt.html +179 -0
  121. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keys.html +120 -0
  122. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-keysmngr.html +140 -0
  123. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-functions.html +151 -0
  124. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-key-stores.html +83 -0
  125. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-keys.html +103 -0
  126. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-klasses.html +217 -0
  127. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-sharing-results.html +125 -0
  128. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-simple-keys-mngr.html +102 -0
  129. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-skeleton.html +254 -0
  130. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto-transforms.html +170 -0
  131. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-new-crypto.html +136 -0
  132. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-overview.html +102 -0
  133. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-sign-encrypt.html +120 -0
  134. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-sign-x509.html +176 -0
  135. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-sign.html +210 -0
  136. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-simple-keys-store.html +177 -0
  137. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-structure.html +115 -0
  138. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-templates.html +114 -0
  139. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-transforms.html +154 -0
  140. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-verify-decrypt.html +120 -0
  141. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-verify-x509.html +180 -0
  142. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-verify.html +210 -0
  143. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes-x509.html +114 -0
  144. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-notes.html +115 -0
  145. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-app.html +740 -0
  146. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-bignum.html +176 -0
  147. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-crypto.html +978 -0
  148. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-keysstore.html +209 -0
  149. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-pkikeys.html +211 -0
  150. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-ref.html +115 -0
  151. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss-x509.html +467 -0
  152. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-nss.sgml +23 -0
  153. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-app.html +800 -0
  154. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-bn.html +170 -0
  155. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-crypto.html +1329 -0
  156. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-evp.html +184 -0
  157. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-ref.html +113 -0
  158. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl-x509.html +567 -0
  159. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-openssl.sgml +21 -0
  160. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-parser.html +223 -0
  161. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-ref.html +149 -0
  162. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-reference.html +106 -0
  163. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-signature-klasses.html +101 -0
  164. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-templates.html +1290 -0
  165. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-transforms.html +3059 -0
  166. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-key.html +318 -0
  167. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-keys-mngr.html +388 -0
  168. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-restrictions.html +715 -0
  169. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-verify-with-x509.html +369 -0
  170. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-version.html +143 -0
  171. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-x509.html +181 -0
  172. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmldsig.html +853 -0
  173. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmlenc.html +584 -0
  174. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmlsec.html +300 -0
  175. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec-xmltree.html +1529 -0
  176. data/vendor/xmlsec1-1.2.18/docs/api/xmlsec.sgml +307 -0
  177. data/vendor/xmlsec1-1.2.18/docs/authors.html +59 -0
  178. data/vendor/xmlsec1-1.2.18/docs/bugs.html +106 -0
  179. data/vendor/xmlsec1-1.2.18/docs/c14n.html +73 -0
  180. data/vendor/xmlsec1-1.2.18/docs/documentation.html +65 -0
  181. data/vendor/xmlsec1-1.2.18/docs/download.html +115 -0
  182. data/vendor/xmlsec1-1.2.18/docs/faq.html +449 -0
  183. data/vendor/xmlsec1-1.2.18/docs/images/bart.gif +0 -0
  184. data/vendor/xmlsec1-1.2.18/docs/images/libxml2-logo.png +0 -0
  185. data/vendor/xmlsec1-1.2.18/docs/images/libxslt-logo.png +0 -0
  186. data/vendor/xmlsec1-1.2.18/docs/images/logo.gif +0 -0
  187. data/vendor/xmlsec1-1.2.18/docs/images/openssl-logo.png +0 -0
  188. data/vendor/xmlsec1-1.2.18/docs/images/xmlsec-logo.gif +0 -0
  189. data/vendor/xmlsec1-1.2.18/docs/index.html +109 -0
  190. data/vendor/xmlsec1-1.2.18/docs/news.html +545 -0
  191. data/vendor/xmlsec1-1.2.18/docs/related.html +165 -0
  192. data/vendor/xmlsec1-1.2.18/docs/xmldsig-verifier.html +138 -0
  193. data/vendor/xmlsec1-1.2.18/docs/xmldsig.html +646 -0
  194. data/vendor/xmlsec1-1.2.18/docs/xmlenc.html +464 -0
  195. data/vendor/xmlsec1-1.2.18/docs/xmlsec-man.html +291 -0
  196. data/vendor/xmlsec1-1.2.18/docs/xmlsec.xsl +194 -0
  197. data/vendor/xmlsec1-1.2.18/examples/Makefile +40 -0
  198. data/vendor/xmlsec1-1.2.18/examples/Makefile.w32 +88 -0
  199. data/vendor/xmlsec1-1.2.18/examples/README +126 -0
  200. data/vendor/xmlsec1-1.2.18/examples/binary.dat +1 -0
  201. data/vendor/xmlsec1-1.2.18/examples/decrypt1.c +223 -0
  202. data/vendor/xmlsec1-1.2.18/examples/decrypt2.c +293 -0
  203. data/vendor/xmlsec1-1.2.18/examples/decrypt3.c +372 -0
  204. data/vendor/xmlsec1-1.2.18/examples/deskey.bin +1 -0
  205. data/vendor/xmlsec1-1.2.18/examples/encrypt1-res.xml +13 -0
  206. data/vendor/xmlsec1-1.2.18/examples/encrypt1-tmpl.xml +13 -0
  207. data/vendor/xmlsec1-1.2.18/examples/encrypt1.c +219 -0
  208. data/vendor/xmlsec1-1.2.18/examples/encrypt2-doc.xml +9 -0
  209. data/vendor/xmlsec1-1.2.18/examples/encrypt2-res.xml +14 -0
  210. data/vendor/xmlsec1-1.2.18/examples/encrypt2.c +244 -0
  211. data/vendor/xmlsec1-1.2.18/examples/encrypt3-doc.xml +9 -0
  212. data/vendor/xmlsec1-1.2.18/examples/encrypt3-res.xml +27 -0
  213. data/vendor/xmlsec1-1.2.18/examples/encrypt3.c +340 -0
  214. data/vendor/xmlsec1-1.2.18/examples/mywin32make.bat +18 -0
  215. data/vendor/xmlsec1-1.2.18/examples/rootcert.pem +25 -0
  216. data/vendor/xmlsec1-1.2.18/examples/rsacert.pem +83 -0
  217. data/vendor/xmlsec1-1.2.18/examples/rsakey.pem +27 -0
  218. data/vendor/xmlsec1-1.2.18/examples/rsapub.pem +9 -0
  219. data/vendor/xmlsec1-1.2.18/examples/sign1-res.xml +31 -0
  220. data/vendor/xmlsec1-1.2.18/examples/sign1-tmpl.xml +27 -0
  221. data/vendor/xmlsec1-1.2.18/examples/sign1.c +212 -0
  222. data/vendor/xmlsec1-1.2.18/examples/sign2-doc.xml +9 -0
  223. data/vendor/xmlsec1-1.2.18/examples/sign2-res.xml +30 -0
  224. data/vendor/xmlsec1-1.2.18/examples/sign2.c +248 -0
  225. data/vendor/xmlsec1-1.2.18/examples/sign3-doc.xml +9 -0
  226. data/vendor/xmlsec1-1.2.18/examples/sign3-res.xml +58 -0
  227. data/vendor/xmlsec1-1.2.18/examples/sign3.c +261 -0
  228. data/vendor/xmlsec1-1.2.18/examples/verify1.c +215 -0
  229. data/vendor/xmlsec1-1.2.18/examples/verify2.c +285 -0
  230. data/vendor/xmlsec1-1.2.18/examples/verify3.c +266 -0
  231. data/vendor/xmlsec1-1.2.18/examples/verify4-bad-res.xml +90 -0
  232. data/vendor/xmlsec1-1.2.18/examples/verify4-bad-tmpl.xml +54 -0
  233. data/vendor/xmlsec1-1.2.18/examples/verify4-res.xml +80 -0
  234. data/vendor/xmlsec1-1.2.18/examples/verify4-tmpl.xml +47 -0
  235. data/vendor/xmlsec1-1.2.18/examples/verify4.c +309 -0
  236. data/vendor/xmlsec1-1.2.18/examples/xkms-server.c +839 -0
  237. data/vendor/xmlsec1-1.2.18/examples/xmldsigverify.c +381 -0
  238. data/vendor/xmlsec1-1.2.18/include/Makefile.am +4 -0
  239. data/vendor/xmlsec1-1.2.18/include/Makefile.in +656 -0
  240. data/vendor/xmlsec1-1.2.18/include/xmlsec/Makefile.am +63 -0
  241. data/vendor/xmlsec1-1.2.18/include/xmlsec/Makefile.in +767 -0
  242. data/vendor/xmlsec1-1.2.18/include/xmlsec/app.h +424 -0
  243. data/vendor/xmlsec1-1.2.18/include/xmlsec/base64.h +67 -0
  244. data/vendor/xmlsec1-1.2.18/include/xmlsec/bn.h +99 -0
  245. data/vendor/xmlsec1-1.2.18/include/xmlsec/buffer.h +108 -0
  246. data/vendor/xmlsec1-1.2.18/include/xmlsec/crypto.h +75 -0
  247. data/vendor/xmlsec1-1.2.18/include/xmlsec/dl.h +56 -0
  248. data/vendor/xmlsec1-1.2.18/include/xmlsec/errors.h +504 -0
  249. data/vendor/xmlsec1-1.2.18/include/xmlsec/exports.h +111 -0
  250. data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/Makefile.am +13 -0
  251. data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/Makefile.in +564 -0
  252. data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/app.h +96 -0
  253. data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/crypto.h +460 -0
  254. data/vendor/xmlsec1-1.2.18/include/xmlsec/gcrypt/symbols.h +104 -0
  255. data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/Makefile.am +14 -0
  256. data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/Makefile.in +565 -0
  257. data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/app.h +96 -0
  258. data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/crypto.h +462 -0
  259. data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/symbols.h +104 -0
  260. data/vendor/xmlsec1-1.2.18/include/xmlsec/gnutls/x509.h +110 -0
  261. data/vendor/xmlsec1-1.2.18/include/xmlsec/io.h +54 -0
  262. data/vendor/xmlsec1-1.2.18/include/xmlsec/keyinfo.h +285 -0
  263. data/vendor/xmlsec1-1.2.18/include/xmlsec/keys.h +278 -0
  264. data/vendor/xmlsec1-1.2.18/include/xmlsec/keysdata.h +837 -0
  265. data/vendor/xmlsec1-1.2.18/include/xmlsec/keysmngr.h +264 -0
  266. data/vendor/xmlsec1-1.2.18/include/xmlsec/list.h +194 -0
  267. data/vendor/xmlsec1-1.2.18/include/xmlsec/membuf.h +44 -0
  268. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/Makefile.am +16 -0
  269. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/Makefile.in +567 -0
  270. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/app.h +116 -0
  271. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/certkeys.h +42 -0
  272. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/crypto.h +516 -0
  273. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/keysstore.h +48 -0
  274. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/symbols.h +114 -0
  275. data/vendor/xmlsec1-1.2.18/include/xmlsec/mscrypto/x509.h +92 -0
  276. data/vendor/xmlsec1-1.2.18/include/xmlsec/nodeset.h +139 -0
  277. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/Makefile.am +17 -0
  278. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/Makefile.in +568 -0
  279. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/app.h +118 -0
  280. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/bignum.h +37 -0
  281. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/crypto.h +469 -0
  282. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/keysstore.h +46 -0
  283. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/pkikeys.h +44 -0
  284. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/symbols.h +106 -0
  285. data/vendor/xmlsec1-1.2.18/include/xmlsec/nss/x509.h +91 -0
  286. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/Makefile.am +16 -0
  287. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/Makefile.in +567 -0
  288. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/app.h +128 -0
  289. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/bn.h +35 -0
  290. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/crypto.h +561 -0
  291. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/evp.h +44 -0
  292. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/symbols.h +123 -0
  293. data/vendor/xmlsec1-1.2.18/include/xmlsec/openssl/x509.h +109 -0
  294. data/vendor/xmlsec1-1.2.18/include/xmlsec/parser.h +51 -0
  295. data/vendor/xmlsec1-1.2.18/include/xmlsec/private.h +489 -0
  296. data/vendor/xmlsec1-1.2.18/include/xmlsec/private/Makefile.am +12 -0
  297. data/vendor/xmlsec1-1.2.18/include/xmlsec/private/Makefile.in +563 -0
  298. data/vendor/xmlsec1-1.2.18/include/xmlsec/private/xkms.h +121 -0
  299. data/vendor/xmlsec1-1.2.18/include/xmlsec/private/xslt.h +34 -0
  300. data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/Makefile.am +13 -0
  301. data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/app.h +97 -0
  302. data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/crypto.h +40 -0
  303. data/vendor/xmlsec1-1.2.18/include/xmlsec/skeleton/symbols.h +117 -0
  304. data/vendor/xmlsec1-1.2.18/include/xmlsec/soap.h +130 -0
  305. data/vendor/xmlsec1-1.2.18/include/xmlsec/strings.h +610 -0
  306. data/vendor/xmlsec1-1.2.18/include/xmlsec/templates.h +162 -0
  307. data/vendor/xmlsec1-1.2.18/include/xmlsec/transforms.h +994 -0
  308. data/vendor/xmlsec1-1.2.18/include/xmlsec/version.h +61 -0
  309. data/vendor/xmlsec1-1.2.18/include/xmlsec/version.h.in +61 -0
  310. data/vendor/xmlsec1-1.2.18/include/xmlsec/x509.h +80 -0
  311. data/vendor/xmlsec1-1.2.18/include/xmlsec/xkms.h +652 -0
  312. data/vendor/xmlsec1-1.2.18/include/xmlsec/xmldsig.h +281 -0
  313. data/vendor/xmlsec1-1.2.18/include/xmlsec/xmlenc.h +163 -0
  314. data/vendor/xmlsec1-1.2.18/include/xmlsec/xmlsec.h +216 -0
  315. data/vendor/xmlsec1-1.2.18/include/xmlsec/xmltree.h +275 -0
  316. data/vendor/xmlsec1-1.2.18/install-sh +520 -0
  317. data/vendor/xmlsec1-1.2.18/ltmain.sh +8413 -0
  318. data/vendor/xmlsec1-1.2.18/m4/libtool.m4 +7377 -0
  319. data/vendor/xmlsec1-1.2.18/m4/ltoptions.m4 +368 -0
  320. data/vendor/xmlsec1-1.2.18/m4/ltsugar.m4 +123 -0
  321. data/vendor/xmlsec1-1.2.18/m4/ltversion.m4 +23 -0
  322. data/vendor/xmlsec1-1.2.18/m4/lt~obsolete.m4 +92 -0
  323. data/vendor/xmlsec1-1.2.18/man/Makefile.am +52 -0
  324. data/vendor/xmlsec1-1.2.18/man/Makefile.in +582 -0
  325. data/vendor/xmlsec1-1.2.18/man/xmlsec1-config.1 +34 -0
  326. data/vendor/xmlsec1-1.2.18/man/xmlsec1.1 +269 -0
  327. data/vendor/xmlsec1-1.2.18/missing +376 -0
  328. data/vendor/xmlsec1-1.2.18/scripts/build_release.sh +33 -0
  329. data/vendor/xmlsec1-1.2.18/scripts/change-release.sh +34 -0
  330. data/vendor/xmlsec1-1.2.18/scripts/push_release.sh +30 -0
  331. data/vendor/xmlsec1-1.2.18/scripts/remove-gtkdoclink.pl +20 -0
  332. data/vendor/xmlsec1-1.2.18/scripts/test_errors.pl +38 -0
  333. data/vendor/xmlsec1-1.2.18/scripts/test_release.sh +12 -0
  334. data/vendor/xmlsec1-1.2.18/src/Makefile.am +71 -0
  335. data/vendor/xmlsec1-1.2.18/src/Makefile.in +878 -0
  336. data/vendor/xmlsec1-1.2.18/src/app.c +1498 -0
  337. data/vendor/xmlsec1-1.2.18/src/base64.c +1034 -0
  338. data/vendor/xmlsec1-1.2.18/src/bn.c +1060 -0
  339. data/vendor/xmlsec1-1.2.18/src/buffer.c +674 -0
  340. data/vendor/xmlsec1-1.2.18/src/c14n.c +801 -0
  341. data/vendor/xmlsec1-1.2.18/src/dl.c +994 -0
  342. data/vendor/xmlsec1-1.2.18/src/enveloped.c +152 -0
  343. data/vendor/xmlsec1-1.2.18/src/errors.c +242 -0
  344. data/vendor/xmlsec1-1.2.18/src/gcrypt/Makefile.am +55 -0
  345. data/vendor/xmlsec1-1.2.18/src/gcrypt/Makefile.in +764 -0
  346. data/vendor/xmlsec1-1.2.18/src/gcrypt/README +9 -0
  347. data/vendor/xmlsec1-1.2.18/src/gcrypt/app.c +663 -0
  348. data/vendor/xmlsec1-1.2.18/src/gcrypt/asn1.c +602 -0
  349. data/vendor/xmlsec1-1.2.18/src/gcrypt/asn1.h +39 -0
  350. data/vendor/xmlsec1-1.2.18/src/gcrypt/asymkeys.c +1920 -0
  351. data/vendor/xmlsec1-1.2.18/src/gcrypt/ciphers.c +855 -0
  352. data/vendor/xmlsec1-1.2.18/src/gcrypt/crypto.c +315 -0
  353. data/vendor/xmlsec1-1.2.18/src/gcrypt/digests.c +614 -0
  354. data/vendor/xmlsec1-1.2.18/src/gcrypt/globals.h +30 -0
  355. data/vendor/xmlsec1-1.2.18/src/gcrypt/hmac.c +823 -0
  356. data/vendor/xmlsec1-1.2.18/src/gcrypt/kw_aes.c +593 -0
  357. data/vendor/xmlsec1-1.2.18/src/gcrypt/kw_des.c +607 -0
  358. data/vendor/xmlsec1-1.2.18/src/gcrypt/signatures.c +1490 -0
  359. data/vendor/xmlsec1-1.2.18/src/gcrypt/symkeys.c +441 -0
  360. data/vendor/xmlsec1-1.2.18/src/globals.h +25 -0
  361. data/vendor/xmlsec1-1.2.18/src/gnutls/Makefile.am +58 -0
  362. data/vendor/xmlsec1-1.2.18/src/gnutls/Makefile.in +786 -0
  363. data/vendor/xmlsec1-1.2.18/src/gnutls/README +6 -0
  364. data/vendor/xmlsec1-1.2.18/src/gnutls/app.c +998 -0
  365. data/vendor/xmlsec1-1.2.18/src/gnutls/asymkeys.c +455 -0
  366. data/vendor/xmlsec1-1.2.18/src/gnutls/ciphers.c +82 -0
  367. data/vendor/xmlsec1-1.2.18/src/gnutls/crypto.c +351 -0
  368. data/vendor/xmlsec1-1.2.18/src/gnutls/digests.c +112 -0
  369. data/vendor/xmlsec1-1.2.18/src/gnutls/globals.h +31 -0
  370. data/vendor/xmlsec1-1.2.18/src/gnutls/hmac.c +141 -0
  371. data/vendor/xmlsec1-1.2.18/src/gnutls/kw_aes.c +72 -0
  372. data/vendor/xmlsec1-1.2.18/src/gnutls/kw_des.c +51 -0
  373. data/vendor/xmlsec1-1.2.18/src/gnutls/signatures.c +148 -0
  374. data/vendor/xmlsec1-1.2.18/src/gnutls/symkeys.c +125 -0
  375. data/vendor/xmlsec1-1.2.18/src/gnutls/x509.c +1960 -0
  376. data/vendor/xmlsec1-1.2.18/src/gnutls/x509utils.c +1687 -0
  377. data/vendor/xmlsec1-1.2.18/src/gnutls/x509utils.h +143 -0
  378. data/vendor/xmlsec1-1.2.18/src/gnutls/x509vfy.c +802 -0
  379. data/vendor/xmlsec1-1.2.18/src/io.c +496 -0
  380. data/vendor/xmlsec1-1.2.18/src/keyinfo.c +1561 -0
  381. data/vendor/xmlsec1-1.2.18/src/keys.c +1415 -0
  382. data/vendor/xmlsec1-1.2.18/src/keysdata.c +1387 -0
  383. data/vendor/xmlsec1-1.2.18/src/keysmngr.c +745 -0
  384. data/vendor/xmlsec1-1.2.18/src/kw_aes_des.c +493 -0
  385. data/vendor/xmlsec1-1.2.18/src/kw_aes_des.h +148 -0
  386. data/vendor/xmlsec1-1.2.18/src/list.c +534 -0
  387. data/vendor/xmlsec1-1.2.18/src/membuf.c +209 -0
  388. data/vendor/xmlsec1-1.2.18/src/mscrypto/Makefile.am +62 -0
  389. data/vendor/xmlsec1-1.2.18/src/mscrypto/Makefile.in +799 -0
  390. data/vendor/xmlsec1-1.2.18/src/mscrypto/README +39 -0
  391. data/vendor/xmlsec1-1.2.18/src/mscrypto/app.c +1289 -0
  392. data/vendor/xmlsec1-1.2.18/src/mscrypto/certkeys.c +2615 -0
  393. data/vendor/xmlsec1-1.2.18/src/mscrypto/ciphers.c +937 -0
  394. data/vendor/xmlsec1-1.2.18/src/mscrypto/crypto.c +889 -0
  395. data/vendor/xmlsec1-1.2.18/src/mscrypto/csp_calg.h +105 -0
  396. data/vendor/xmlsec1-1.2.18/src/mscrypto/csp_oid.h +114 -0
  397. data/vendor/xmlsec1-1.2.18/src/mscrypto/digests.c +668 -0
  398. data/vendor/xmlsec1-1.2.18/src/mscrypto/globals.h +39 -0
  399. data/vendor/xmlsec1-1.2.18/src/mscrypto/hmac.c +963 -0
  400. data/vendor/xmlsec1-1.2.18/src/mscrypto/keysstore.c +620 -0
  401. data/vendor/xmlsec1-1.2.18/src/mscrypto/kt_rsa.c +631 -0
  402. data/vendor/xmlsec1-1.2.18/src/mscrypto/kw_aes.c +662 -0
  403. data/vendor/xmlsec1-1.2.18/src/mscrypto/kw_des.c +730 -0
  404. data/vendor/xmlsec1-1.2.18/src/mscrypto/mingw-crypt32.def +36 -0
  405. data/vendor/xmlsec1-1.2.18/src/mscrypto/private.h +130 -0
  406. data/vendor/xmlsec1-1.2.18/src/mscrypto/signatures.c +960 -0
  407. data/vendor/xmlsec1-1.2.18/src/mscrypto/symkeys.c +824 -0
  408. data/vendor/xmlsec1-1.2.18/src/mscrypto/x509.c +2281 -0
  409. data/vendor/xmlsec1-1.2.18/src/mscrypto/x509vfy.c +1406 -0
  410. data/vendor/xmlsec1-1.2.18/src/mscrypto/xmlsec-mingw.h +210 -0
  411. data/vendor/xmlsec1-1.2.18/src/nodeset.c +610 -0
  412. data/vendor/xmlsec1-1.2.18/src/nss/Makefile.am +57 -0
  413. data/vendor/xmlsec1-1.2.18/src/nss/Makefile.in +798 -0
  414. data/vendor/xmlsec1-1.2.18/src/nss/README +128 -0
  415. data/vendor/xmlsec1-1.2.18/src/nss/app.c +1598 -0
  416. data/vendor/xmlsec1-1.2.18/src/nss/bignum.c +163 -0
  417. data/vendor/xmlsec1-1.2.18/src/nss/ciphers.c +838 -0
  418. data/vendor/xmlsec1-1.2.18/src/nss/crypto.c +444 -0
  419. data/vendor/xmlsec1-1.2.18/src/nss/digests.c +576 -0
  420. data/vendor/xmlsec1-1.2.18/src/nss/globals.h +24 -0
  421. data/vendor/xmlsec1-1.2.18/src/nss/hmac.c +855 -0
  422. data/vendor/xmlsec1-1.2.18/src/nss/keysstore.c +485 -0
  423. data/vendor/xmlsec1-1.2.18/src/nss/keytrans.c +753 -0
  424. data/vendor/xmlsec1-1.2.18/src/nss/kw_aes.c +681 -0
  425. data/vendor/xmlsec1-1.2.18/src/nss/kw_des.c +663 -0
  426. data/vendor/xmlsec1-1.2.18/src/nss/pkikeys.c +1554 -0
  427. data/vendor/xmlsec1-1.2.18/src/nss/signatures.c +841 -0
  428. data/vendor/xmlsec1-1.2.18/src/nss/symkeys.c +440 -0
  429. data/vendor/xmlsec1-1.2.18/src/nss/x509.c +2223 -0
  430. data/vendor/xmlsec1-1.2.18/src/nss/x509vfy.c +808 -0
  431. data/vendor/xmlsec1-1.2.18/src/openssl/Makefile.am +56 -0
  432. data/vendor/xmlsec1-1.2.18/src/openssl/Makefile.in +790 -0
  433. data/vendor/xmlsec1-1.2.18/src/openssl/README +17 -0
  434. data/vendor/xmlsec1-1.2.18/src/openssl/app.c +1628 -0
  435. data/vendor/xmlsec1-1.2.18/src/openssl/bn.c +163 -0
  436. data/vendor/xmlsec1-1.2.18/src/openssl/ciphers.c +856 -0
  437. data/vendor/xmlsec1-1.2.18/src/openssl/crypto.c +491 -0
  438. data/vendor/xmlsec1-1.2.18/src/openssl/digests.c +682 -0
  439. data/vendor/xmlsec1-1.2.18/src/openssl/evp.c +1559 -0
  440. data/vendor/xmlsec1-1.2.18/src/openssl/globals.h +24 -0
  441. data/vendor/xmlsec1-1.2.18/src/openssl/hmac.c +857 -0
  442. data/vendor/xmlsec1-1.2.18/src/openssl/kt_rsa.c +876 -0
  443. data/vendor/xmlsec1-1.2.18/src/openssl/kw_aes.c +513 -0
  444. data/vendor/xmlsec1-1.2.18/src/openssl/kw_des.c +563 -0
  445. data/vendor/xmlsec1-1.2.18/src/openssl/signatures.c +1065 -0
  446. data/vendor/xmlsec1-1.2.18/src/openssl/symkeys.c +447 -0
  447. data/vendor/xmlsec1-1.2.18/src/openssl/x509.c +2414 -0
  448. data/vendor/xmlsec1-1.2.18/src/openssl/x509vfy.c +1284 -0
  449. data/vendor/xmlsec1-1.2.18/src/parser.c +571 -0
  450. data/vendor/xmlsec1-1.2.18/src/skeleton/Makefile.am +45 -0
  451. data/vendor/xmlsec1-1.2.18/src/skeleton/README +0 -0
  452. data/vendor/xmlsec1-1.2.18/src/skeleton/app.c +499 -0
  453. data/vendor/xmlsec1-1.2.18/src/skeleton/crypto.c +260 -0
  454. data/vendor/xmlsec1-1.2.18/src/skeleton/globals.h +24 -0
  455. data/vendor/xmlsec1-1.2.18/src/soap.c +1322 -0
  456. data/vendor/xmlsec1-1.2.18/src/strings.c +597 -0
  457. data/vendor/xmlsec1-1.2.18/src/templates.c +2091 -0
  458. data/vendor/xmlsec1-1.2.18/src/transforms.c +2902 -0
  459. data/vendor/xmlsec1-1.2.18/src/x509.c +97 -0
  460. data/vendor/xmlsec1-1.2.18/src/xkms.c +4981 -0
  461. data/vendor/xmlsec1-1.2.18/src/xmldsig.c +1795 -0
  462. data/vendor/xmlsec1-1.2.18/src/xmlenc.c +1339 -0
  463. data/vendor/xmlsec1-1.2.18/src/xmlsec.c +185 -0
  464. data/vendor/xmlsec1-1.2.18/src/xmltree.c +1908 -0
  465. data/vendor/xmlsec1-1.2.18/src/xpath.c +1148 -0
  466. data/vendor/xmlsec1-1.2.18/src/xslt.c +617 -0
  467. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/Readme.txt +52 -0
  468. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml +29 -0
  469. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/dh-priv-key.der +0 -0
  470. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.data +9 -0
  471. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.tmpl +22 -0
  472. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml +30 -0
  473. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.data +9 -0
  474. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.tmpl +22 -0
  475. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.xml +30 -0
  476. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.data +9 -0
  477. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.tmpl +22 -0
  478. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes192-kw-aes256.xml +30 -0
  479. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.data +9 -0
  480. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.tmpl +24 -0
  481. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5.xml +63 -0
  482. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-ka-dh.xml +83 -0
  483. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.data +9 -0
  484. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.tmpl +23 -0
  485. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5.xml +61 -0
  486. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.data +9 -0
  487. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.tmpl +22 -0
  488. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1.xml +63 -0
  489. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha256.xml +63 -0
  490. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha512.xml +63 -0
  491. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.data +9 -0
  492. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.tmpl +22 -0
  493. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-3des-kw-3des.xml +29 -0
  494. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-ka-dh.xml +83 -0
  495. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.data +9 -0
  496. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.tmpl +20 -0
  497. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5.xml +61 -0
  498. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.data +9 -0
  499. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.tmpl +22 -0
  500. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1.xml +63 -0
  501. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.data +9 -0
  502. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.tmpl +22 -0
  503. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes128.xml +29 -0
  504. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.data +9 -0
  505. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.tmpl +22 -0
  506. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes128-kw-aes256.xml +29 -0
  507. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-ka-dh.xml +83 -0
  508. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.data +9 -0
  509. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.tmpl +22 -0
  510. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1.xml +63 -0
  511. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.data +9 -0
  512. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.tmpl +22 -0
  513. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes192-kw-aes192.xml +29 -0
  514. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-ka-dh.xml +83 -0
  515. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.data +9 -0
  516. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.tmpl +22 -0
  517. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-element-aes256-kw-aes256.xml +29 -0
  518. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.data +9 -0
  519. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.tmpl +23 -0
  520. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-3des-kw-aes256.xml +32 -0
  521. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.data +9 -0
  522. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.tmpl +21 -0
  523. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes128-kw-aes192.xml +28 -0
  524. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.data +9 -0
  525. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.tmpl +20 -0
  526. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5.xml +62 -0
  527. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.data +9 -0
  528. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.tmpl +22 -0
  529. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1.xml +64 -0
  530. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/key.txt +117 -0
  531. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/keys.xml +61 -0
  532. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/payment.xml +9 -0
  533. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/rsa-priv-key.der +0 -0
  534. data/vendor/xmlsec1-1.2.18/tests/01-phaos-xmlenc-3/rsa-priv-key.p12 +0 -0
  535. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/bad-request-name-not-supported.xml +2 -0
  536. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/bad-request-name.xml +10 -0
  537. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/compound-example-1-no-match.xml +7 -0
  538. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/compound-example-1.xml +51 -0
  539. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert1.der +0 -0
  540. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert1.pem +26 -0
  541. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert2.der +0 -0
  542. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert2.pem +25 -0
  543. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert3.der +0 -0
  544. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/cert3.pem +24 -0
  545. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/create-keys.sh +73 -0
  546. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1-pk8.der +0 -0
  547. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1.der +0 -0
  548. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1.p12 +0 -0
  549. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key1.pem +18 -0
  550. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2-pk8.der +0 -0
  551. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2.der +0 -0
  552. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2.p12 +0 -0
  553. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key2.pem +9 -0
  554. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3-pk8.der +0 -0
  555. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3.der +0 -0
  556. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3.p12 +0 -0
  557. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/key3.pem +9 -0
  558. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/openssl.cnf +106 -0
  559. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/req2.pem +11 -0
  560. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/keys/req3.pem +11 -0
  561. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-1-bad-service.xml +2 -0
  562. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-1-no-match.xml +2 -0
  563. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-1.xml +18 -0
  564. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-2-no-match.xml +2 -0
  565. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-example-2.xml +39 -0
  566. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-opaque-client-data-no-match.xml +2 -0
  567. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/locate-opaque-client-data.xml +32 -0
  568. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/readme.txt +117 -0
  569. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-bad-request-name-msg-invalid.xml +9 -0
  570. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-bad-request-name.xml +14 -0
  571. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-locate-example-1-no-match.xml +6 -0
  572. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-locate-example-1-unsupported.xml +13 -0
  573. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap11-locate-example-1.xml +23 -0
  574. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-bad-request-name-msg-invalid.xml +11 -0
  575. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-bad-request-name.xml +14 -0
  576. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-locate-example-1-no-match.xml +6 -0
  577. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-locate-example-1-unsupported.xml +9 -0
  578. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/soap12-locate-example-1.xml +23 -0
  579. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/status-request-success.xml +2 -0
  580. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/status-request.xml +7 -0
  581. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/validate-example-1-no-match.xml +2 -0
  582. data/vendor/xmlsec1-1.2.18/tests/aleksey-xkms-01/validate-example-1.xml +65 -0
  583. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/README +47 -0
  584. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/dtd-hmac-91.dtd +1 -0
  585. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/dtd-hmac-91.tmpl +27 -0
  586. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/dtd-hmac-91.xml +27 -0
  587. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloped-gost.tmpl +31 -0
  588. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloped-gost.xml +42 -0
  589. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-dsa-x509chain.tmpl +18 -0
  590. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-dsa-x509chain.xml +87 -0
  591. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-expired-cert.tmpl +18 -0
  592. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-expired-cert.xml +85 -0
  593. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5-64.tmpl +16 -0
  594. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5-64.xml +15 -0
  595. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5.tmpl +14 -0
  596. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-hmac-md5.xml +13 -0
  597. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-rsa-md5.tmpl +17 -0
  598. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-md5-rsa-md5.xml +85 -0
  599. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160-64.tmpl +16 -0
  600. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160-64.xml +15 -0
  601. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160.tmpl +14 -0
  602. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160.xml +13 -0
  603. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160.tmpl +17 -0
  604. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160.xml +85 -0
  605. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-rsa-x509chain.tmpl +18 -0
  606. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-rsa-x509chain.xml +85 -0
  607. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1-64.tmpl +16 -0
  608. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1-64.xml +15 -0
  609. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1.tmpl +14 -0
  610. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-hmac-sha1.xml +13 -0
  611. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-rsa-sha1.tmpl +17 -0
  612. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha1-rsa-sha1.xml +85 -0
  613. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64.tmpl +16 -0
  614. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64.xml +15 -0
  615. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224.tmpl +14 -0
  616. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-hmac-sha224.xml +13 -0
  617. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-rsa-sha224.tmpl +17 -0
  618. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha224-rsa-sha224.xml +85 -0
  619. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256-64.tmpl +16 -0
  620. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256-64.xml +15 -0
  621. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256.tmpl +14 -0
  622. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-hmac-sha256.xml +13 -0
  623. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-rsa-sha256.tmpl +17 -0
  624. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha256-rsa-sha256.xml +85 -0
  625. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384-64.tmpl +16 -0
  626. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384-64.xml +15 -0
  627. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384.tmpl +14 -0
  628. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-hmac-sha384.xml +13 -0
  629. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-rsa-sha384.tmpl +17 -0
  630. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha384-rsa-sha384.xml +103 -0
  631. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512-64.tmpl +16 -0
  632. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512-64.xml +16 -0
  633. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512.tmpl +14 -0
  634. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-hmac-sha512.xml +15 -0
  635. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-rsa-sha512.tmpl +17 -0
  636. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/enveloping-sha512-rsa-sha512.xml +104 -0
  637. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-sn-test.tmpl +27 -0
  638. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-sn-test.xml +40 -0
  639. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-test.tmpl +31 -0
  640. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/x509data-test.xml +117 -0
  641. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/xpointer-hmac.tmpl +29 -0
  642. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmldsig-01/xpointer-hmac.xml +28 -0
  643. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes128cbc-keyname.data +1 -0
  644. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes128cbc-keyname.tmpl +11 -0
  645. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes128cbc-keyname.xml +12 -0
  646. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname-ref.data +1 -0
  647. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname-ref.xml +21 -0
  648. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname.data +1 -0
  649. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname.tmpl +11 -0
  650. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes192cbc-keyname.xml +12 -0
  651. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes256cbc-keyname.data +1 -0
  652. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes256cbc-keyname.tmpl +10 -0
  653. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-aes256cbc-keyname.xml +12 -0
  654. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-aes192-keyname.data +1 -0
  655. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-aes192-keyname.tmpl +16 -0
  656. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-aes192-keyname.xml +18 -0
  657. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-content.data +7 -0
  658. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-content.tmpl +11 -0
  659. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-content.xml +15 -0
  660. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element-root.data +7 -0
  661. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element-root.tmpl +11 -0
  662. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element-root.xml +15 -0
  663. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element.data +9 -0
  664. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element.tmpl +11 -0
  665. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname-element.xml +17 -0
  666. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname.data +1 -0
  667. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname.tmpl +8 -0
  668. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname.xml +8 -0
  669. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname2.data +1 -0
  670. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname2.tmpl +10 -0
  671. data/vendor/xmlsec1-1.2.18/tests/aleksey-xmlenc-01/enc-des3cbc-keyname2.xml +12 -0
  672. data/vendor/xmlsec1-1.2.18/tests/keys/README +203 -0
  673. data/vendor/xmlsec1-1.2.18/tests/keys/ca2cert.der +0 -0
  674. data/vendor/xmlsec1-1.2.18/tests/keys/ca2cert.pem +66 -0
  675. data/vendor/xmlsec1-1.2.18/tests/keys/ca2key.pem +9 -0
  676. data/vendor/xmlsec1-1.2.18/tests/keys/cacert.der +0 -0
  677. data/vendor/xmlsec1-1.2.18/tests/keys/cacert.pem +72 -0
  678. data/vendor/xmlsec1-1.2.18/tests/keys/cakey.pem +18 -0
  679. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/cacert.pem +72 -0
  680. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/careq.pem +14 -0
  681. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/index.txt +6 -0
  682. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/01.pem +65 -0
  683. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/02.pem +93 -0
  684. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/03.pem +60 -0
  685. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/04.pem +60 -0
  686. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/newcerts/05.pem +83 -0
  687. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/private/cakey.pem +18 -0
  688. data/vendor/xmlsec1-1.2.18/tests/keys/demoCA/serial +1 -0
  689. data/vendor/xmlsec1-1.2.18/tests/keys/dsacert.der +0 -0
  690. data/vendor/xmlsec1-1.2.18/tests/keys/dsacert.pem +78 -0
  691. data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.der +0 -0
  692. data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.p12 +0 -0
  693. data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.p8-der +0 -0
  694. data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.p8-pem +8 -0
  695. data/vendor/xmlsec1-1.2.18/tests/keys/dsakey.pem +14 -0
  696. data/vendor/xmlsec1-1.2.18/tests/keys/expiredcert.der +0 -0
  697. data/vendor/xmlsec1-1.2.18/tests/keys/expiredcert.pem +61 -0
  698. data/vendor/xmlsec1-1.2.18/tests/keys/expiredkey.der +0 -0
  699. data/vendor/xmlsec1-1.2.18/tests/keys/expiredkey.p12 +0 -0
  700. data/vendor/xmlsec1-1.2.18/tests/keys/expiredkey.pem +9 -0
  701. data/vendor/xmlsec1-1.2.18/tests/keys/expiredreq.pem +11 -0
  702. data/vendor/xmlsec1-1.2.18/tests/keys/gost2001ca.der +0 -0
  703. data/vendor/xmlsec1-1.2.18/tests/keys/gost2001ca.pem +13 -0
  704. data/vendor/xmlsec1-1.2.18/tests/keys/hmackey.bin +1 -0
  705. data/vendor/xmlsec1-1.2.18/tests/keys/keys.xml +83 -0
  706. data/vendor/xmlsec1-1.2.18/tests/keys/largersacert.der +0 -0
  707. data/vendor/xmlsec1-1.2.18/tests/keys/largersacert.pem +100 -0
  708. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey-win.p12 +0 -0
  709. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey-winxp.p12 +0 -0
  710. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.der +0 -0
  711. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.p12 +0 -0
  712. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.p8-der +0 -0
  713. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.p8-pem +53 -0
  714. data/vendor/xmlsec1-1.2.18/tests/keys/largersakey.pem +51 -0
  715. data/vendor/xmlsec1-1.2.18/tests/keys/largersareq.pem +30 -0
  716. data/vendor/xmlsec1-1.2.18/tests/keys/merlincert.pem +20 -0
  717. data/vendor/xmlsec1-1.2.18/tests/keys/openssl.cnf +316 -0
  718. data/vendor/xmlsec1-1.2.18/tests/keys/rsacert.der +0 -0
  719. data/vendor/xmlsec1-1.2.18/tests/keys/rsacert.pem +61 -0
  720. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey-win.p12 +0 -0
  721. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey-winxp.p12 +0 -0
  722. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.der +0 -0
  723. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.p12 +0 -0
  724. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.p8-der +0 -0
  725. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.p8-pem +11 -0
  726. data/vendor/xmlsec1-1.2.18/tests/keys/rsakey.pem +9 -0
  727. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/Readme.txt +20 -0
  728. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-0.txt +15 -0
  729. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-1.txt +15 -0
  730. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-10.txt +15 -0
  731. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-11.txt +15 -0
  732. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-12.txt +15 -0
  733. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-13.txt +15 -0
  734. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-14.txt +15 -0
  735. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-15.txt +0 -0
  736. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-16.txt +0 -0
  737. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-17.txt +15 -0
  738. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-18.txt +15 -0
  739. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-19.txt +15 -0
  740. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-2.txt +15 -0
  741. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-20.txt +15 -0
  742. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-21.txt +15 -0
  743. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-22.txt +15 -0
  744. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-23.txt +15 -0
  745. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-24.txt +1 -0
  746. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-25.txt +0 -0
  747. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-26.txt +15 -0
  748. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-27.txt +430 -0
  749. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-3.txt +15 -0
  750. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-4.txt +15 -0
  751. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-5.txt +15 -0
  752. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-6.txt +1 -0
  753. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-7.txt +1 -0
  754. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-8.txt +15 -0
  755. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/c14n-9.txt +15 -0
  756. data/vendor/xmlsec1-1.2.18/tests/merlin-c14n-three/signature.xml +526 -0
  757. data/vendor/xmlsec1-1.2.18/tests/merlin-exc-c14n-one/Readme.txt +3 -0
  758. data/vendor/xmlsec1-1.2.18/tests/merlin-exc-c14n-one/exc-signature.tmpl +52 -0
  759. data/vendor/xmlsec1-1.2.18/tests/merlin-exc-c14n-one/exc-signature.xml +73 -0
  760. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/Readme.txt +63 -0
  761. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/badb.der +0 -0
  762. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/badb.pem +20 -0
  763. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/balor.der +0 -0
  764. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/balor.pem +20 -0
  765. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/bres.pem +20 -0
  766. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/ca.der +0 -0
  767. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/ca.pem +20 -0
  768. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh-cert.der +0 -0
  769. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh-cert.pem +20 -0
  770. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh.der +0 -0
  771. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/lugh.pem +12 -0
  772. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/macha.der +0 -0
  773. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/macha.pem +20 -0
  774. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/merlin.der +0 -0
  775. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/merlin.pem +21 -0
  776. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/morigu.pem +20 -0
  777. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/nemain.der +0 -0
  778. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/certs/nemain.pem +20 -0
  779. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloped-dsa.tmpl +22 -0
  780. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloped-dsa.xml +43 -0
  781. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.tmpl +21 -0
  782. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-b64-dsa.xml +42 -0
  783. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-dsa.tmpl +18 -0
  784. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-dsa.xml +39 -0
  785. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.tmpl +16 -0
  786. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1-40.xml +17 -0
  787. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.tmpl +14 -0
  788. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.xml +15 -0
  789. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-rsa.tmpl +18 -0
  790. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-enveloping-rsa.xml +31 -0
  791. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-b64-dsa.tmpl +20 -0
  792. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-b64-dsa.xml +41 -0
  793. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-dsa.tmpl +17 -0
  794. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-external-dsa.xml +38 -0
  795. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-keyname.tmpl +16 -0
  796. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-keyname.xml +17 -0
  797. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.tmpl +16 -0
  798. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt.xml +17 -0
  799. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt-crl.tmpl +17 -0
  800. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt-crl.xml +47 -0
  801. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt.tmpl +17 -0
  802. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-crt.xml +38 -0
  803. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-is.tmpl +17 -0
  804. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-is.xml +24 -0
  805. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-ski.tmpl +17 -0
  806. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-ski.xml +21 -0
  807. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-sn.tmpl +17 -0
  808. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature-x509-sn.xml +21 -0
  809. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature.tmpl +245 -0
  810. data/vendor/xmlsec1-1.2.18/tests/merlin-xmldsig-twenty-three/signature.xml +269 -0
  811. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/Readme.txt +117 -0
  812. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/bad-encrypt-content-aes128-cbc-kw-aes192.xml +42 -0
  813. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/decryption-transform-except.xml +83 -0
  814. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/decryption-transform.xml +73 -0
  815. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/dh0.p8 +0 -0
  816. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/dh1.p8 +0 -0
  817. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/dsa.p8 +0 -0
  818. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes128-cbc-kw-aes192.data +27 -0
  819. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes128-cbc-kw-aes192.tmpl +20 -0
  820. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes128-cbc-kw-aes192.xml +45 -0
  821. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes192-cbc-dh-sha512.xml +113 -0
  822. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes256-cbc-prop.data +27 -0
  823. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes256-cbc-prop.tmpl +18 -0
  824. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-aes256-cbc-prop.xml +42 -0
  825. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-tripledes-cbc.data +27 -0
  826. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-tripledes-cbc.tmpl +11 -0
  827. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-content-tripledes-cbc.xml +35 -0
  828. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes128-cbc.data +1 -0
  829. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes128-cbc.tmpl +11 -0
  830. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes128-cbc.xml +12 -0
  831. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.data +1 -0
  832. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.tmpl +20 -0
  833. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.xml +22 -0
  834. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.data +1 -0
  835. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.tmpl +20 -0
  836. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.xml +22 -0
  837. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p-sha256.xml +46 -0
  838. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.data +1 -0
  839. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.tmpl +21 -0
  840. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.xml +43 -0
  841. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.data +27 -0
  842. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.tmpl +19 -0
  843. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.xml +63 -0
  844. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes192-cbc-ref.data +36 -0
  845. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes192-cbc-ref.xml +42 -0
  846. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-carried-kw-aes256.xml +57 -0
  847. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-kw-aes256-dh-ripemd160.xml +122 -0
  848. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-retrieved-kw-aes256.data +40 -0
  849. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-aes256-cbc-retrieved-kw-aes256.xml +47 -0
  850. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.data +27 -0
  851. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.tmpl +20 -0
  852. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.xml +43 -0
  853. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-dh.xml +98 -0
  854. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-kw-tripledes-dh.xml +108 -0
  855. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-rsa-1_5.xml +46 -0
  856. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-hmac-sha256-rsa-oaep-mgf1p.xml +51 -0
  857. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes.tmpl +25 -0
  858. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes.xml +27 -0
  859. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-sha256-hmac-sha256-kw-aes128.xml +27 -0
  860. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-sha384-hmac-sha384-kw-aes192.xml +27 -0
  861. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/encsig-sha512-hmac-sha512-kw-aes256.xml +28 -0
  862. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/ids.p12 +0 -0
  863. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/keys.xml +42 -0
  864. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/plaintext.xml +24 -0
  865. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsa.p8 +0 -0
  866. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.der +0 -0
  867. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.p12 +0 -0
  868. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.p8-der +0 -0
  869. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.p8-pem +17 -0
  870. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapriv.pem +15 -0
  871. data/vendor/xmlsec1-1.2.18/tests/merlin-xmlenc-five/rsapub.pem +6 -0
  872. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/Readme.txt +23 -0
  873. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec-c14n-0.txt +11 -0
  874. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec-c14n-1.txt +0 -0
  875. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec-c14n-2.txt +25 -0
  876. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec.tmpl +50 -0
  877. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-spec.xml +122 -0
  878. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-xfdl-c14n-0.txt +3986 -0
  879. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-xfdl.tmpl +4153 -0
  880. data/vendor/xmlsec1-1.2.18/tests/merlin-xpath-filter2-three/sign-xfdl.xml +4225 -0
  881. data/vendor/xmlsec1-1.2.18/tests/nss.supp +220 -0
  882. data/vendor/xmlsec1-1.2.18/tests/nssdb/cert8.db +0 -0
  883. data/vendor/xmlsec1-1.2.18/tests/nssdb/key3.db +0 -0
  884. data/vendor/xmlsec1-1.2.18/tests/nssdb/secmod.db +0 -0
  885. data/vendor/xmlsec1-1.2.18/tests/openssl.supp +63 -0
  886. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/README.txt +248 -0
  887. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/crl.der +0 -0
  888. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/dsa-ca-cert.der +0 -0
  889. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/dsa-cert.der +0 -0
  890. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/enc-dsa-key.der +0 -0
  891. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/enc-rsa-key.der +0 -0
  892. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/hmackey.bin +1 -0
  893. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/rsa-ca-cert.der +0 -0
  894. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/certs/rsa-cert.der +0 -0
  895. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document-stylesheet.xml +7 -0
  896. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document.b64 +4 -0
  897. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document.xml +6 -0
  898. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/document.xsl +45 -0
  899. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-big.xml +39 -0
  900. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-detached.xml +1 -0
  901. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-enveloped.xml +6 -0
  902. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-enveloping.xml +6 -0
  903. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-dsa-manifest.xml +1 -0
  904. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-md5-c14n-enveloping.xml +6 -0
  905. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-40-c14n-comments-detached.xml +1 -0
  906. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-40-exclusive-c14n-comments-detached.xml +1 -0
  907. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-exclusive-c14n-comments-detached.xml +1 -0
  908. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-hmac-sha1-exclusive-c14n-enveloped.xml +6 -0
  909. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-b64-transform.xml +1 -0
  910. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xpath-transform.xml +1 -0
  911. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xslt-transform-bad-retrieval-method.xml +6 -0
  912. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xslt-transform-retrieval-method.xml +39 -0
  913. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached-xslt-transform.xml +39 -0
  914. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-detached.xml +1 -0
  915. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloped-bad-digest-val.xml +6 -0
  916. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloped-bad-sig.xml +6 -0
  917. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloped.xml +6 -0
  918. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-enveloping.xml +6 -0
  919. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-cert-chain.xml +1 -0
  920. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-cert.xml +1 -0
  921. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-issuer-serial.xml +1 -0
  922. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-ski.xml +1 -0
  923. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest-x509-data-subject-name.xml +1 -0
  924. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-manifest.xml +1 -0
  925. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-xpath-transform-enveloped.xml +6 -0
  926. data/vendor/xmlsec1-1.2.18/tests/phaos-xmldsig-three/signature-rsa-~x509-data-crl.xml +1 -0
  927. data/vendor/xmlsec1-1.2.18/tests/testDSig.sh +875 -0
  928. data/vendor/xmlsec1-1.2.18/tests/testEnc.sh +411 -0
  929. data/vendor/xmlsec1-1.2.18/tests/testKeys.sh +69 -0
  930. data/vendor/xmlsec1-1.2.18/tests/testRes.sh +20 -0
  931. data/vendor/xmlsec1-1.2.18/tests/testXKMS.sh +129 -0
  932. data/vendor/xmlsec1-1.2.18/tests/testrun.sh +443 -0
  933. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/c14n11/xml-base-input.xml +17 -0
  934. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-1.tmpl +2 -0
  935. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-1.xml +2 -0
  936. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-2.tmpl +2 -0
  937. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-2.xml +2 -0
  938. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-3.tmpl +2 -0
  939. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/defCan-3.xml +2 -0
  940. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-1-SUN.xml +21 -0
  941. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-2-SUN.xml +21 -0
  942. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-3-SUN.xml +21 -0
  943. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-4-SUN.xml +21 -0
  944. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-5-SUN.xml +21 -0
  945. data/vendor/xmlsec1-1.2.18/tests/xmldsig2ed-tests/xpointer-6-SUN.xml +21 -0
  946. data/vendor/xmlsec1-1.2.18/win32/Makefile.msvc +699 -0
  947. data/vendor/xmlsec1-1.2.18/win32/README.txt +168 -12
  948. data/vendor/xmlsec1-1.2.18/win32/configure.js +395 -0
  949. data/vendor/xmlsec1-1.2.18/win32/libxmlsec.def.src +25 -0
  950. data/vendor/xmlsec1-1.2.18/win32/mycfg.bat +21 -0
  951. data/vendor/xmlsec1-1.2.18/xmlsec-config.in +243 -0
  952. data/vendor/xmlsec1-1.2.18/xmlsec-gcrypt.pc.in +11 -0
  953. data/vendor/xmlsec1-1.2.18/xmlsec-gnutls.pc.in +11 -0
  954. data/vendor/xmlsec1-1.2.18/xmlsec-nss.pc.in +11 -0
  955. data/vendor/xmlsec1-1.2.18/xmlsec-openssl.pc.in +11 -0
  956. data/vendor/xmlsec1-1.2.18/xmlsec.pc.in +11 -0
  957. data/vendor/xmlsec1-1.2.18/xmlsec.spec.in +185 -0
  958. data/vendor/xmlsec1-1.2.18/xmlsec1-config +243 -0
  959. data/vendor/xmlsec1-1.2.18/xmlsec1-gcrypt.pc +11 -0
  960. data/vendor/xmlsec1-1.2.18/xmlsec1-gnutls.pc +11 -0
  961. data/vendor/xmlsec1-1.2.18/xmlsec1-nss.pc +11 -0
  962. data/vendor/xmlsec1-1.2.18/xmlsec1-openssl.pc +11 -0
  963. data/vendor/xmlsec1-1.2.18/xmlsec1.m4 +172 -0
  964. data/vendor/xmlsec1-1.2.18/xmlsec1.pc +11 -0
  965. data/vendor/xmlsec1-1.2.18/xmlsec1.spec +185 -0
  966. data/vendor/xmlsec1-1.2.18/xmlsec1Conf.sh +13 -0
  967. data/vendor/xmlsec1-1.2.18/xmlsecConf.sh.in +13 -0
  968. data/xmlsec-shim.gemspec +18 -0
  969. metadata +1014 -0
@@ -0,0 +1,70 @@
1
+ /**
2
+ * XMLSec library
3
+ *
4
+ *
5
+ * See Copyright for the status of this software.
6
+ *
7
+ * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
8
+ */
9
+ #ifndef __XMLSEC_APPS_CRYPTO_H__
10
+ #define __XMLSEC_APPS_CRYPTO_H__
11
+
12
+ #ifdef __cplusplus
13
+ extern "C" {
14
+ #endif /* __cplusplus */
15
+
16
+ #include <libxml/tree.h>
17
+ #include <xmlsec/xmlsec.h>
18
+ #include <xmlsec/keys.h>
19
+ #include <xmlsec/keyinfo.h>
20
+ #include <xmlsec/keysmngr.h>
21
+ #include <xmlsec/crypto.h>
22
+
23
+ int xmlSecAppCryptoInit (const char* config);
24
+ int xmlSecAppCryptoShutdown (void);
25
+
26
+ xmlSecKeyPtr xmlSecAppCryptoKeyGenerate (const char* keyKlassAndSize,
27
+ const char* name,
28
+ xmlSecKeyDataType type);
29
+
30
+ /*****************************************************************************
31
+ *
32
+ * Simple keys manager
33
+ *
34
+ ****************************************************************************/
35
+ int xmlSecAppCryptoSimpleKeysMngrInit (xmlSecKeysMngrPtr mngr);
36
+ int xmlSecAppCryptoSimpleKeysMngrLoad (xmlSecKeysMngrPtr mngr,
37
+ const char *filename);
38
+ int xmlSecAppCryptoSimpleKeysMngrSave (xmlSecKeysMngrPtr mngr,
39
+ const char *filename,
40
+ xmlSecKeyDataType type);
41
+ int xmlSecAppCryptoSimpleKeysMngrCertLoad (xmlSecKeysMngrPtr mngr,
42
+ const char *filename,
43
+ xmlSecKeyDataFormat format,
44
+ xmlSecKeyDataType type);
45
+ int xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad (xmlSecKeysMngrPtr mngr,
46
+ const char *files,
47
+ const char* pwd,
48
+ const char* name,
49
+ xmlSecKeyDataFormat format);
50
+ int xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad (xmlSecKeysMngrPtr mngr,
51
+ const char *filename,
52
+ const char* pwd,
53
+ const char *name);
54
+ int xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad (xmlSecKeysMngrPtr mngr,
55
+ const char* keyKlass,
56
+ const char* filename,
57
+ const char *name);
58
+ int xmlSecAppCryptoSimpleKeysMngrKeyGenerate (xmlSecKeysMngrPtr mngr,
59
+ const char* keyKlassAndSize,
60
+ const char* name);
61
+
62
+
63
+ #ifdef __cplusplus
64
+ }
65
+ #endif /* __cplusplus */
66
+
67
+ #endif /* __XMLSEC_APPS_CRYPTO_H__ */
68
+
69
+
70
+
@@ -0,0 +1,3058 @@
1
+ /**
2
+ * XML Security standards test: XMLDSig
3
+ *
4
+ * See Copyright for the status of this software.
5
+ *
6
+ * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
7
+ */
8
+ #include <stdlib.h>
9
+ #include <string.h>
10
+ #include <time.h>
11
+
12
+ #if defined(_MSC_VER)
13
+ #define snprintf _snprintf
14
+ #endif
15
+
16
+ #include <libxml/tree.h>
17
+ #include <libxml/xmlmemory.h>
18
+ #include <libxml/parser.h>
19
+ #include <libxml/xpath.h>
20
+ #include <libxml/xpathInternals.h>
21
+
22
+ #ifndef XMLSEC_NO_XSLT
23
+ #include <libxslt/xslt.h>
24
+ #include <libxslt/extensions.h>
25
+ #include <libxslt/xsltInternals.h>
26
+ #include <libxslt/xsltutils.h>
27
+ #include <libxslt/security.h>
28
+ #include <libexslt/exslt.h>
29
+ #endif /* XMLSEC_NO_XSLT */
30
+
31
+ #include <xmlsec/xmlsec.h>
32
+ #include <xmlsec/xmltree.h>
33
+ #include <xmlsec/keys.h>
34
+ #include <xmlsec/keyinfo.h>
35
+ #include <xmlsec/keysmngr.h>
36
+ #include <xmlsec/transforms.h>
37
+ #include <xmlsec/xmldsig.h>
38
+ #include <xmlsec/xmlenc.h>
39
+ #include <xmlsec/xkms.h>
40
+ #include <xmlsec/parser.h>
41
+ #include <xmlsec/templates.h>
42
+ #include <xmlsec/errors.h>
43
+
44
+ #include "crypto.h"
45
+ #include "cmdline.h"
46
+
47
+ static const char copyright[] =
48
+ "Written by Aleksey Sanin <aleksey@aleksey.com>.\n\n"
49
+ "Copyright (C) 2002-2003 Aleksey Sanin.\n"
50
+ "This is free software: see the source for copying information.\n";
51
+
52
+ static const char bugs[] =
53
+ "Report bugs to http://www.aleksey.com/xmlsec/bugs.html\n";
54
+
55
+ static const char helpCommands1[] =
56
+ "Usage: xmlsec <command> [<options>] [<files>]\n"
57
+ "\n"
58
+ "xmlsec is a command line tool for signing, verifying, encrypting and\n"
59
+ "decrypting XML documents. The allowed <command> values are:\n"
60
+ " --help " "\tdisplay this help information and exit\n"
61
+ " --help-all " "\tdisplay help information for all commands/options and exit\n"
62
+ " --help-<cmd>" "\tdisplay help information for command <cmd> and exit\n"
63
+ " --version " "\tprint version information and exit\n"
64
+ " --keys " "\tkeys XML file manipulation\n";
65
+
66
+ static const char helpCommands2[] =
67
+ #ifndef XMLSEC_NO_XMLDSIG
68
+ " --sign " "\tsign data and output XML document\n"
69
+ " --verify " "\tverify signed document\n"
70
+ #ifndef XMLSEC_NO_TMPL_TEST
71
+ " --sign-tmpl " "\tcreate and sign dynamicaly generated signature template\n"
72
+ #endif /* XMLSEC_NO_TMPL_TEST */
73
+ #endif /* XMLSEC_NO_XMLDSIG */
74
+ #ifndef XMLSEC_NO_XMLENC
75
+ " --encrypt " "\tencrypt data and output XML document\n"
76
+ " --decrypt " "\tdecrypt data from XML document\n"
77
+ #endif /* XMLSEC_NO_XMLENC */
78
+ #ifndef XMLSEC_NO_XKMS
79
+ " --xkms-server-request ""\tprocess data as XKMS server request\n"
80
+ #endif /* XMLSEC_NO_XKMS */
81
+ ;
82
+
83
+ static const char helpVersion[] =
84
+ "Usage: xmlsec version\n"
85
+ "Prints version information and exits\n";
86
+
87
+ static const char helpKeys[] =
88
+ "Usage: xmlsec keys [<options>] <file>\n"
89
+ "Creates a new XML keys file <file>\n";
90
+
91
+ static const char helpSign[] =
92
+ "Usage: xmlsec sign [<options>] <file>\n"
93
+ "Calculates XML Digital Signature using template file <file>\n";
94
+
95
+ static const char helpVerify[] =
96
+ "Usage: xmlsec verify [<options>] <file>\n"
97
+ "Verifies XML Digital Signature in the <file>\n";
98
+
99
+ static const char helpSignTmpl[] =
100
+ "Usage: xmlsec sign-tmpl [<options>]\n"
101
+ "Creates a simple dynamic template and calculates XML Digital Signature\n"
102
+ "(for testing only).\n";
103
+
104
+ static const char helpEncrypt[] =
105
+ "Usage: xmlsec encrypt [<options>] <file>\n"
106
+ "Encrypts data and creates XML Encryption using template file <file>\n";
107
+
108
+ static const char helpEncryptTmpl[] =
109
+ "Usage: xmlsec encrypt [<options>]\n"
110
+ "Creates a simple dynamic template and calculates XML Encryption\n";
111
+
112
+ static const char helpDecrypt[] =
113
+ "Usage: xmlsec decrypt [<options>] <file>\n"
114
+ "Decrypts XML Encryption data in the <file>\n";
115
+
116
+ static const char helpXkmsServerRequest[] =
117
+ "Usage: xmlsec xkms-server-request [<options>] <file>\n"
118
+ "Processes the <file> as XKMS server request and outputs the response\n";
119
+
120
+ static const char helpListKeyData[] =
121
+ "Usage: xmlsec list-key-data\n"
122
+ "Prints the list of known key data klasses\n";
123
+
124
+ static const char helpCheckKeyData[] =
125
+ "Usage: xmlsec check-key-data <key-data-name> [<key-data-name> ... ]\n"
126
+ "Checks the given key-data against the list of known key-data klasses\n";
127
+
128
+ static const char helpListTransforms[] =
129
+ "Usage: xmlsec list-transforms\n"
130
+ "Prints the list of known transform klasses\n";
131
+
132
+ static const char helpCheckTransforms[] =
133
+ "Usage: xmlsec check-transforms <transform-name> [<transform-name> ... ]\n"
134
+ "Checks the given transforms against the list of known transform klasses\n";
135
+
136
+ #define xmlSecAppCmdLineTopicGeneral 0x0001
137
+ #define xmlSecAppCmdLineTopicDSigCommon 0x0002
138
+ #define xmlSecAppCmdLineTopicDSigSign 0x0004
139
+ #define xmlSecAppCmdLineTopicDSigVerify 0x0008
140
+ #define xmlSecAppCmdLineTopicEncCommon 0x0010
141
+ #define xmlSecAppCmdLineTopicEncEncrypt 0x0020
142
+ #define xmlSecAppCmdLineTopicEncDecrypt 0x0040
143
+ #define xmlSecAppCmdLineTopicXkmsCommon 0x0080
144
+ #define xmlSecAppCmdLineTopicKeysMngr 0x1000
145
+ #define xmlSecAppCmdLineTopicX509Certs 0x2000
146
+ #define xmlSecAppCmdLineTopicVersion 0x4000
147
+ #define xmlSecAppCmdLineTopicCryptoConfig 0x8000
148
+ #define xmlSecAppCmdLineTopicAll 0xFFFF
149
+
150
+ /****************************************************************
151
+ *
152
+ * General configuration params
153
+ *
154
+ ***************************************************************/
155
+ static xmlSecAppCmdLineParam helpParam = {
156
+ xmlSecAppCmdLineTopicGeneral,
157
+ "--help",
158
+ "-h",
159
+ "--help"
160
+ "\n\tprint help information about the command",
161
+ xmlSecAppCmdLineParamTypeFlag,
162
+ xmlSecAppCmdLineParamFlagNone,
163
+ NULL
164
+ };
165
+
166
+ static xmlSecAppCmdLineParam cryptoParam = {
167
+ xmlSecAppCmdLineTopicCryptoConfig,
168
+ "--crypto",
169
+ NULL,
170
+ "--crypto <name>"
171
+ "\n\tthe name of the crypto engine to use from the following"
172
+ "\n\tlist: openssl, mscrypto, nss, gnutls, gcrypt (if no crypto engine is"
173
+ "\n\tspecified then the default one is used)",
174
+ xmlSecAppCmdLineParamTypeString,
175
+ xmlSecAppCmdLineParamFlagNone,
176
+ NULL
177
+ };
178
+
179
+ static xmlSecAppCmdLineParam cryptoConfigParam = {
180
+ xmlSecAppCmdLineTopicCryptoConfig,
181
+ "--crypto-config",
182
+ NULL,
183
+ "--crypto-config <path>"
184
+ "\n\tpath to crypto engine configuration",
185
+ xmlSecAppCmdLineParamTypeString,
186
+ xmlSecAppCmdLineParamFlagNone,
187
+ NULL
188
+ };
189
+
190
+
191
+ static xmlSecAppCmdLineParam repeatParam = {
192
+ xmlSecAppCmdLineTopicCryptoConfig,
193
+ "--repeat",
194
+ "-r",
195
+ "--repeat <number>"
196
+ "\n\trepeat the operation <number> times",
197
+ xmlSecAppCmdLineParamTypeNumber,
198
+ xmlSecAppCmdLineParamFlagNone,
199
+ NULL
200
+ };
201
+
202
+
203
+ static xmlSecAppCmdLineParam disableErrorMsgsParam = {
204
+ xmlSecAppCmdLineTopicGeneral,
205
+ "--disable-error-msgs",
206
+ NULL,
207
+ "--disable-error-msgs"
208
+ "\n\tdo not print xmlsec error messages",
209
+ xmlSecAppCmdLineParamTypeFlag,
210
+ xmlSecAppCmdLineParamFlagNone,
211
+ NULL
212
+ };
213
+
214
+ static xmlSecAppCmdLineParam printCryptoErrorMsgsParam = {
215
+ xmlSecAppCmdLineTopicGeneral,
216
+ "--print-crypto-error-msgs",
217
+ NULL,
218
+ "--print-crypto-error-msgs"
219
+ "\n\tprint errors stack at the end",
220
+ xmlSecAppCmdLineParamTypeFlag,
221
+ xmlSecAppCmdLineParamFlagNone,
222
+ NULL
223
+ };
224
+
225
+ /****************************************************************
226
+ *
227
+ * Keys Manager params
228
+ *
229
+ ***************************************************************/
230
+ static xmlSecAppCmdLineParam genKeyParam = {
231
+ xmlSecAppCmdLineTopicKeysMngr,
232
+ "--gen-key",
233
+ "-g",
234
+ "--gen-key[:<name>] <keyKlass>-<keySize>"
235
+ "\n\tgenerate new <keyKlass> key of <keySize> bits size,"
236
+ "\n\tset the key name to <name> and add the result to keys"
237
+ "\n\tmanager (for example, \"--gen:mykey rsa-1024\" generates"
238
+ "\n\ta new 1024 bits RSA key and sets it's name to \"mykey\")",
239
+ xmlSecAppCmdLineParamTypeString,
240
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
241
+ NULL
242
+ };
243
+
244
+ static xmlSecAppCmdLineParam keysFileParam = {
245
+ xmlSecAppCmdLineTopicKeysMngr,
246
+ "--keys-file",
247
+ "-k",
248
+ "--keys-file <file>"
249
+ "\n\tload keys from XML file",
250
+ xmlSecAppCmdLineParamTypeString,
251
+ xmlSecAppCmdLineParamFlagMultipleValues,
252
+ NULL
253
+ };
254
+
255
+ static xmlSecAppCmdLineParam privkeyParam = {
256
+ xmlSecAppCmdLineTopicKeysMngr,
257
+ "--privkey-pem",
258
+ "--privkey",
259
+ "--privkey-pem[:<name>] <file>[,<cafile>[,<cafile>[...]]]"
260
+ "\n\tload private key from PEM file and certificates"
261
+ "\n\tthat verify this key",
262
+ xmlSecAppCmdLineParamTypeStringList,
263
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
264
+ NULL
265
+ };
266
+
267
+ static xmlSecAppCmdLineParam privkeyDerParam = {
268
+ xmlSecAppCmdLineTopicKeysMngr,
269
+ "--privkey-der",
270
+ NULL,
271
+ "--privkey-der[:<name>] <file>[,<cafile>[,<cafile>[...]]]"
272
+ "\n\tload private key from DER file and certificates"
273
+ "\n\tthat verify this key",
274
+ xmlSecAppCmdLineParamTypeStringList,
275
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
276
+ NULL
277
+ };
278
+
279
+ static xmlSecAppCmdLineParam pkcs8PemParam = {
280
+ xmlSecAppCmdLineTopicKeysMngr,
281
+ "--pkcs8-pem",
282
+ "--privkey-p8-pem",
283
+ "--pkcs8-pem[:<name>] <file>[,<cafile>[,<cafile>[...]]]"
284
+ "\n\tload private key from PKCS8 PEM file and PEM certificates"
285
+ "\n\tthat verify this key",
286
+ xmlSecAppCmdLineParamTypeStringList,
287
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
288
+ NULL
289
+ };
290
+
291
+ static xmlSecAppCmdLineParam pkcs8DerParam = {
292
+ xmlSecAppCmdLineTopicKeysMngr,
293
+ "--pkcs8-der",
294
+ "--privkey-p8-der",
295
+ "--pkcs8-der[:<name>] <file>[,<cafile>[,<cafile>[...]]]"
296
+ "\n\tload private key from PKCS8 DER file and DER certificates"
297
+ "\n\tthat verify this key",
298
+ xmlSecAppCmdLineParamTypeStringList,
299
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
300
+ NULL
301
+ };
302
+
303
+ static xmlSecAppCmdLineParam pubkeyParam = {
304
+ xmlSecAppCmdLineTopicKeysMngr,
305
+ "--pubkey-pem",
306
+ "--pubkey",
307
+ "--pubkey-pem[:<name>] <file>"
308
+ "\n\tload public key from PEM file",
309
+ xmlSecAppCmdLineParamTypeStringList,
310
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
311
+ NULL
312
+ };
313
+
314
+ static xmlSecAppCmdLineParam pubkeyDerParam = {
315
+ xmlSecAppCmdLineTopicKeysMngr,
316
+ "--pubkey-der",
317
+ NULL,
318
+ "--pubkey-der[:<name>] <file>"
319
+ "\n\tload public key from DER file",
320
+ xmlSecAppCmdLineParamTypeStringList,
321
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
322
+ NULL
323
+ };
324
+
325
+
326
+ #ifndef XMLSEC_NO_AES
327
+ static xmlSecAppCmdLineParam aeskeyParam = {
328
+ xmlSecAppCmdLineTopicKeysMngr,
329
+ "--aeskey",
330
+ NULL,
331
+ "--aeskey[:<name>] <file>"
332
+ "\n\tload AES key from binary file <file>",
333
+ xmlSecAppCmdLineParamTypeString,
334
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
335
+ NULL
336
+ };
337
+ #endif /* XMLSEC_NO_AES */
338
+
339
+ #ifndef XMLSEC_NO_DES
340
+ static xmlSecAppCmdLineParam deskeyParam = {
341
+ xmlSecAppCmdLineTopicKeysMngr,
342
+ "--deskey",
343
+ NULL,
344
+ "--deskey[:<name>] <file>"
345
+ "\n\tload DES key from binary file <file>",
346
+ xmlSecAppCmdLineParamTypeString,
347
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
348
+ NULL
349
+ };
350
+ #endif /* XMLSEC_NO_DES */
351
+
352
+ #ifndef XMLSEC_NO_HMAC
353
+ static xmlSecAppCmdLineParam hmackeyParam = {
354
+ xmlSecAppCmdLineTopicKeysMngr,
355
+ "--hmackey",
356
+ NULL,
357
+ "--hmackey[:<name>] <file>"
358
+ "\n\tload HMAC key from binary file <file>",
359
+ xmlSecAppCmdLineParamTypeString,
360
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
361
+ NULL
362
+ };
363
+ #endif /* XMLSEC_NO_HMAC */
364
+
365
+ static xmlSecAppCmdLineParam pwdParam = {
366
+ xmlSecAppCmdLineTopicKeysMngr,
367
+ "--pwd",
368
+ NULL,
369
+ "--pwd <password>"
370
+ "\n\tthe password to use for reading keys and certs",
371
+ xmlSecAppCmdLineParamTypeString,
372
+ xmlSecAppCmdLineParamFlagNone,
373
+ NULL
374
+ };
375
+
376
+ static xmlSecAppCmdLineParam enabledKeyDataParam = {
377
+ xmlSecAppCmdLineTopicKeysMngr,
378
+ "--enabled-key-data",
379
+ NULL,
380
+ "--enabled-key-data <list>"
381
+ "\n\tcomma separated list of enabled key data (list of "
382
+ "\n\tregistered key data klasses is available with \"--list-key-data\""
383
+ "\n\tcommand); by default, all registered key data are enabled",
384
+ xmlSecAppCmdLineParamTypeStringList,
385
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
386
+ NULL
387
+ };
388
+
389
+ static xmlSecAppCmdLineParam enabledRetrievalMethodUrisParam = {
390
+ xmlSecAppCmdLineTopicKeysMngr,
391
+ "--enabled-retrieval-method-uris",
392
+ NULL,
393
+ "--enabled-retrieval-uris <list>"
394
+ "\n\tcomma separated list of of the following values:"
395
+ "\n\t\"empty\", \"same-doc\", \"local\",\"remote\" to restrict possible URI"
396
+ "\n\tattribute values for the <dsig:RetrievalMethod> element.",
397
+ xmlSecAppCmdLineParamTypeStringList,
398
+ xmlSecAppCmdLineParamFlagNone,
399
+ NULL
400
+ };
401
+
402
+ /****************************************************************
403
+ *
404
+ * Common params
405
+ *
406
+ ***************************************************************/
407
+ static xmlSecAppCmdLineParam sessionKeyParam = {
408
+ xmlSecAppCmdLineTopicDSigSign | xmlSecAppCmdLineTopicEncEncrypt,
409
+ "--session-key",
410
+ NULL,
411
+ "--session-key <keyKlass>-<keySize>"
412
+ "\n\tgenerate new session <keyKlass> key of <keySize> bits size"
413
+ "\n\t(for example, \"--session des-192\" generates a new 192 bits"
414
+ "\n\tDES key for DES3 encryption)",
415
+ xmlSecAppCmdLineParamTypeString,
416
+ xmlSecAppCmdLineParamFlagNone,
417
+ NULL
418
+ };
419
+
420
+ static xmlSecAppCmdLineParam outputParam = {
421
+ xmlSecAppCmdLineTopicDSigCommon |
422
+ xmlSecAppCmdLineTopicEncCommon |
423
+ xmlSecAppCmdLineTopicXkmsCommon,
424
+ "--output",
425
+ "-o",
426
+ "--output <filename>"
427
+ "\n\twrite result document to file <filename>",
428
+ xmlSecAppCmdLineParamTypeString,
429
+ xmlSecAppCmdLineParamFlagNone,
430
+ NULL
431
+ };
432
+
433
+ static xmlSecAppCmdLineParam nodeIdParam = {
434
+ xmlSecAppCmdLineTopicDSigCommon |
435
+ xmlSecAppCmdLineTopicEncCommon |
436
+ xmlSecAppCmdLineTopicXkmsCommon,
437
+ "--node-id",
438
+ NULL,
439
+ "--node-id <id>"
440
+ "\n\tset the operation start point to the node with given <id>",
441
+ xmlSecAppCmdLineParamTypeString,
442
+ xmlSecAppCmdLineParamFlagNone,
443
+ NULL
444
+ };
445
+
446
+ static xmlSecAppCmdLineParam nodeNameParam = {
447
+ xmlSecAppCmdLineTopicDSigCommon |
448
+ xmlSecAppCmdLineTopicEncCommon |
449
+ xmlSecAppCmdLineTopicXkmsCommon,
450
+ "--node-name",
451
+ NULL,
452
+ "--node-name [<namespace-uri>:]<name>"
453
+ "\n\tset the operation start point to the first node"
454
+ "\n\twith given <name> and <namespace> URI",
455
+ xmlSecAppCmdLineParamTypeString,
456
+ xmlSecAppCmdLineParamFlagNone,
457
+ NULL
458
+ };
459
+
460
+ static xmlSecAppCmdLineParam nodeXPathParam = {
461
+ xmlSecAppCmdLineTopicDSigCommon |
462
+ xmlSecAppCmdLineTopicEncCommon |
463
+ xmlSecAppCmdLineTopicXkmsCommon,
464
+ "--node-xpath",
465
+ NULL,
466
+ "--node-xpath <expr>"
467
+ "\n\tset the operation start point to the first node"
468
+ "\n\tselected by the specified XPath expression",
469
+ xmlSecAppCmdLineParamTypeString,
470
+ xmlSecAppCmdLineParamFlagNone,
471
+ NULL
472
+ };
473
+
474
+ static xmlSecAppCmdLineParam dtdFileParam = {
475
+ xmlSecAppCmdLineTopicDSigCommon |
476
+ xmlSecAppCmdLineTopicEncCommon |
477
+ xmlSecAppCmdLineTopicXkmsCommon,
478
+ "--dtd-file",
479
+ NULL,
480
+ "--dtd-file <file>"
481
+ "\n\tload the specified file as the DTD",
482
+ xmlSecAppCmdLineParamTypeString,
483
+ xmlSecAppCmdLineParamFlagNone,
484
+ NULL
485
+ };
486
+
487
+ static xmlSecAppCmdLineParam printDebugParam = {
488
+ xmlSecAppCmdLineTopicDSigCommon |
489
+ xmlSecAppCmdLineTopicEncCommon |
490
+ xmlSecAppCmdLineTopicXkmsCommon,
491
+ "--print-debug",
492
+ NULL,
493
+ "--print-debug"
494
+ "\n\tprint debug information to stdout",
495
+ xmlSecAppCmdLineParamTypeFlag,
496
+ xmlSecAppCmdLineParamFlagNone,
497
+ NULL
498
+ };
499
+
500
+ static xmlSecAppCmdLineParam printXmlDebugParam = {
501
+ xmlSecAppCmdLineTopicDSigCommon |
502
+ xmlSecAppCmdLineTopicEncCommon |
503
+ xmlSecAppCmdLineTopicXkmsCommon,
504
+ "--print-xml-debug",
505
+ NULL,
506
+ "--print-xml-debug"
507
+ "\n\tprint debug information to stdout in xml format",
508
+ xmlSecAppCmdLineParamTypeFlag,
509
+ xmlSecAppCmdLineParamFlagNone,
510
+ NULL
511
+ };
512
+
513
+ static xmlSecAppCmdLineParam idAttrParam = {
514
+ xmlSecAppCmdLineTopicDSigCommon |
515
+ xmlSecAppCmdLineTopicEncCommon |
516
+ xmlSecAppCmdLineTopicXkmsCommon,
517
+ "--id-attr",
518
+ NULL,
519
+ "--id-attr[:<attr-name>] [<node-namespace-uri>:]<node-name>"
520
+ "\n\tadds attributes <attr-name> (default value \"id\") from all nodes"
521
+ "\n\twith<node-name> and namespace <node-namespace-uri> to the list of"
522
+ "\n\tknown ID attributes; this is a hack and if you can use DTD or schema"
523
+ "\n\tto declare ID attributes instead (see \"--dtd-file\" option),"
524
+ "\n\tI don't know what else might be broken in your application when"
525
+ "\n\tyou use this hack",
526
+ xmlSecAppCmdLineParamTypeString,
527
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
528
+ NULL
529
+ };
530
+
531
+
532
+ /****************************************************************
533
+ *
534
+ * Common dsig params
535
+ *
536
+ ***************************************************************/
537
+ #ifndef XMLSEC_NO_XMLDSIG
538
+ static xmlSecAppCmdLineParam ignoreManifestsParam = {
539
+ xmlSecAppCmdLineTopicDSigCommon,
540
+ "--ignore-manifests",
541
+ NULL,
542
+ "--ignore-manifests"
543
+ "\n\tdo not process <dsig:Manifest> elements",
544
+ xmlSecAppCmdLineParamTypeFlag,
545
+ xmlSecAppCmdLineParamFlagNone,
546
+ NULL
547
+ };
548
+
549
+ static xmlSecAppCmdLineParam storeReferencesParam = {
550
+ xmlSecAppCmdLineTopicDSigCommon,
551
+ "--store-references",
552
+ NULL,
553
+ "--store-references"
554
+ "\n\tstore and print the result of <dsig:Reference/> element processing"
555
+ "\n\tjust before calculating digest",
556
+ xmlSecAppCmdLineParamTypeFlag,
557
+ xmlSecAppCmdLineParamFlagNone,
558
+ NULL
559
+ };
560
+
561
+ static xmlSecAppCmdLineParam storeSignaturesParam = {
562
+ xmlSecAppCmdLineTopicDSigCommon,
563
+ "--store-signatures",
564
+ NULL,
565
+ "--store-signatures"
566
+ "\n\tstore and print the result of <dsig:Signature> processing"
567
+ "\n\tjust before calculating signature",
568
+ xmlSecAppCmdLineParamTypeFlag,
569
+ xmlSecAppCmdLineParamFlagNone,
570
+ NULL
571
+ };
572
+
573
+ static xmlSecAppCmdLineParam enabledRefUrisParam = {
574
+ xmlSecAppCmdLineTopicDSigCommon,
575
+ "--enabled-reference-uris",
576
+ NULL,
577
+ "--enabled-reference-uris <list>"
578
+ "\n\tcomma separated list of of the following values:"
579
+ "\n\t\"empty\", \"same-doc\", \"local\",\"remote\" to restrict possible URI"
580
+ "\n\tattribute values for the <dsig:Reference> element",
581
+ xmlSecAppCmdLineParamTypeStringList,
582
+ xmlSecAppCmdLineParamFlagNone,
583
+ NULL
584
+ };
585
+
586
+ static xmlSecAppCmdLineParam enableVisa3DHackParam = {
587
+ xmlSecAppCmdLineTopicDSigCommon,
588
+ "--enable-visa3d-hack",
589
+ NULL,
590
+ "--enable-visa3d-hack"
591
+ "\n\tenables Visa3D protocol specific hack for URI attributes processing"
592
+ "\n\twhen we are trying not to use XPath/XPointer engine; this is a hack"
593
+ "\n\tand I don't know what else might be broken in your application when"
594
+ "\n\tyou use it (also check \"--id-attr\" option because you might need it)",
595
+ xmlSecAppCmdLineParamTypeFlag,
596
+ xmlSecAppCmdLineParamFlagNone,
597
+ NULL
598
+ };
599
+
600
+ #endif /* XMLSEC_NO_XMLDSIG */
601
+
602
+ /****************************************************************
603
+ *
604
+ * Enc params
605
+ *
606
+ ***************************************************************/
607
+ #ifndef XMLSEC_NO_XMLENC
608
+ static xmlSecAppCmdLineParam enabledCipherRefUrisParam = {
609
+ xmlSecAppCmdLineTopicEncCommon,
610
+ "--enabled-cipher-reference-uris",
611
+ NULL,
612
+ "--enabled-cipher-reference-uris <list>"
613
+ "\n\tcomma separated list of of the following values:"
614
+ "\n\t\"empty\", \"same-doc\", \"local\",\"remote\" to restrict possible URI"
615
+ "\n\tattribute values for the <enc:CipherReference> element",
616
+ xmlSecAppCmdLineParamTypeStringList,
617
+ xmlSecAppCmdLineParamFlagNone,
618
+ NULL
619
+ };
620
+
621
+ static xmlSecAppCmdLineParam binaryDataParam = {
622
+ xmlSecAppCmdLineTopicEncEncrypt,
623
+ "--binary-data",
624
+ "--binary",
625
+ "--binary-data <file>"
626
+ "\n\tbinary <file> to encrypt",
627
+ xmlSecAppCmdLineParamTypeString,
628
+ xmlSecAppCmdLineParamFlagNone,
629
+ NULL
630
+ };
631
+
632
+ static xmlSecAppCmdLineParam xmlDataParam = {
633
+ xmlSecAppCmdLineTopicEncEncrypt,
634
+ "--xml-data",
635
+ NULL,
636
+ "--xml-data <file>"
637
+ "\n\tXML <file> to encrypt",
638
+ xmlSecAppCmdLineParamTypeString,
639
+ xmlSecAppCmdLineParamFlagNone,
640
+ NULL
641
+ };
642
+ #endif /* XMLSEC_NO_XMLENC */
643
+
644
+ /****************************************************************
645
+ *
646
+ * XKMS params
647
+ *
648
+ ***************************************************************/
649
+ #ifndef XMLSEC_NO_XKMS
650
+ static xmlSecAppCmdLineParam xkmsServiceParam = {
651
+ xmlSecAppCmdLineTopicXkmsCommon,
652
+ "--xkms-service",
653
+ NULL,
654
+ "--xkms-service <uri>"
655
+ "\n\tsets XKMS \"Service\" <uri>",
656
+ xmlSecAppCmdLineParamTypeString,
657
+ xmlSecAppCmdLineParamFlagNone,
658
+ NULL
659
+ };
660
+
661
+ static xmlSecAppCmdLineParam xkmsFormatParam = {
662
+ xmlSecAppCmdLineTopicXkmsCommon,
663
+ "--xkms-format",
664
+ NULL,
665
+ "--xkms-format <format>"
666
+ "\n\tsets the XKMS request/response format to one of the following values:"
667
+ "\n\t \"plain\" (default), \"soap-1.1\" or \"soap-1.2\"",
668
+ xmlSecAppCmdLineParamTypeString,
669
+ xmlSecAppCmdLineParamFlagNone,
670
+ NULL
671
+ };
672
+
673
+ static xmlSecAppCmdLineParam xkmsStopUnknownResponseMechanismParam = {
674
+ xmlSecAppCmdLineTopicXkmsCommon, /* todo: server */
675
+ "--xkms-stop-on-unknown-response-mechanism",
676
+ NULL,
677
+ "--xkms-stop-on-unknown-response-mechanism"
678
+ "\n\tstop processing XKMS server request if unknown ResponseMechanism"
679
+ "\n\tvalue was found",
680
+ xmlSecAppCmdLineParamTypeFlag,
681
+ xmlSecAppCmdLineParamFlagNone,
682
+ NULL
683
+ };
684
+
685
+ static xmlSecAppCmdLineParam xkmsStopUnknownRespondWithParam = {
686
+ xmlSecAppCmdLineTopicXkmsCommon, /* todo: server */
687
+ "--xkms-stop-on-unknown-respond-with",
688
+ NULL,
689
+ "--xkms-stop-on-unknown-respond-with"
690
+ "\n\tstop processing XKMS server request if unknown RespondWith"
691
+ "\n\tvalue was found",
692
+ xmlSecAppCmdLineParamTypeFlag,
693
+ xmlSecAppCmdLineParamFlagNone,
694
+ NULL
695
+ };
696
+
697
+ static xmlSecAppCmdLineParam xkmsStopUnknownKeyUsageParam = {
698
+ xmlSecAppCmdLineTopicXkmsCommon, /* todo: server */
699
+ "--xkms-stop-on-unknown-key-usage",
700
+ NULL,
701
+ "--xkms-stop-on-unknown-key-usage"
702
+ "\n\tstop processing XKMS server request if unknown KeyUsage"
703
+ "\n\tvalue was found",
704
+ xmlSecAppCmdLineParamTypeFlag,
705
+ xmlSecAppCmdLineParamFlagNone,
706
+ NULL
707
+ };
708
+
709
+ #endif /* XMLSEC_NO_XKMS */
710
+
711
+ /****************************************************************
712
+ *
713
+ * X509 params
714
+ *
715
+ ***************************************************************/
716
+ #ifndef XMLSEC_NO_X509
717
+ static xmlSecAppCmdLineParam pkcs12Param = {
718
+ xmlSecAppCmdLineTopicKeysMngr,
719
+ "--pkcs12",
720
+ NULL,
721
+ "--pkcs12[:<name>] <file>"
722
+ "\n\tload load private key from pkcs12 file <file>",
723
+ xmlSecAppCmdLineParamTypeString,
724
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
725
+ NULL
726
+ };
727
+
728
+ static xmlSecAppCmdLineParam pubkeyCertParam = {
729
+ xmlSecAppCmdLineTopicKeysMngr,
730
+ "--pubkey-cert-pem",
731
+ "--pubkey-cert",
732
+ "--pubkey-cert-pem[:<name>] <file>"
733
+ "\n\tload public key from PEM cert file",
734
+ xmlSecAppCmdLineParamTypeStringList,
735
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
736
+ NULL
737
+ };
738
+
739
+ static xmlSecAppCmdLineParam pubkeyCertDerParam = {
740
+ xmlSecAppCmdLineTopicKeysMngr,
741
+ "--pubkey-cert-der",
742
+ NULL,
743
+ "--pubkey-cert-der[:<name>] <file>"
744
+ "\n\tload public key from DER cert file",
745
+ xmlSecAppCmdLineParamTypeStringList,
746
+ xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues,
747
+ NULL
748
+ };
749
+
750
+ static xmlSecAppCmdLineParam trustedParam = {
751
+ xmlSecAppCmdLineTopicX509Certs,
752
+ "--trusted-pem",
753
+ "--trusted",
754
+ "--trusted-pem <file>"
755
+ "\n\tload trusted (root) certificate from PEM file <file>",
756
+ xmlSecAppCmdLineParamTypeString,
757
+ xmlSecAppCmdLineParamFlagMultipleValues,
758
+ NULL
759
+ };
760
+
761
+ static xmlSecAppCmdLineParam untrustedParam = {
762
+ xmlSecAppCmdLineTopicX509Certs,
763
+ "--untrusted-pem",
764
+ "--untrusted",
765
+ "--untrusted-pem <file>"
766
+ "\n\tload untrusted certificate from PEM file <file>",
767
+ xmlSecAppCmdLineParamTypeString,
768
+ xmlSecAppCmdLineParamFlagMultipleValues,
769
+ NULL
770
+ };
771
+
772
+ static xmlSecAppCmdLineParam trustedDerParam = {
773
+ xmlSecAppCmdLineTopicX509Certs,
774
+ "--trusted-der",
775
+ NULL,
776
+ "--trusted-der <file>"
777
+ "\n\tload trusted (root) certificate from DER file <file>",
778
+ xmlSecAppCmdLineParamTypeString,
779
+ xmlSecAppCmdLineParamFlagMultipleValues,
780
+ NULL
781
+ };
782
+
783
+ static xmlSecAppCmdLineParam untrustedDerParam = {
784
+ xmlSecAppCmdLineTopicX509Certs,
785
+ "--untrusted-der",
786
+ NULL,
787
+ "--untrusted-der <file>"
788
+ "\n\tload untrusted certificate from DER file <file>",
789
+ xmlSecAppCmdLineParamTypeString,
790
+ xmlSecAppCmdLineParamFlagMultipleValues,
791
+ NULL
792
+ };
793
+
794
+ static xmlSecAppCmdLineParam verificationTimeParam = {
795
+ xmlSecAppCmdLineTopicX509Certs,
796
+ "--verification-time",
797
+ NULL,
798
+ "--verification-time <time>"
799
+ "\n\tthe local time in \"YYYY-MM-DD HH:MM:SS\" format"
800
+ "\n\tused certificates verification",
801
+ xmlSecAppCmdLineParamTypeTime,
802
+ xmlSecAppCmdLineParamFlagNone,
803
+ NULL
804
+ };
805
+
806
+ static xmlSecAppCmdLineParam depthParam = {
807
+ xmlSecAppCmdLineTopicX509Certs,
808
+ "--depth",
809
+ NULL,
810
+ "--depth <number>"
811
+ "\n\tmaximum certificates chain depth",
812
+ xmlSecAppCmdLineParamTypeNumber,
813
+ xmlSecAppCmdLineParamFlagNone,
814
+ NULL
815
+ };
816
+
817
+ static xmlSecAppCmdLineParam X509SkipStrictChecksParam = {
818
+ xmlSecAppCmdLineTopicX509Certs,
819
+ "--X509-skip-strict-checks",
820
+ NULL,
821
+ "--X509-skip-strict-checks"
822
+ "\n\tskip strict checking of X509 data",
823
+ xmlSecAppCmdLineParamTypeFlag,
824
+ xmlSecAppCmdLineParamFlagNone,
825
+ NULL
826
+ };
827
+ #endif /* XMLSEC_NO_X509 */
828
+
829
+ static xmlSecAppCmdLineParamPtr parameters[] = {
830
+ /* common dsig params */
831
+ #ifndef XMLSEC_NO_XMLDSIG
832
+ &ignoreManifestsParam,
833
+ &storeReferencesParam,
834
+ &storeSignaturesParam,
835
+ &enabledRefUrisParam,
836
+ &enableVisa3DHackParam,
837
+ #endif /* XMLSEC_NO_XMLDSIG */
838
+
839
+ /* enc params */
840
+ #ifndef XMLSEC_NO_XMLENC
841
+ &binaryDataParam,
842
+ &xmlDataParam,
843
+ &enabledCipherRefUrisParam,
844
+ #endif /* XMLSEC_NO_XMLENC */
845
+
846
+ /* xkms params */
847
+ #ifndef XMLSEC_NO_XKMS
848
+ &xkmsServiceParam,
849
+ &xkmsFormatParam,
850
+ &xkmsStopUnknownResponseMechanismParam,
851
+ &xkmsStopUnknownRespondWithParam,
852
+ &xkmsStopUnknownKeyUsageParam,
853
+ #endif /* XMLSEC_NO_XKMS */
854
+
855
+ /* common dsig and enc parameters */
856
+ &sessionKeyParam,
857
+ &outputParam,
858
+ &printDebugParam,
859
+ &printXmlDebugParam,
860
+ &dtdFileParam,
861
+ &nodeIdParam,
862
+ &nodeNameParam,
863
+ &nodeXPathParam,
864
+ &idAttrParam,
865
+
866
+ /* Keys Manager params */
867
+ &enabledKeyDataParam,
868
+ &enabledRetrievalMethodUrisParam,
869
+ &genKeyParam,
870
+ &keysFileParam,
871
+ &privkeyParam,
872
+ &privkeyDerParam,
873
+ &pkcs8PemParam,
874
+ &pkcs8DerParam,
875
+ &pubkeyParam,
876
+ &pubkeyDerParam,
877
+ #ifndef XMLSEC_NO_AES
878
+ &aeskeyParam,
879
+ #endif /* XMLSEC_NO_AES */
880
+ #ifndef XMLSEC_NO_DES
881
+ &deskeyParam,
882
+ #endif /* XMLSEC_NO_DES */
883
+ #ifndef XMLSEC_NO_HMAC
884
+ &hmackeyParam,
885
+ #endif /* XMLSEC_NO_HMAC */
886
+ &pwdParam,
887
+ #ifndef XMLSEC_NO_X509
888
+ &pkcs12Param,
889
+ &pubkeyCertParam,
890
+ &pubkeyCertDerParam,
891
+ &trustedParam,
892
+ &untrustedParam,
893
+ &trustedDerParam,
894
+ &untrustedDerParam,
895
+ &verificationTimeParam,
896
+ &depthParam,
897
+ &X509SkipStrictChecksParam,
898
+ #endif /* XMLSEC_NO_X509 */
899
+
900
+ /* General configuration params */
901
+ &cryptoParam,
902
+ &cryptoConfigParam,
903
+ &repeatParam,
904
+ &disableErrorMsgsParam,
905
+ &printCryptoErrorMsgsParam,
906
+ &helpParam,
907
+
908
+ /* MUST be the last one */
909
+ NULL
910
+ };
911
+
912
+ typedef enum {
913
+ xmlSecAppCommandUnknown = 0,
914
+ xmlSecAppCommandHelp,
915
+ xmlSecAppCommandListKeyData,
916
+ xmlSecAppCommandCheckKeyData,
917
+ xmlSecAppCommandListTransforms,
918
+ xmlSecAppCommandCheckTransforms,
919
+ xmlSecAppCommandVersion,
920
+ xmlSecAppCommandKeys,
921
+ xmlSecAppCommandSign,
922
+ xmlSecAppCommandVerify,
923
+ xmlSecAppCommandSignTmpl,
924
+ xmlSecAppCommandEncrypt,
925
+ xmlSecAppCommandDecrypt,
926
+ xmlSecAppCommandEncryptTmpl,
927
+ xmlSecAppCommandXkmsServerRequest
928
+ } xmlSecAppCommand;
929
+
930
+ typedef struct _xmlSecAppXmlData xmlSecAppXmlData,
931
+ *xmlSecAppXmlDataPtr;
932
+ struct _xmlSecAppXmlData {
933
+ xmlDocPtr doc;
934
+ xmlDtdPtr dtd;
935
+ xmlNodePtr startNode;
936
+ };
937
+
938
+ static xmlSecAppXmlDataPtr xmlSecAppXmlDataCreate (const char* filename,
939
+ const xmlChar* defStartNodeName,
940
+ const xmlChar* defStartNodeNs);
941
+ static void xmlSecAppXmlDataDestroy (xmlSecAppXmlDataPtr data);
942
+
943
+
944
+ static xmlSecAppCommand xmlSecAppParseCommand (const char* cmd,
945
+ xmlSecAppCmdLineParamTopic* topics,
946
+ xmlSecAppCommand* subCommand);
947
+ static void xmlSecAppPrintHelp (xmlSecAppCommand command,
948
+ xmlSecAppCmdLineParamTopic topics);
949
+ #define xmlSecAppPrintUsage() xmlSecAppPrintHelp(xmlSecAppCommandUnknown, 0)
950
+ static int xmlSecAppInit (void);
951
+ static void xmlSecAppShutdown (void);
952
+ static int xmlSecAppLoadKeys (void);
953
+ static int xmlSecAppPrepareKeyInfoReadCtx (xmlSecKeyInfoCtxPtr ctx);
954
+
955
+ #ifndef XMLSEC_NO_XMLDSIG
956
+ static int xmlSecAppSignFile (const char* filename);
957
+ static int xmlSecAppVerifyFile (const char* filename);
958
+ #ifndef XMLSEC_NO_TMPL_TEST
959
+ static int xmlSecAppSignTmpl (void);
960
+ #endif /* XMLSEC_NO_TMPL_TEST */
961
+ static int xmlSecAppPrepareDSigCtx (xmlSecDSigCtxPtr dsigCtx);
962
+ static void xmlSecAppPrintDSigCtx (xmlSecDSigCtxPtr dsigCtx);
963
+ #endif /* XMLSEC_NO_XMLDSIG */
964
+
965
+ #ifndef XMLSEC_NO_XMLENC
966
+ static int xmlSecAppEncryptFile (const char* filename);
967
+ static int xmlSecAppDecryptFile (const char* filename);
968
+ #ifndef XMLSEC_NO_TMPL_TEST
969
+ static int xmlSecAppEncryptTmpl (void);
970
+ #endif /* XMLSEC_NO_TMPL_TEST */
971
+ static int xmlSecAppPrepareEncCtx (xmlSecEncCtxPtr encCtx);
972
+ static void xmlSecAppPrintEncCtx (xmlSecEncCtxPtr encCtx);
973
+ #endif /* XMLSEC_NO_XMLENC */
974
+
975
+ #ifndef XMLSEC_NO_XKMS
976
+ static int xmlSecAppXkmsServerProcess (const char* filename);
977
+ static int xmlSecAppPrepareXkmsServerCtx (xmlSecXkmsServerCtxPtr xkmsServerCtx);
978
+ static void xmlSecAppPrintXkmsServerCtx (xmlSecXkmsServerCtxPtr xkmsServerCtx);
979
+ #endif /* XMLSEC_NO_XKMS */
980
+
981
+ static void xmlSecAppListKeyData (void);
982
+ static int xmlSecAppCheckKeyData (const char * name);
983
+ static void xmlSecAppListTransforms (void);
984
+ static int xmlSecAppCheckTransform (const char * name);
985
+
986
+ static xmlSecTransformUriType xmlSecAppGetUriType (const char* string);
987
+ static FILE* xmlSecAppOpenFile (const char* filename);
988
+ static void xmlSecAppCloseFile (FILE* file);
989
+ static int xmlSecAppWriteResult (xmlDocPtr doc,
990
+ xmlSecBufferPtr buffer);
991
+ static int xmlSecAppAddIDAttr (xmlNodePtr cur,
992
+ const xmlChar* attr,
993
+ const xmlChar* node,
994
+ const xmlChar* nsHref);
995
+
996
+ xmlSecKeysMngrPtr gKeysMngr = NULL;
997
+ int repeats = 1;
998
+ int print_debug = 0;
999
+ clock_t total_time = 0;
1000
+ const char* xmlsec_crypto = XMLSEC_CRYPTO;
1001
+ const char* tmp = NULL;
1002
+
1003
+ int main(int argc, const char **argv) {
1004
+ xmlSecAppCmdLineParamTopic cmdLineTopics;
1005
+ xmlSecAppCommand command, subCommand;
1006
+ int pos, i;
1007
+ int res = 1;
1008
+
1009
+ /* read the command (first argument) */
1010
+ if(argc < 2) {
1011
+ xmlSecAppPrintUsage();
1012
+ goto fail;
1013
+ }
1014
+ command = xmlSecAppParseCommand(argv[1], &cmdLineTopics, &subCommand);
1015
+ if(command == xmlSecAppCommandUnknown) {
1016
+ fprintf(stderr, "Error: unknown command \"%s\"\n", argv[1]);
1017
+ xmlSecAppPrintUsage();
1018
+ goto fail;
1019
+ }
1020
+
1021
+ /* do as much as we can w/o initialization */
1022
+ if(command == xmlSecAppCommandHelp) {
1023
+ xmlSecAppPrintHelp(subCommand, cmdLineTopics);
1024
+ goto success;
1025
+ } else if(command == xmlSecAppCommandVersion) {
1026
+ fprintf(stdout, "%s %s (%s)\n", PACKAGE, XMLSEC_VERSION, xmlsec_crypto);
1027
+ goto success;
1028
+ }
1029
+
1030
+ /* parse command line */
1031
+ pos = xmlSecAppCmdLineParamsListParse(parameters, cmdLineTopics, argv, argc, 2);
1032
+ if(pos < 0) {
1033
+ fprintf(stderr, "Error: invalid parameters\n");
1034
+ xmlSecAppPrintUsage();
1035
+ goto fail;
1036
+ }
1037
+
1038
+ /* is it a help request? */
1039
+ if(xmlSecAppCmdLineParamIsSet(&helpParam)) {
1040
+ xmlSecAppPrintHelp(command, cmdLineTopics);
1041
+ goto success;
1042
+ }
1043
+
1044
+ /* we need to have some files at the end */
1045
+ switch(command) {
1046
+ case xmlSecAppCommandKeys:
1047
+ case xmlSecAppCommandSign:
1048
+ case xmlSecAppCommandVerify:
1049
+ case xmlSecAppCommandEncrypt:
1050
+ case xmlSecAppCommandDecrypt:
1051
+ case xmlSecAppCommandXkmsServerRequest:
1052
+ if(pos >= argc) {
1053
+ fprintf(stderr, "Error: <file> parameter is requried for this command\n");
1054
+ xmlSecAppPrintUsage();
1055
+ goto fail;
1056
+ }
1057
+ break;
1058
+ default:
1059
+ break;
1060
+ }
1061
+
1062
+ /* now init the xmlsec and all other libs */
1063
+ /* ignore "--crypto" if we don't have dynamic loading */
1064
+ tmp = xmlSecAppCmdLineParamGetString(&cryptoParam);
1065
+ #if !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING)
1066
+ if((tmp != NULL) && (strcmp(tmp, "default") != 0)) {
1067
+ xmlsec_crypto = tmp;
1068
+ }
1069
+ #else /* !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) */
1070
+ if((tmp != NULL) && (strcmp(tmp, xmlsec_crypto) != 0)) {
1071
+ fprintf(stderr, "Error: dynaimc crypto libraries loading is disabled and the only available crypto library is '%s'\n", xmlsec_crypto);
1072
+ xmlSecAppPrintUsage();
1073
+ goto fail;
1074
+ }
1075
+ #endif /* !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) */
1076
+
1077
+ if(xmlSecAppInit() < 0) {
1078
+ fprintf(stderr, "Error: initialization failed\n");
1079
+ xmlSecAppPrintUsage();
1080
+ goto fail;
1081
+ }
1082
+
1083
+ /* load keys */
1084
+ if(xmlSecAppLoadKeys() < 0) {
1085
+ fprintf(stderr, "Error: keys manager creation failed\n");
1086
+ xmlSecAppPrintUsage();
1087
+ goto fail;
1088
+ }
1089
+
1090
+ /* get the "repeats" number */
1091
+ if(xmlSecAppCmdLineParamIsSet(&repeatParam) &&
1092
+ (xmlSecAppCmdLineParamGetInt(&repeatParam, 1) > 0)) {
1093
+
1094
+ repeats = xmlSecAppCmdLineParamGetInt(&repeatParam, 1);
1095
+ }
1096
+
1097
+ /* execute requested number of times */
1098
+ for(; repeats > 0; --repeats) {
1099
+ switch(command) {
1100
+ case xmlSecAppCommandListKeyData:
1101
+ xmlSecAppListKeyData();
1102
+ break;
1103
+ case xmlSecAppCommandCheckKeyData:
1104
+ for(i = pos; i < argc; ++i) {
1105
+ if(xmlSecAppCheckKeyData(argv[i]) < 0) {
1106
+ fprintf(stderr, "Error: key data \"%s\" not found\n", argv[i]);
1107
+ goto fail;
1108
+ } else {
1109
+ fprintf(stdout, "Key data \"%s\" found\n", argv[i]);
1110
+ }
1111
+ }
1112
+ break;
1113
+ case xmlSecAppCommandListTransforms:
1114
+ xmlSecAppListTransforms();
1115
+ break;
1116
+ case xmlSecAppCommandCheckTransforms:
1117
+ for(i = pos; i < argc; ++i) {
1118
+ if(xmlSecAppCheckTransform(argv[i]) < 0) {
1119
+ fprintf(stderr, "Error: transform \"%s\" not found\n", argv[i]);
1120
+ goto fail;
1121
+ } else {
1122
+ fprintf(stdout, "Transforms \"%s\" found\n", argv[i]);
1123
+ }
1124
+ }
1125
+ break;
1126
+ case xmlSecAppCommandKeys:
1127
+ for(i = pos; i < argc; ++i) {
1128
+ if(xmlSecAppCryptoSimpleKeysMngrSave(gKeysMngr, argv[i], xmlSecKeyDataTypeAny) < 0) {
1129
+ fprintf(stderr, "Error: failed to save keys to file \"%s\"\n", argv[i]);
1130
+ goto fail;
1131
+ }
1132
+ }
1133
+ break;
1134
+ #ifndef XMLSEC_NO_XMLDSIG
1135
+ case xmlSecAppCommandSign:
1136
+ for(i = pos; i < argc; ++i) {
1137
+ if(xmlSecAppSignFile(argv[i]) < 0) {
1138
+ fprintf(stderr, "Error: failed to sign file \"%s\"\n", argv[i]);
1139
+ goto fail;
1140
+ }
1141
+ }
1142
+ break;
1143
+ case xmlSecAppCommandVerify:
1144
+ for(i = pos; i < argc; ++i) {
1145
+ if(xmlSecAppVerifyFile(argv[i]) < 0) {
1146
+ fprintf(stderr, "Error: failed to verify file \"%s\"\n", argv[i]);
1147
+ goto fail;
1148
+ }
1149
+ }
1150
+ break;
1151
+ #ifndef XMLSEC_NO_TMPL_TEST
1152
+ case xmlSecAppCommandSignTmpl:
1153
+ if(xmlSecAppSignTmpl() < 0) {
1154
+ fprintf(stderr, "Error: failed to create and sign template\n");
1155
+ goto fail;
1156
+ }
1157
+ break;
1158
+ #endif /* XMLSEC_NO_TMPL_TEST */
1159
+ #endif /* XMLSEC_NO_XMLDSIG */
1160
+
1161
+ #ifndef XMLSEC_NO_XMLENC
1162
+ case xmlSecAppCommandEncrypt:
1163
+ for(i = pos; i < argc; ++i) {
1164
+ if(xmlSecAppEncryptFile(argv[i]) < 0) {
1165
+ fprintf(stderr, "Error: failed to encrypt file with template \"%s\"\n", argv[i]);
1166
+ goto fail;
1167
+ }
1168
+ }
1169
+ break;
1170
+ case xmlSecAppCommandDecrypt:
1171
+ for(i = pos; i < argc; ++i) {
1172
+ if(xmlSecAppDecryptFile(argv[i]) < 0) {
1173
+ fprintf(stderr, "Error: failed to decrypt file \"%s\"\n", argv[i]);
1174
+ goto fail;
1175
+ }
1176
+ }
1177
+ break;
1178
+ #ifndef XMLSEC_NO_TMPL_TEST
1179
+ case xmlSecAppCommandEncryptTmpl:
1180
+ if(xmlSecAppEncryptTmpl() < 0) {
1181
+ fprintf(stderr, "Error: failed to create and encrypt template\n");
1182
+ goto fail;
1183
+ }
1184
+ break;
1185
+ #endif /* XMLSEC_NO_TMPL_TEST */
1186
+ #endif /* XMLSEC_NO_XMLENC */
1187
+
1188
+ #ifndef XMLSEC_NO_XKMS
1189
+ case xmlSecAppCommandXkmsServerRequest:
1190
+ for(i = pos; i < argc; ++i) {
1191
+ if(xmlSecAppXkmsServerProcess(argv[i]) < 0) {
1192
+ fprintf(stderr, "Error: failed to process XKMS server request from file \"%s\"\n", argv[i]);
1193
+ goto fail;
1194
+ }
1195
+ }
1196
+ break;
1197
+ #endif /* XMLSEC_NO_XKMS */
1198
+ default:
1199
+ fprintf(stderr, "Error: invalid command %d\n", command);
1200
+ xmlSecAppPrintUsage();
1201
+ goto fail;
1202
+ }
1203
+ }
1204
+
1205
+ /* print perf stats results */
1206
+ if(xmlSecAppCmdLineParamIsSet(&repeatParam) &&
1207
+ (xmlSecAppCmdLineParamGetInt(&repeatParam, 1) > 0)) {
1208
+
1209
+ repeats = xmlSecAppCmdLineParamGetInt(&repeatParam, 1);
1210
+ fprintf(stderr, "Executed %d tests in %ld msec\n", repeats, (1000 * total_time) / CLOCKS_PER_SEC);
1211
+ }
1212
+
1213
+ goto success;
1214
+ success:
1215
+ res = 0;
1216
+ fail:
1217
+ if(gKeysMngr != NULL) {
1218
+ xmlSecKeysMngrDestroy(gKeysMngr);
1219
+ gKeysMngr = NULL;
1220
+ }
1221
+ xmlSecAppShutdown();
1222
+ xmlSecAppCmdLineParamsListClean(parameters);
1223
+ return(res);
1224
+ }
1225
+
1226
+
1227
+ #ifndef XMLSEC_NO_XMLDSIG
1228
+ static int
1229
+ xmlSecAppSignFile(const char* filename) {
1230
+ xmlSecAppXmlDataPtr data = NULL;
1231
+ xmlSecDSigCtx dsigCtx;
1232
+ clock_t start_time;
1233
+ int res = -1;
1234
+
1235
+ if(filename == NULL) {
1236
+ return(-1);
1237
+ }
1238
+
1239
+ if(xmlSecDSigCtxInitialize(&dsigCtx, gKeysMngr) < 0) {
1240
+ fprintf(stderr, "Error: dsig context initialization failed\n");
1241
+ return(-1);
1242
+ }
1243
+
1244
+ if(xmlSecAppPrepareDSigCtx(&dsigCtx) < 0) {
1245
+ fprintf(stderr, "Error: dsig context preparation failed\n");
1246
+ goto done;
1247
+ }
1248
+
1249
+ /* parse template and select start node */
1250
+ data = xmlSecAppXmlDataCreate(filename, xmlSecNodeSignature, xmlSecDSigNs);
1251
+ if(data == NULL) {
1252
+ fprintf(stderr, "Error: failed to load template \"%s\"\n", filename);
1253
+ goto done;
1254
+ }
1255
+
1256
+
1257
+ /* sign */
1258
+ start_time = clock();
1259
+ if(xmlSecDSigCtxSign(&dsigCtx, data->startNode) < 0) {
1260
+ fprintf(stderr,"Error: signature failed \n");
1261
+ goto done;
1262
+ }
1263
+ total_time += clock() - start_time;
1264
+
1265
+ if(repeats <= 1) {
1266
+ FILE* f;
1267
+
1268
+ f = xmlSecAppOpenFile(xmlSecAppCmdLineParamGetString(&outputParam));
1269
+ if(f == NULL) {
1270
+ fprintf(stderr,"Error: failed to open output file \"%s\"\n",
1271
+ xmlSecAppCmdLineParamGetString(&outputParam));
1272
+ goto done;
1273
+ }
1274
+ xmlDocDump(f, data->doc);
1275
+ xmlSecAppCloseFile(f);
1276
+ }
1277
+
1278
+ res = 0;
1279
+ done:
1280
+ /* print debug info if requested */
1281
+ if(repeats <= 1) {
1282
+ xmlSecAppPrintDSigCtx(&dsigCtx);
1283
+ }
1284
+ xmlSecDSigCtxFinalize(&dsigCtx);
1285
+ if(data != NULL) {
1286
+ xmlSecAppXmlDataDestroy(data);
1287
+ }
1288
+ return(res);
1289
+ }
1290
+
1291
+ static int
1292
+ xmlSecAppVerifyFile(const char* filename) {
1293
+ xmlSecAppXmlDataPtr data = NULL;
1294
+ xmlSecDSigCtx dsigCtx;
1295
+ clock_t start_time;
1296
+ int res = -1;
1297
+
1298
+ if(filename == NULL) {
1299
+ return(-1);
1300
+ }
1301
+
1302
+ if(xmlSecDSigCtxInitialize(&dsigCtx, gKeysMngr) < 0) {
1303
+ fprintf(stderr, "Error: dsig context initialization failed\n");
1304
+ return(-1);
1305
+ }
1306
+ if(xmlSecAppPrepareDSigCtx(&dsigCtx) < 0) {
1307
+ fprintf(stderr, "Error: dsig context preparation failed\n");
1308
+ goto done;
1309
+ }
1310
+
1311
+ /* parse template and select start node */
1312
+ data = xmlSecAppXmlDataCreate(filename, xmlSecNodeSignature, xmlSecDSigNs);
1313
+ if(data == NULL) {
1314
+ fprintf(stderr, "Error: failed to load document \"%s\"\n", filename);
1315
+ goto done;
1316
+ }
1317
+
1318
+ /* sign */
1319
+ start_time = clock();
1320
+ if(xmlSecDSigCtxVerify(&dsigCtx, data->startNode) < 0) {
1321
+ fprintf(stderr,"Error: signature failed \n");
1322
+ goto done;
1323
+ }
1324
+ total_time += clock() - start_time;
1325
+
1326
+ if((repeats <= 1) && (dsigCtx.status != xmlSecDSigStatusSucceeded)){
1327
+ /* return an error if signature does not match */
1328
+ goto done;
1329
+ }
1330
+
1331
+ res = 0;
1332
+ done:
1333
+ /* print debug info if requested */
1334
+ if(repeats <= 1) {
1335
+ xmlSecDSigReferenceCtxPtr dsigRefCtx;
1336
+ xmlSecSize good, i, size;
1337
+ FILE* f;
1338
+
1339
+ f = xmlSecAppOpenFile(xmlSecAppCmdLineParamGetString(&outputParam));
1340
+ if(f == NULL) {
1341
+ fprintf(stderr,"Error: failed to open output file \"%s\"\n",
1342
+ xmlSecAppCmdLineParamGetString(&outputParam));
1343
+ goto done;
1344
+ }
1345
+ xmlSecAppCloseFile(f);
1346
+
1347
+ switch(dsigCtx.status) {
1348
+ case xmlSecDSigStatusUnknown:
1349
+ fprintf(stderr, "ERROR\n");
1350
+ break;
1351
+ case xmlSecDSigStatusSucceeded:
1352
+ fprintf(stderr, "OK\n");
1353
+ break;
1354
+ case xmlSecDSigStatusInvalid:
1355
+ fprintf(stderr, "FAIL\n");
1356
+ break;
1357
+ }
1358
+
1359
+ /* print stats about # of good/bad references/manifests */
1360
+ size = xmlSecPtrListGetSize(&(dsigCtx.signedInfoReferences));
1361
+ for(i = good = 0; i < size; ++i) {
1362
+ dsigRefCtx = (xmlSecDSigReferenceCtxPtr)xmlSecPtrListGetItem(&(dsigCtx.signedInfoReferences), i);
1363
+ if(dsigRefCtx == NULL) {
1364
+ fprintf(stderr,"Error: reference ctx is null\n");
1365
+ goto done;
1366
+ }
1367
+ if(dsigRefCtx->status == xmlSecDSigStatusSucceeded) {
1368
+ ++good;
1369
+ }
1370
+ }
1371
+ fprintf(stderr, "SignedInfo References (ok/all): %d/%d\n", good, size);
1372
+
1373
+ size = xmlSecPtrListGetSize(&(dsigCtx.manifestReferences));
1374
+ for(i = good = 0; i < size; ++i) {
1375
+ dsigRefCtx = (xmlSecDSigReferenceCtxPtr)xmlSecPtrListGetItem(&(dsigCtx.manifestReferences), i);
1376
+ if(dsigRefCtx == NULL) {
1377
+ fprintf(stderr,"Error: reference ctx is null\n");
1378
+ goto done;
1379
+ }
1380
+ if(dsigRefCtx->status == xmlSecDSigStatusSucceeded) {
1381
+ ++good;
1382
+ }
1383
+ }
1384
+ fprintf(stderr, "Manifests References (ok/all): %d/%d\n", good, size);
1385
+
1386
+ xmlSecAppPrintDSigCtx(&dsigCtx);
1387
+ }
1388
+ xmlSecDSigCtxFinalize(&dsigCtx);
1389
+ if(data != NULL) {
1390
+ xmlSecAppXmlDataDestroy(data);
1391
+ }
1392
+ return(res);
1393
+ }
1394
+
1395
+ #ifndef XMLSEC_NO_TMPL_TEST
1396
+ static int
1397
+ xmlSecAppSignTmpl(void) {
1398
+ xmlDocPtr doc = NULL;
1399
+ xmlNodePtr cur;
1400
+ xmlSecDSigCtx dsigCtx;
1401
+ clock_t start_time;
1402
+ int res = -1;
1403
+
1404
+ if(xmlSecDSigCtxInitialize(&dsigCtx, gKeysMngr) < 0) {
1405
+ fprintf(stderr, "Error: dsig context initialization failed\n");
1406
+ return(-1);
1407
+ }
1408
+ if(xmlSecAppPrepareDSigCtx(&dsigCtx) < 0) {
1409
+ fprintf(stderr, "Error: dsig context preparation failed\n");
1410
+ goto done;
1411
+ }
1412
+
1413
+ /* prepare template */
1414
+ doc = xmlNewDoc(BAD_CAST "1.0");
1415
+ if(doc == NULL) {
1416
+ fprintf(stderr, "Error: failed to create doc\n");
1417
+ goto done;
1418
+ }
1419
+
1420
+ cur = xmlSecTmplSignatureCreate(doc, xmlSecTransformInclC14NId,
1421
+ xmlSecTransformHmacSha1Id, NULL);
1422
+ if(cur == NULL) {
1423
+ fprintf(stderr, "Error: failed to create Signature node\n");
1424
+ goto done;
1425
+ }
1426
+ xmlDocSetRootElement(doc, cur);
1427
+
1428
+ /* set hmac signature length */
1429
+ cur = xmlSecTmplSignatureGetSignMethodNode(xmlDocGetRootElement(doc));
1430
+ if(cur == NULL) {
1431
+ fprintf(stderr, "Error: failed to find SignatureMethod node\n");
1432
+ goto done;
1433
+ }
1434
+ if(xmlSecTmplTransformAddHmacOutputLength(cur, 93) < 0) {
1435
+ fprintf(stderr, "Error: failed to set hmac length\n");
1436
+ goto done;
1437
+ }
1438
+
1439
+ cur = xmlSecTmplSignatureAddReference(xmlDocGetRootElement(doc),
1440
+ xmlSecTransformSha1Id,
1441
+ BAD_CAST "ref1", NULL, NULL);
1442
+ if(cur == NULL) {
1443
+ fprintf(stderr, "Error: failed to add Reference node\n");
1444
+ goto done;
1445
+ }
1446
+
1447
+ cur = xmlSecTmplReferenceAddTransform(cur, xmlSecTransformXPath2Id);
1448
+ if(cur == NULL) {
1449
+ fprintf(stderr, "Error: failed to add XPath transform\n");
1450
+ goto done;
1451
+ }
1452
+
1453
+ if(xmlSecTmplTransformAddXPath2(cur, BAD_CAST "intersect",
1454
+ BAD_CAST "//*[@Id='object1']", NULL) < 0) {
1455
+ fprintf(stderr, "Error: failed to set XPath expression\n");
1456
+ goto done;
1457
+ }
1458
+
1459
+ cur = xmlSecTmplSignatureAddObject(xmlDocGetRootElement(doc),
1460
+ BAD_CAST "object1", NULL, NULL);
1461
+ if(cur == NULL) {
1462
+ fprintf(stderr, "Error: failed to add Object node\n");
1463
+ goto done;
1464
+ }
1465
+ xmlNodeSetContent(cur, BAD_CAST "This is signed data");
1466
+
1467
+ /* add key information */
1468
+ cur = xmlSecTmplSignatureEnsureKeyInfo(xmlDocGetRootElement(doc), NULL);
1469
+ if(cur == NULL) {
1470
+ fprintf(stderr, "Error: failed to add KeyInfo node\n");
1471
+ goto done;
1472
+ }
1473
+ if(xmlSecTmplKeyInfoAddKeyName(cur, NULL) == NULL) {
1474
+ fprintf(stderr, "Error: failed to add KeyName node\n");
1475
+ goto done;
1476
+ }
1477
+
1478
+ /* sign */
1479
+ start_time = clock();
1480
+ if(xmlSecDSigCtxSign(&dsigCtx, xmlDocGetRootElement(doc)) < 0) {
1481
+ fprintf(stderr,"Error: signature failed \n");
1482
+ goto done;
1483
+ }
1484
+ total_time += clock() - start_time;
1485
+
1486
+ if(repeats <= 1) {
1487
+ FILE* f;
1488
+
1489
+ f = xmlSecAppOpenFile(xmlSecAppCmdLineParamGetString(&outputParam));
1490
+ if(f == NULL) {
1491
+ fprintf(stderr,"Error: failed to open output file \"%s\"\n",
1492
+ xmlSecAppCmdLineParamGetString(&outputParam));
1493
+ goto done;
1494
+ }
1495
+ xmlDocDump(f, doc);
1496
+ xmlSecAppCloseFile(f);
1497
+ }
1498
+
1499
+ res = 0;
1500
+ done:
1501
+ /* print debug info if requested */
1502
+ if(repeats <= 1) {
1503
+ xmlSecAppPrintDSigCtx(&dsigCtx);
1504
+ }
1505
+ xmlSecDSigCtxFinalize(&dsigCtx);
1506
+ if(doc != NULL) {
1507
+ xmlFreeDoc(doc);
1508
+ }
1509
+ return(res);
1510
+ }
1511
+ #endif /* XMLSEC_NO_TMPL_TEST */
1512
+
1513
+ static int
1514
+ xmlSecAppPrepareDSigCtx(xmlSecDSigCtxPtr dsigCtx) {
1515
+ if(dsigCtx == NULL) {
1516
+ fprintf(stderr, "Error: dsig context is null\n");
1517
+ return(-1);
1518
+ }
1519
+
1520
+ /* set key info params */
1521
+ if(xmlSecAppPrepareKeyInfoReadCtx(&(dsigCtx->keyInfoReadCtx)) < 0) {
1522
+ fprintf(stderr, "Error: failed to prepare key info context\n");
1523
+ return(-1);
1524
+ }
1525
+
1526
+ if(xmlSecAppCmdLineParamGetString(&sessionKeyParam) != NULL) {
1527
+ dsigCtx->signKey = xmlSecAppCryptoKeyGenerate(xmlSecAppCmdLineParamGetString(&sessionKeyParam),
1528
+ NULL, xmlSecKeyDataTypeSession);
1529
+ if(dsigCtx->signKey == NULL) {
1530
+ fprintf(stderr, "Error: failed to generate a session key \"%s\"\n",
1531
+ xmlSecAppCmdLineParamGetString(&sessionKeyParam));
1532
+ return(-1);
1533
+ }
1534
+ }
1535
+
1536
+ /* set dsig params */
1537
+ if(xmlSecAppCmdLineParamIsSet(&ignoreManifestsParam)) {
1538
+ dsigCtx->flags |= XMLSEC_DSIG_FLAGS_IGNORE_MANIFESTS;
1539
+ }
1540
+ if(xmlSecAppCmdLineParamIsSet(&storeReferencesParam)) {
1541
+ dsigCtx->flags |= XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES |
1542
+ XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES;
1543
+ print_debug = 1;
1544
+ }
1545
+ if(xmlSecAppCmdLineParamIsSet(&storeSignaturesParam)) {
1546
+ dsigCtx->flags |= XMLSEC_DSIG_FLAGS_STORE_SIGNATURE;
1547
+ print_debug = 1;
1548
+ }
1549
+ if(xmlSecAppCmdLineParamIsSet(&enableVisa3DHackParam)) {
1550
+ dsigCtx->flags |= XMLSEC_DSIG_FLAGS_USE_VISA3D_HACK;
1551
+ }
1552
+
1553
+ if(xmlSecAppCmdLineParamGetStringList(&enabledRefUrisParam) != NULL) {
1554
+ dsigCtx->enabledReferenceUris = xmlSecAppGetUriType(
1555
+ xmlSecAppCmdLineParamGetStringList(&enabledRefUrisParam));
1556
+ if(dsigCtx->enabledReferenceUris == xmlSecTransformUriTypeNone) {
1557
+ fprintf(stderr, "Error: failed to parse \"%s\"\n",
1558
+ xmlSecAppCmdLineParamGetStringList(&enabledRefUrisParam));
1559
+ return(-1);
1560
+ }
1561
+ }
1562
+
1563
+ return(0);
1564
+ }
1565
+
1566
+ static void
1567
+ xmlSecAppPrintDSigCtx(xmlSecDSigCtxPtr dsigCtx) {
1568
+ if(dsigCtx == NULL) {
1569
+ return;
1570
+ }
1571
+
1572
+ if(xmlSecAppCmdLineParamIsSet(&printDebugParam) || xmlSecAppCmdLineParamIsSet(&printXmlDebugParam)) {
1573
+ print_debug = 0;
1574
+ }
1575
+
1576
+ /* print debug info if requested */
1577
+ if((print_debug != 0) || xmlSecAppCmdLineParamIsSet(&printDebugParam)) {
1578
+ xmlSecDSigCtxDebugDump(dsigCtx, stdout);
1579
+ }
1580
+
1581
+ if(xmlSecAppCmdLineParamIsSet(&printXmlDebugParam)) {
1582
+ xmlSecDSigCtxDebugXmlDump(dsigCtx, stdout);
1583
+ }
1584
+ }
1585
+
1586
+ #endif /* XMLSEC_NO_XMLDSIG */
1587
+
1588
+ #ifndef XMLSEC_NO_XMLENC
1589
+ static int
1590
+ xmlSecAppEncryptFile(const char* filename) {
1591
+ xmlSecAppXmlDataPtr data = NULL;
1592
+ xmlSecEncCtx encCtx;
1593
+ xmlDocPtr doc = NULL;
1594
+ xmlNodePtr startTmplNode;
1595
+ clock_t start_time;
1596
+ int res = -1;
1597
+
1598
+ if(filename == NULL) {
1599
+ return(-1);
1600
+ }
1601
+
1602
+ if(xmlSecEncCtxInitialize(&encCtx, gKeysMngr) < 0) {
1603
+ fprintf(stderr, "Error: enc context initialization failed\n");
1604
+ return(-1);
1605
+ }
1606
+ if(xmlSecAppPrepareEncCtx(&encCtx) < 0) {
1607
+ fprintf(stderr, "Error: enc context preparation failed\n");
1608
+ goto done;
1609
+ }
1610
+
1611
+ /* parse doc and find template node */
1612
+ doc = xmlSecParseFile(filename);
1613
+ if(doc == NULL) {
1614
+ fprintf(stderr, "Error: failed to parse xml file \"%s\"\n",
1615
+ filename);
1616
+ goto done;
1617
+ }
1618
+ startTmplNode = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeEncryptedData, xmlSecEncNs);
1619
+ if(startTmplNode == NULL) {
1620
+ fprintf(stderr, "Error: failed to find default node with name=\"%s\"\n",
1621
+ xmlSecNodeEncryptedData);
1622
+ goto done;
1623
+ }
1624
+
1625
+ if(xmlSecAppCmdLineParamGetString(&binaryDataParam) != NULL) {
1626
+ /* encrypt */
1627
+ start_time = clock();
1628
+ if(xmlSecEncCtxUriEncrypt(&encCtx, startTmplNode, BAD_CAST xmlSecAppCmdLineParamGetString(&binaryDataParam)) < 0) {
1629
+ fprintf(stderr, "Error: failed to encrypt file \"%s\"\n",
1630
+ xmlSecAppCmdLineParamGetString(&binaryDataParam));
1631
+ goto done;
1632
+ }
1633
+ total_time += clock() - start_time;
1634
+ } else if(xmlSecAppCmdLineParamGetString(&xmlDataParam) != NULL) {
1635
+ /* parse file and select node for encryption */
1636
+ data = xmlSecAppXmlDataCreate(xmlSecAppCmdLineParamGetString(&xmlDataParam), NULL, NULL);
1637
+ if(data == NULL) {
1638
+ fprintf(stderr, "Error: failed to load file \"%s\"\n",
1639
+ xmlSecAppCmdLineParamGetString(&xmlDataParam));
1640
+ goto done;
1641
+ }
1642
+
1643
+ /* encrypt */
1644
+ start_time = clock();
1645
+ if(xmlSecEncCtxXmlEncrypt(&encCtx, startTmplNode, data->startNode) < 0) {
1646
+ fprintf(stderr, "Error: failed to encrypt xml file \"%s\"\n",
1647
+ xmlSecAppCmdLineParamGetString(&xmlDataParam));
1648
+ goto done;
1649
+ }
1650
+ total_time += clock() - start_time;
1651
+ } else {
1652
+ fprintf(stderr, "Error: encryption data not specified (use \"--xml\" or \"--binary\" options)\n");
1653
+ goto done;
1654
+ }
1655
+
1656
+ /* print out result only once per execution */
1657
+ if(repeats <= 1) {
1658
+ if(encCtx.resultReplaced) {
1659
+ if(xmlSecAppWriteResult((data != NULL) ? data->doc : doc, NULL) < 0) {
1660
+ goto done;
1661
+ }
1662
+ } else {
1663
+ if(xmlSecAppWriteResult(NULL, encCtx.result) < 0) {
1664
+ goto done;
1665
+ }
1666
+ }
1667
+ }
1668
+ res = 0;
1669
+
1670
+ done:
1671
+ /* print debug info if requested */
1672
+ if(repeats <= 1) {
1673
+ xmlSecAppPrintEncCtx(&encCtx);
1674
+ }
1675
+ xmlSecEncCtxFinalize(&encCtx);
1676
+
1677
+ if(data != NULL) {
1678
+ xmlSecAppXmlDataDestroy(data);
1679
+ }
1680
+ if(doc != NULL) {
1681
+ xmlFreeDoc(doc);
1682
+ }
1683
+ return(res);
1684
+ }
1685
+
1686
+ static int
1687
+ xmlSecAppDecryptFile(const char* filename) {
1688
+ xmlSecAppXmlDataPtr data = NULL;
1689
+ xmlSecEncCtx encCtx;
1690
+ clock_t start_time;
1691
+ int res = -1;
1692
+
1693
+ if(filename == NULL) {
1694
+ return(-1);
1695
+ }
1696
+
1697
+ if(xmlSecEncCtxInitialize(&encCtx, gKeysMngr) < 0) {
1698
+ fprintf(stderr, "Error: enc context initialization failed\n");
1699
+ return(-1);
1700
+ }
1701
+ if(xmlSecAppPrepareEncCtx(&encCtx) < 0) {
1702
+ fprintf(stderr, "Error: enc context preparation failed\n");
1703
+ goto done;
1704
+ }
1705
+
1706
+ /* parse template and select start node */
1707
+ data = xmlSecAppXmlDataCreate(filename, xmlSecNodeEncryptedData, xmlSecEncNs);
1708
+ if(data == NULL) {
1709
+ fprintf(stderr, "Error: failed to load template \"%s\"\n", filename);
1710
+ goto done;
1711
+ }
1712
+
1713
+ start_time = clock();
1714
+ if(xmlSecEncCtxDecrypt(&encCtx, data->startNode) < 0) {
1715
+ fprintf(stderr, "Error: failed to decrypt file\n");
1716
+ goto done;
1717
+ }
1718
+ total_time += clock() - start_time;
1719
+
1720
+ /* print out result only once per execution */
1721
+ if(repeats <= 1) {
1722
+ if(encCtx.resultReplaced) {
1723
+ if(xmlSecAppWriteResult(data->doc, NULL) < 0) {
1724
+ goto done;
1725
+ }
1726
+ } else {
1727
+ if(xmlSecAppWriteResult(NULL, encCtx.result) < 0) {
1728
+ goto done;
1729
+ }
1730
+ }
1731
+ }
1732
+ res = 0;
1733
+
1734
+ done:
1735
+ /* print debug info if requested */
1736
+ if(repeats <= 1) {
1737
+ xmlSecAppPrintEncCtx(&encCtx);
1738
+ }
1739
+ xmlSecEncCtxFinalize(&encCtx);
1740
+
1741
+ if(data != NULL) {
1742
+ xmlSecAppXmlDataDestroy(data);
1743
+ }
1744
+ return(res);
1745
+ }
1746
+
1747
+ #ifndef XMLSEC_NO_TMPL_TEST
1748
+ static int
1749
+ xmlSecAppEncryptTmpl(void) {
1750
+ const char* data = "Hello, World!";
1751
+ xmlSecEncCtx encCtx;
1752
+ xmlDocPtr doc = NULL;
1753
+ xmlNodePtr cur;
1754
+ clock_t start_time;
1755
+ int res = -1;
1756
+
1757
+ if(xmlSecEncCtxInitialize(&encCtx, gKeysMngr) < 0) {
1758
+ fprintf(stderr, "Error: enc context initialization failed\n");
1759
+ return(-1);
1760
+ }
1761
+ if(xmlSecAppPrepareEncCtx(&encCtx) < 0) {
1762
+ fprintf(stderr, "Error: enc context preparation failed\n");
1763
+ goto done;
1764
+ }
1765
+
1766
+ /* prepare template */
1767
+ doc = xmlNewDoc(BAD_CAST "1.0");
1768
+ if(doc == NULL) {
1769
+ fprintf(stderr, "Error: failed to create doc\n");
1770
+ goto done;
1771
+ }
1772
+
1773
+ cur = xmlSecTmplEncDataCreate(doc, xmlSecTransformDes3CbcId,
1774
+ NULL, NULL, NULL, NULL);
1775
+ if(cur == NULL) {
1776
+ fprintf(stderr, "Error: failed to encryption template\n");
1777
+ goto done;
1778
+ }
1779
+ xmlDocSetRootElement(doc, cur);
1780
+
1781
+ if(xmlSecTmplEncDataEnsureCipherValue(xmlDocGetRootElement(doc)) == NULL) {
1782
+ fprintf(stderr, "Error: failed to add CipherValue node\n");
1783
+ goto done;
1784
+ }
1785
+
1786
+ /* add key information */
1787
+ cur = xmlSecTmplEncDataEnsureKeyInfo(xmlDocGetRootElement(doc), NULL);
1788
+ if(cur == NULL) {
1789
+ fprintf(stderr, "Error: failed to add KeyInfo node\n");
1790
+ goto done;
1791
+ }
1792
+ if(xmlSecTmplKeyInfoAddKeyName(cur, NULL) == NULL) {
1793
+ fprintf(stderr, "Error: failed to add KeyName node\n");
1794
+ goto done;
1795
+ }
1796
+
1797
+ /* encrypt */
1798
+ start_time = clock();
1799
+ if(xmlSecEncCtxBinaryEncrypt(&encCtx, xmlDocGetRootElement(doc),
1800
+ (const xmlSecByte*)data, strlen(data)) < 0) {
1801
+ fprintf(stderr, "Error: failed to encrypt data\n");
1802
+ goto done;
1803
+ }
1804
+ total_time += clock() - start_time;
1805
+
1806
+ /* print out result only once per execution */
1807
+ if(repeats <= 1) {
1808
+ if(encCtx.resultReplaced) {
1809
+ if(xmlSecAppWriteResult(doc, NULL) < 0) {
1810
+ goto done;
1811
+ }
1812
+ } else {
1813
+ if(xmlSecAppWriteResult(NULL, encCtx.result) < 0) {
1814
+ goto done;
1815
+ }
1816
+ }
1817
+ }
1818
+ res = 0;
1819
+
1820
+ done:
1821
+ /* print debug info if requested */
1822
+ if(repeats <= 1) {
1823
+ xmlSecAppPrintEncCtx(&encCtx);
1824
+ }
1825
+ xmlSecEncCtxFinalize(&encCtx);
1826
+ if(doc != NULL) {
1827
+ xmlFreeDoc(doc);
1828
+ }
1829
+ return(res);
1830
+ }
1831
+ #endif /* XMLSEC_NO_TMPL_TEST */
1832
+
1833
+ static int
1834
+ xmlSecAppPrepareEncCtx(xmlSecEncCtxPtr encCtx) {
1835
+ if(encCtx == NULL) {
1836
+ fprintf(stderr, "Error: enc context is null\n");
1837
+ return(-1);
1838
+ }
1839
+
1840
+ /* set key info params */
1841
+ if(xmlSecAppPrepareKeyInfoReadCtx(&(encCtx->keyInfoReadCtx)) < 0) {
1842
+ fprintf(stderr, "Error: failed to prepare key info context\n");
1843
+ return(-1);
1844
+ }
1845
+
1846
+ if(xmlSecAppCmdLineParamGetString(&sessionKeyParam) != NULL) {
1847
+ encCtx->encKey = xmlSecAppCryptoKeyGenerate(xmlSecAppCmdLineParamGetString(&sessionKeyParam),
1848
+ NULL, xmlSecKeyDataTypeSession);
1849
+ if(encCtx->encKey == NULL) {
1850
+ fprintf(stderr, "Error: failed to generate a session key \"%s\"\n",
1851
+ xmlSecAppCmdLineParamGetString(&sessionKeyParam));
1852
+ return(-1);
1853
+ }
1854
+ }
1855
+
1856
+ if(xmlSecAppCmdLineParamGetStringList(&enabledCipherRefUrisParam) != NULL) {
1857
+ encCtx->transformCtx.enabledUris = xmlSecAppGetUriType(
1858
+ xmlSecAppCmdLineParamGetStringList(&enabledCipherRefUrisParam));
1859
+ if(encCtx->transformCtx.enabledUris == xmlSecTransformUriTypeNone) {
1860
+ fprintf(stderr, "Error: failed to parse \"%s\"\n",
1861
+ xmlSecAppCmdLineParamGetStringList(&enabledCipherRefUrisParam));
1862
+ return(-1);
1863
+ }
1864
+ }
1865
+ return(0);
1866
+ }
1867
+
1868
+ static void
1869
+ xmlSecAppPrintEncCtx(xmlSecEncCtxPtr encCtx) {
1870
+ if(encCtx == NULL) {
1871
+ return;
1872
+ }
1873
+
1874
+ /* print debug info if requested */
1875
+ if((print_debug != 0) || xmlSecAppCmdLineParamIsSet(&printDebugParam)) {
1876
+ xmlSecEncCtxDebugDump(encCtx, stdout);
1877
+ }
1878
+
1879
+ if(xmlSecAppCmdLineParamIsSet(&printXmlDebugParam)) {
1880
+ xmlSecEncCtxDebugXmlDump(encCtx, stdout);
1881
+ }
1882
+ }
1883
+
1884
+ #endif /* XMLSEC_NO_XMLENC */
1885
+
1886
+ #ifndef XMLSEC_NO_XKMS
1887
+ static int
1888
+ xmlSecAppXkmsServerProcess(const char* filename) {
1889
+ xmlSecAppXmlDataPtr data = NULL;
1890
+ xmlDocPtr doc = NULL;
1891
+ xmlNodePtr result;
1892
+ xmlSecXkmsServerCtx xkmsServerCtx;
1893
+ xmlSecXkmsServerFormat format = xmlSecXkmsServerFormatPlain;
1894
+ clock_t start_time;
1895
+ int res = -1;
1896
+
1897
+ if(filename == NULL) {
1898
+ return(-1);
1899
+ }
1900
+
1901
+ if(xmlSecXkmsServerCtxInitialize(&xkmsServerCtx, gKeysMngr) < 0) {
1902
+ fprintf(stderr, "Error: XKMS server context initialization failed\n");
1903
+ return(-1);
1904
+ }
1905
+ if(xmlSecAppPrepareXkmsServerCtx(&xkmsServerCtx) < 0) {
1906
+ fprintf(stderr, "Error: XKMS server context preparation failed\n");
1907
+ goto done;
1908
+ }
1909
+
1910
+ /* get the input format */
1911
+ if(xmlSecAppCmdLineParamGetString(&xkmsFormatParam) != NULL) {
1912
+ format = xmlSecXkmsServerFormatFromString(BAD_CAST xmlSecAppCmdLineParamGetString(&xkmsFormatParam));
1913
+ if(format == xmlSecXkmsServerFormatUnknown) {
1914
+ fprintf(stderr, "Error: unknown format \"%s\"\n",
1915
+ xmlSecAppCmdLineParamGetString(&xkmsFormatParam));
1916
+ return(-1);
1917
+ }
1918
+ }
1919
+
1920
+ /* parse template and select start node, there are multiple options
1921
+ * for start node thus we don't provide the default start node name */
1922
+ data = xmlSecAppXmlDataCreate(filename, NULL, NULL);
1923
+ if(data == NULL) {
1924
+ fprintf(stderr, "Error: failed to load request from file \"%s\"\n", filename);
1925
+ goto done;
1926
+ }
1927
+
1928
+ /* prepare result document */
1929
+ doc = xmlNewDoc(BAD_CAST "1.0");
1930
+ if(doc == NULL) {
1931
+ fprintf(stderr, "Error: failed to create doc\n");
1932
+ goto done;
1933
+ }
1934
+
1935
+ start_time = clock();
1936
+ result = xmlSecXkmsServerCtxProcess(&xkmsServerCtx, data->startNode, format, doc);
1937
+ if(result == NULL) {
1938
+ fprintf(stderr, "Error: failed to process xkms server request\n");
1939
+ goto done;
1940
+ }
1941
+ total_time += clock() - start_time;
1942
+
1943
+
1944
+ /* print out result only once per execution */
1945
+ xmlDocSetRootElement(doc, result);
1946
+ if(repeats <= 1) {
1947
+ if(xmlSecAppWriteResult(doc, NULL) < 0) {
1948
+ goto done;
1949
+ }
1950
+ }
1951
+
1952
+ res = 0;
1953
+
1954
+ done:
1955
+ /* print debug info if requested */
1956
+ if(repeats <= 1) {
1957
+ xmlSecAppPrintXkmsServerCtx(&xkmsServerCtx);
1958
+ }
1959
+ xmlSecXkmsServerCtxFinalize(&xkmsServerCtx);
1960
+
1961
+ if(doc != NULL) {
1962
+ xmlFreeDoc(doc);
1963
+ }
1964
+ if(data != NULL) {
1965
+ xmlSecAppXmlDataDestroy(data);
1966
+ }
1967
+ return(res);
1968
+ }
1969
+
1970
+ static int
1971
+ xmlSecAppPrepareXkmsServerCtx(xmlSecXkmsServerCtxPtr xkmsServerCtx) {
1972
+ if(xkmsServerCtx == NULL) {
1973
+ fprintf(stderr, "Error: XKMS context is null\n");
1974
+ return(-1);
1975
+ }
1976
+
1977
+ /* set key info params */
1978
+ if(xmlSecAppPrepareKeyInfoReadCtx(&(xkmsServerCtx->keyInfoReadCtx)) < 0) {
1979
+ fprintf(stderr, "Error: failed to prepare key info context\n");
1980
+ return(-1);
1981
+ }
1982
+
1983
+ if(xmlSecAppCmdLineParamGetString(&xkmsServiceParam) != NULL) {
1984
+ xkmsServerCtx->expectedService = xmlStrdup(BAD_CAST xmlSecAppCmdLineParamGetString(&xkmsServiceParam));
1985
+ if(xkmsServerCtx->expectedService == NULL) {
1986
+ fprintf(stderr, "Error: failed to duplicate string \"%s\"\n",
1987
+ xmlSecAppCmdLineParamGetString(&xkmsServiceParam));
1988
+ return(-1);
1989
+ }
1990
+ }
1991
+
1992
+ if(xmlSecAppCmdLineParamIsSet(&xkmsStopUnknownResponseMechanismParam)) {
1993
+ xkmsServerCtx->flags |= XMLSEC_XKMS_SERVER_FLAGS_STOP_ON_UNKNOWN_RESPONSE_MECHANISM;
1994
+ }
1995
+ if(xmlSecAppCmdLineParamIsSet(&xkmsStopUnknownRespondWithParam)) {
1996
+ xkmsServerCtx->flags |= XMLSEC_XKMS_SERVER_FLAGS_STOP_ON_UNKNOWN_RESPOND_WITH;
1997
+ }
1998
+ if(xmlSecAppCmdLineParamIsSet(&xkmsStopUnknownKeyUsageParam)) {
1999
+ xkmsServerCtx->flags |= XMLSEC_XKMS_SERVER_FLAGS_STOP_ON_UNKNOWN_KEY_USAGE;
2000
+ }
2001
+ return(0);
2002
+ }
2003
+
2004
+ static void
2005
+ xmlSecAppPrintXkmsServerCtx(xmlSecXkmsServerCtxPtr xkmsServerCtx) {
2006
+ if(xkmsServerCtx == NULL) {
2007
+ return;
2008
+ }
2009
+
2010
+ /* print debug info if requested */
2011
+ if((print_debug != 0) || xmlSecAppCmdLineParamIsSet(&printDebugParam)) {
2012
+ xmlSecXkmsServerCtxDebugDump(xkmsServerCtx, stdout);
2013
+ }
2014
+
2015
+ if(xmlSecAppCmdLineParamIsSet(&printXmlDebugParam)) {
2016
+ xmlSecXkmsServerCtxDebugXmlDump(xkmsServerCtx, stdout);
2017
+ }
2018
+ }
2019
+
2020
+ #endif /* XMLSEC_NO_XKMS */
2021
+
2022
+ static void
2023
+ xmlSecAppListKeyData(void) {
2024
+ fprintf(stdout, "Registered key data klasses:\n");
2025
+ xmlSecKeyDataIdListDebugDump(xmlSecKeyDataIdsGet(), stdout);
2026
+ }
2027
+
2028
+ static int
2029
+ xmlSecAppCheckKeyData(const char * name) {
2030
+ if(xmlSecKeyDataIdListFindByName(xmlSecKeyDataIdsGet(), BAD_CAST name, xmlSecKeyDataUsageAny) == xmlSecKeyDataIdUnknown) {
2031
+ return -1;
2032
+ }
2033
+ return 0;
2034
+ }
2035
+
2036
+ static void
2037
+ xmlSecAppListTransforms(void) {
2038
+ fprintf(stdout, "Registered transform klasses:\n");
2039
+ xmlSecTransformIdListDebugDump(xmlSecTransformIdsGet(), stdout);
2040
+ }
2041
+
2042
+ static int
2043
+ xmlSecAppCheckTransform(const char * name) {
2044
+ if(xmlSecTransformIdListFindByName(xmlSecTransformIdsGet(), BAD_CAST name, xmlSecTransformUsageAny) == xmlSecTransformIdUnknown) {
2045
+ return -1;
2046
+ }
2047
+ return 0;
2048
+ }
2049
+
2050
+ static int
2051
+ xmlSecAppPrepareKeyInfoReadCtx(xmlSecKeyInfoCtxPtr keyInfoCtx) {
2052
+ xmlSecAppCmdLineValuePtr value;
2053
+ int ret;
2054
+
2055
+ if(keyInfoCtx == NULL) {
2056
+ fprintf(stderr, "Error: key info context is null\n");
2057
+ return(-1);
2058
+ }
2059
+
2060
+ #ifndef XMLSEC_NO_X509
2061
+ if(xmlSecAppCmdLineParamIsSet(&verificationTimeParam)) {
2062
+ keyInfoCtx->certsVerificationTime = xmlSecAppCmdLineParamGetTime(&verificationTimeParam, 0);
2063
+ }
2064
+ if(xmlSecAppCmdLineParamIsSet(&depthParam)) {
2065
+ keyInfoCtx->certsVerificationDepth = xmlSecAppCmdLineParamGetInt(&depthParam, 0);
2066
+ }
2067
+ if(xmlSecAppCmdLineParamIsSet(&X509SkipStrictChecksParam)) {
2068
+ keyInfoCtx->flags |= XMLSEC_KEYINFO_FLAGS_X509DATA_SKIP_STRICT_CHECKS;
2069
+ }
2070
+ #endif /* XMLSEC_NO_X509 */
2071
+
2072
+ /* read enabled key data list */
2073
+ for(value = enabledKeyDataParam.value; value != NULL; value = value->next) {
2074
+ if(value->strListValue == NULL) {
2075
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2076
+ enabledKeyDataParam.fullName);
2077
+ return(-1);
2078
+ } else {
2079
+ xmlSecKeyDataId dataId;
2080
+ const char* p;
2081
+
2082
+ for(p = value->strListValue; (p != NULL) && ((*p) != '\0'); p += strlen(p)) {
2083
+ dataId = xmlSecKeyDataIdListFindByName(xmlSecKeyDataIdsGet(), BAD_CAST p, xmlSecKeyDataUsageAny);
2084
+ if(dataId == xmlSecKeyDataIdUnknown) {
2085
+ fprintf(stderr, "Error: key data \"%s\" is unknown.\n", p);
2086
+ return(-1);
2087
+ }
2088
+ ret = xmlSecPtrListAdd(&(keyInfoCtx->enabledKeyData), (const xmlSecPtr)dataId);
2089
+ if(ret < 0) {
2090
+ fprintf(stderr, "Error: failed to enable key data \"%s\".\n", p);
2091
+ return(-1);
2092
+ }
2093
+ }
2094
+ }
2095
+ }
2096
+
2097
+ /* read enabled RetrievalMethod uris */
2098
+ if(xmlSecAppCmdLineParamGetStringList(&enabledRetrievalMethodUrisParam) != NULL) {
2099
+ keyInfoCtx->retrievalMethodCtx.enabledUris = xmlSecAppGetUriType(
2100
+ xmlSecAppCmdLineParamGetStringList(&enabledRetrievalMethodUrisParam));
2101
+ if(keyInfoCtx->retrievalMethodCtx.enabledUris == xmlSecTransformUriTypeNone) {
2102
+ fprintf(stderr, "Error: failed to parse \"%s\"\n",
2103
+ xmlSecAppCmdLineParamGetStringList(&enabledRetrievalMethodUrisParam));
2104
+ return(-1);
2105
+ }
2106
+ }
2107
+
2108
+ return(0);
2109
+ }
2110
+
2111
+ static int
2112
+ xmlSecAppLoadKeys(void) {
2113
+ xmlSecAppCmdLineValuePtr value;
2114
+
2115
+ if(gKeysMngr != NULL) {
2116
+ fprintf(stderr, "Error: keys manager already initialized.\n");
2117
+ return(-1);
2118
+ }
2119
+
2120
+ /* create and initialize keys manager */
2121
+ gKeysMngr = xmlSecKeysMngrCreate();
2122
+ if(gKeysMngr == NULL) {
2123
+ fprintf(stderr, "Error: failed to create keys manager.\n");
2124
+ return(-1);
2125
+ }
2126
+ if(xmlSecAppCryptoSimpleKeysMngrInit(gKeysMngr) < 0) {
2127
+ fprintf(stderr, "Error: failed to initialize keys manager.\n");
2128
+ return(-1);
2129
+ }
2130
+
2131
+ /* generate new key file */
2132
+ for(value = genKeyParam.value; value != NULL; value = value->next) {
2133
+ if(value->strValue == NULL) {
2134
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", genKeyParam.fullName);
2135
+ return(-1);
2136
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyGenerate(gKeysMngr, value->strValue, value->paramNameValue) < 0) {
2137
+ fprintf(stderr, "Error: failed to generate key \"%s\".\n", value->strValue);
2138
+ return(-1);
2139
+ }
2140
+ }
2141
+
2142
+ /* read all xml key files */
2143
+ for(value = keysFileParam.value; value != NULL; value = value->next) {
2144
+ if(value->strValue == NULL) {
2145
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", keysFileParam.fullName);
2146
+ return(-1);
2147
+ } else if(xmlSecAppCryptoSimpleKeysMngrLoad(gKeysMngr, value->strValue) < 0) {
2148
+ fprintf(stderr, "Error: failed to load xml keys file \"%s\".\n", value->strValue);
2149
+ return(-1);
2150
+ }
2151
+ }
2152
+
2153
+ /* read all private keys */
2154
+ for(value = privkeyParam.value; value != NULL; value = value->next) {
2155
+ if(value->strValue == NULL) {
2156
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2157
+ privkeyParam.fullName);
2158
+ return(-1);
2159
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2160
+ value->strListValue,
2161
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2162
+ value->paramNameValue,
2163
+ xmlSecKeyDataFormatPem) < 0) {
2164
+ fprintf(stderr, "Error: failed to load private key from \"%s\".\n",
2165
+ value->strListValue);
2166
+ return(-1);
2167
+ }
2168
+ }
2169
+
2170
+ for(value = privkeyDerParam.value; value != NULL; value = value->next) {
2171
+ if(value->strValue == NULL) {
2172
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2173
+ privkeyDerParam.fullName);
2174
+ return(-1);
2175
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2176
+ value->strListValue,
2177
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2178
+ value->paramNameValue,
2179
+ xmlSecKeyDataFormatDer) < 0) {
2180
+ fprintf(stderr, "Error: failed to load private key from \"%s\".\n",
2181
+ value->strListValue);
2182
+ return(-1);
2183
+ }
2184
+ }
2185
+
2186
+ for(value = pkcs8PemParam.value; value != NULL; value = value->next) {
2187
+ if(value->strValue == NULL) {
2188
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2189
+ pkcs8PemParam.fullName);
2190
+ return(-1);
2191
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2192
+ value->strListValue,
2193
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2194
+ value->paramNameValue,
2195
+ xmlSecKeyDataFormatPkcs8Pem) < 0) {
2196
+ fprintf(stderr, "Error: failed to load private key from \"%s\".\n",
2197
+ value->strListValue);
2198
+ return(-1);
2199
+ }
2200
+ }
2201
+
2202
+ for(value = pkcs8DerParam.value; value != NULL; value = value->next) {
2203
+ if(value->strValue == NULL) {
2204
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2205
+ pkcs8DerParam.fullName);
2206
+ return(-1);
2207
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2208
+ value->strListValue,
2209
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2210
+ value->paramNameValue,
2211
+ xmlSecKeyDataFormatPkcs8Der) < 0) {
2212
+ fprintf(stderr, "Error: failed to load private key from \"%s\".\n",
2213
+ value->strListValue);
2214
+ return(-1);
2215
+ }
2216
+ }
2217
+
2218
+ /* read all public keys */
2219
+ for(value = pubkeyParam.value; value != NULL; value = value->next) {
2220
+ if(value->strValue == NULL) {
2221
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2222
+ pubkeyParam.fullName);
2223
+ return(-1);
2224
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2225
+ value->strListValue,
2226
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2227
+ value->paramNameValue,
2228
+ xmlSecKeyDataFormatPem) < 0) {
2229
+ fprintf(stderr, "Error: failed to load public key from \"%s\".\n",
2230
+ value->strListValue);
2231
+ return(-1);
2232
+ }
2233
+ }
2234
+
2235
+ for(value = pubkeyDerParam.value; value != NULL; value = value->next) {
2236
+ if(value->strValue == NULL) {
2237
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2238
+ pubkeyDerParam.fullName);
2239
+ return(-1);
2240
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2241
+ value->strListValue,
2242
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2243
+ value->paramNameValue,
2244
+ xmlSecKeyDataFormatDer) < 0) {
2245
+ fprintf(stderr, "Error: failed to load public key from \"%s\".\n",
2246
+ value->strListValue);
2247
+ return(-1);
2248
+ }
2249
+ }
2250
+
2251
+ #ifndef XMLSEC_NO_AES
2252
+ /* read all AES keys */
2253
+ for(value = aeskeyParam.value; value != NULL; value = value->next) {
2254
+ if(value->strValue == NULL) {
2255
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2256
+ aeskeyParam.fullName);
2257
+ return(-1);
2258
+ } else if(xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad(gKeysMngr,
2259
+ "aes", value->strValue, value->paramNameValue) < 0) {
2260
+ fprintf(stderr, "Error: failed to load aes key from \"%s\".\n",
2261
+ value->strValue);
2262
+ return(-1);
2263
+ }
2264
+ }
2265
+ #endif /* XMLSEC_NO_AES */
2266
+
2267
+ #ifndef XMLSEC_NO_DES
2268
+ /* read all des keys */
2269
+ for(value = deskeyParam.value; value != NULL; value = value->next) {
2270
+ if(value->strValue == NULL) {
2271
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2272
+ deskeyParam.fullName);
2273
+ return(-1);
2274
+ } else if(xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad(gKeysMngr,
2275
+ "des", value->strValue, value->paramNameValue) < 0) {
2276
+ fprintf(stderr, "Error: failed to load des key from \"%s\".\n",
2277
+ value->strValue);
2278
+ return(-1);
2279
+ }
2280
+ }
2281
+ #endif /* XMLSEC_NO_DES */
2282
+
2283
+ #ifndef XMLSEC_NO_HMAC
2284
+ /* read all hmac keys */
2285
+ for(value = hmackeyParam.value; value != NULL; value = value->next) {
2286
+ if(value->strValue == NULL) {
2287
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2288
+ hmackeyParam.fullName);
2289
+ return(-1);
2290
+ } else if(xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad(gKeysMngr,
2291
+ "hmac", value->strValue, value->paramNameValue) < 0) {
2292
+ fprintf(stderr, "Error: failed to load hmac key from \"%s\".\n",
2293
+ value->strValue);
2294
+ return(-1);
2295
+ }
2296
+ }
2297
+ #endif /* XMLSEC_NO_HMAC */
2298
+
2299
+ #ifndef XMLSEC_NO_X509
2300
+ /* read all pkcs12 files */
2301
+ for(value = pkcs12Param.value; value != NULL; value = value->next) {
2302
+ if(value->strValue == NULL) {
2303
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", pkcs12Param.fullName);
2304
+ return(-1);
2305
+ } else if(xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad(gKeysMngr,
2306
+ value->strValue,
2307
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2308
+ value->paramNameValue) < 0) {
2309
+ fprintf(stderr, "Error: failed to load pkcs12 key from \"%s\".\n",
2310
+ value->strValue);
2311
+ return(-1);
2312
+ }
2313
+ }
2314
+
2315
+ /* read all trusted certs */
2316
+ for(value = trustedParam.value; value != NULL; value = value->next) {
2317
+ if(value->strValue == NULL) {
2318
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", trustedParam.fullName);
2319
+ return(-1);
2320
+ } else if(xmlSecAppCryptoSimpleKeysMngrCertLoad(gKeysMngr,
2321
+ value->strValue, xmlSecKeyDataFormatPem,
2322
+ xmlSecKeyDataTypeTrusted) < 0) {
2323
+ fprintf(stderr, "Error: failed to load trusted cert from \"%s\".\n",
2324
+ value->strValue);
2325
+ return(-1);
2326
+ }
2327
+ }
2328
+ for(value = trustedDerParam.value; value != NULL; value = value->next) {
2329
+ if(value->strValue == NULL) {
2330
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", trustedDerParam.fullName);
2331
+ return(-1);
2332
+ } else if(xmlSecAppCryptoSimpleKeysMngrCertLoad(gKeysMngr,
2333
+ value->strValue, xmlSecKeyDataFormatDer,
2334
+ xmlSecKeyDataTypeTrusted) < 0) {
2335
+ fprintf(stderr, "Error: failed to load trusted cert from \"%s\".\n",
2336
+ value->strValue);
2337
+ return(-1);
2338
+ }
2339
+ }
2340
+
2341
+
2342
+ /* read all public keys in certs */
2343
+ for(value = pubkeyCertParam.value; value != NULL; value = value->next) {
2344
+ if(value->strValue == NULL) {
2345
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2346
+ pubkeyCertParam.fullName);
2347
+ return(-1);
2348
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2349
+ value->strListValue,
2350
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2351
+ value->paramNameValue,
2352
+ xmlSecKeyDataFormatCertPem) < 0) {
2353
+ fprintf(stderr, "Error: failed to load public key from \"%s\".\n",
2354
+ value->strListValue);
2355
+ return(-1);
2356
+ }
2357
+ }
2358
+
2359
+ for(value = pubkeyCertDerParam.value; value != NULL; value = value->next) {
2360
+ if(value->strValue == NULL) {
2361
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2362
+ pubkeyCertDerParam.fullName);
2363
+ return(-1);
2364
+ } else if(xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(gKeysMngr,
2365
+ value->strListValue,
2366
+ xmlSecAppCmdLineParamGetString(&pwdParam),
2367
+ value->paramNameValue,
2368
+ xmlSecKeyDataFormatCertDer) < 0) {
2369
+ fprintf(stderr, "Error: failed to load public key from \"%s\".\n",
2370
+ value->strListValue);
2371
+ return(-1);
2372
+ }
2373
+ }
2374
+
2375
+
2376
+ /* read all untrusted certs */
2377
+ for(value = untrustedParam.value; value != NULL; value = value->next) {
2378
+ if(value->strValue == NULL) {
2379
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", untrustedParam.fullName);
2380
+ return(-1);
2381
+ } else if(xmlSecAppCryptoSimpleKeysMngrCertLoad(gKeysMngr,
2382
+ value->strValue, xmlSecKeyDataFormatPem,
2383
+ xmlSecKeyDataTypeNone) < 0) {
2384
+ fprintf(stderr, "Error: failed to load untrusted cert from \"%s\".\n",
2385
+ value->strValue);
2386
+ return(-1);
2387
+ }
2388
+ }
2389
+ for(value = untrustedDerParam.value; value != NULL; value = value->next) {
2390
+ if(value->strValue == NULL) {
2391
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n", untrustedDerParam.fullName);
2392
+ return(-1);
2393
+ } else if(xmlSecAppCryptoSimpleKeysMngrCertLoad(gKeysMngr,
2394
+ value->strValue, xmlSecKeyDataFormatDer,
2395
+ xmlSecKeyDataTypeNone) < 0) {
2396
+ fprintf(stderr, "Error: failed to load untrusted cert from \"%s\".\n",
2397
+ value->strValue);
2398
+ return(-1);
2399
+ }
2400
+ }
2401
+
2402
+ #endif /* XMLSEC_NO_X509 */
2403
+
2404
+ return(0);
2405
+ }
2406
+
2407
+ static int intialized = 0;
2408
+
2409
+ #ifndef XMLSEC_NO_XSLT
2410
+ static xsltSecurityPrefsPtr xsltSecPrefs = NULL;
2411
+ #endif /* XMLSEC_NO_XSLT */
2412
+
2413
+ static int
2414
+ xmlSecAppInit(void) {
2415
+ if(intialized != 0) {
2416
+ return(0);
2417
+ }
2418
+ intialized = 1;
2419
+
2420
+ /* Init libxml */
2421
+ xmlInitParser();
2422
+ LIBXML_TEST_VERSION
2423
+ xmlTreeIndentString = "\t";
2424
+ #ifndef XMLSEC_NO_XSLT
2425
+ xmlIndentTreeOutput = 1;
2426
+ #endif /* XMLSEC_NO_XSLT */
2427
+
2428
+
2429
+ /* Init libxslt */
2430
+ #ifndef XMLSEC_NO_XSLT
2431
+ /* disable everything */
2432
+ xsltSecPrefs = xsltNewSecurityPrefs();
2433
+ xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityForbid);
2434
+ xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_FILE, xsltSecurityForbid);
2435
+ xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_CREATE_DIRECTORY, xsltSecurityForbid);
2436
+ xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_NETWORK, xsltSecurityForbid);
2437
+ xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_NETWORK, xsltSecurityForbid);
2438
+ xsltSetDefaultSecurityPrefs(xsltSecPrefs);
2439
+ #endif /* XMLSEC_NO_XSLT */
2440
+
2441
+ /* Init xmlsec */
2442
+ if(xmlSecInit() < 0) {
2443
+ fprintf(stderr, "Error: xmlsec intialization failed.\n");
2444
+ return(-1);
2445
+ }
2446
+ if(xmlSecCheckVersion() != 1) {
2447
+ fprintf(stderr, "Error: loaded xmlsec library version is not compatible.\n");
2448
+ return(-1);
2449
+ }
2450
+
2451
+ #if !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING)
2452
+ if(xmlSecCryptoDLLoadLibrary(BAD_CAST xmlsec_crypto) < 0) {
2453
+ fprintf(stderr, "Error: unable to load xmlsec-%s library. Make sure that you have\n"
2454
+ "this it installed, check shared libraries path (LD_LIBRARY_PATH)\n"
2455
+ "envornment variable or use \"--crypto\" option to specify different\n"
2456
+ "crypto engine.\n", xmlsec_crypto);
2457
+ return(-1);
2458
+ }
2459
+ #endif /* !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) */
2460
+
2461
+ /* Init Crypto */
2462
+ if(xmlSecAppCryptoInit(xmlSecAppCmdLineParamGetString(&cryptoConfigParam)) < 0) {
2463
+ fprintf(stderr, "Error: xmlsec crypto intialization failed.\n");
2464
+ return(-1);
2465
+ }
2466
+ return(0);
2467
+ }
2468
+
2469
+ static void
2470
+ xmlSecAppShutdown(void) {
2471
+ if(intialized == 0) {
2472
+ return;
2473
+ }
2474
+
2475
+ /* Shutdown Crypto */
2476
+ if(xmlSecAppCryptoShutdown() < 0) {
2477
+ fprintf(stderr, "Error: xmlsec crypto shutdown failed.\n");
2478
+ }
2479
+
2480
+ /* Shutdown xmlsec */
2481
+ if(xmlSecShutdown() < 0) {
2482
+ fprintf(stderr, "Error: xmlsec shutdown failed.\n");
2483
+ }
2484
+
2485
+ /* Shutdown libxslt/libxml */
2486
+ #ifndef XMLSEC_NO_XSLT
2487
+ xsltFreeSecurityPrefs(xsltSecPrefs);
2488
+ xsltCleanupGlobals();
2489
+ #endif /* XMLSEC_NO_XSLT */
2490
+ xmlCleanupParser();
2491
+ }
2492
+
2493
+ static xmlSecAppXmlDataPtr
2494
+ xmlSecAppXmlDataCreate(const char* filename, const xmlChar* defStartNodeName, const xmlChar* defStartNodeNs) {
2495
+ xmlSecAppCmdLineValuePtr value;
2496
+ xmlSecAppXmlDataPtr data;
2497
+ xmlNodePtr cur = NULL;
2498
+
2499
+ if(filename == NULL) {
2500
+ fprintf(stderr, "Error: xml filename is null\n");
2501
+ return(NULL);
2502
+ }
2503
+
2504
+ /* create object */
2505
+ data = (xmlSecAppXmlDataPtr) xmlMalloc(sizeof(xmlSecAppXmlData));
2506
+ if(data == NULL) {
2507
+ fprintf(stderr, "Error: failed to create xml data\n");
2508
+ return(NULL);
2509
+ }
2510
+ memset(data, 0, sizeof(xmlSecAppXmlData));
2511
+
2512
+ /* parse doc */
2513
+ data->doc = xmlSecParseFile(filename);
2514
+ if(data->doc == NULL) {
2515
+ fprintf(stderr, "Error: failed to parse xml file \"%s\"\n",
2516
+ filename);
2517
+ xmlSecAppXmlDataDestroy(data);
2518
+ return(NULL);
2519
+ }
2520
+
2521
+ /* load dtd and set default attrs and ids */
2522
+ if(xmlSecAppCmdLineParamGetString(&dtdFileParam) != NULL) {
2523
+ xmlValidCtxt ctx;
2524
+
2525
+ data->dtd = xmlParseDTD(NULL, BAD_CAST xmlSecAppCmdLineParamGetString(&dtdFileParam));
2526
+ if(data->dtd == NULL) {
2527
+ fprintf(stderr, "Error: failed to parse dtd file \"%s\"\n",
2528
+ xmlSecAppCmdLineParamGetString(&dtdFileParam));
2529
+ xmlSecAppXmlDataDestroy(data);
2530
+ return(NULL);
2531
+ }
2532
+
2533
+ memset(&ctx, 0, sizeof(ctx));
2534
+ /* we don't care is doc actually valid or not */
2535
+ xmlValidateDtd(&ctx, data->doc, data->dtd);
2536
+ }
2537
+
2538
+ /* set ID attributes from command line */
2539
+ for(value = idAttrParam.value; value != NULL; value = value->next) {
2540
+ if(value->strValue == NULL) {
2541
+ fprintf(stderr, "Error: invalid value for option \"%s\".\n",
2542
+ idAttrParam.fullName);
2543
+ xmlSecAppXmlDataDestroy(data);
2544
+ return(NULL);
2545
+ } else {
2546
+ xmlChar* attrName = (value->paramNameValue != NULL) ? BAD_CAST value->paramNameValue : BAD_CAST "id";
2547
+ xmlChar* nodeName;
2548
+ xmlChar* nsHref;
2549
+ xmlChar* buf;
2550
+
2551
+ buf = xmlStrdup(BAD_CAST value->strValue);
2552
+ if(buf == NULL) {
2553
+ fprintf(stderr, "Error: failed to duplicate string \"%s\"\n", value->strValue);
2554
+ xmlSecAppXmlDataDestroy(data);
2555
+ return(NULL);
2556
+ }
2557
+ nodeName = (xmlChar*)strrchr((char*)buf, ':');
2558
+ if(nodeName != NULL) {
2559
+ (*(nodeName++)) = '\0';
2560
+ nsHref = buf;
2561
+ } else {
2562
+ nodeName = buf;
2563
+ nsHref = NULL;
2564
+ }
2565
+
2566
+ /* process children first because it does not matter much but does simplify code */
2567
+ cur = xmlSecGetNextElementNode(data->doc->children);
2568
+ while(cur != NULL) {
2569
+ if(xmlSecAppAddIDAttr(cur, attrName, nodeName, nsHref) < 0) {
2570
+ fprintf(stderr, "Error: failed to add ID attribute \"%s\" for node \"%s\"\n", attrName, value->strValue);
2571
+ xmlFree(buf);
2572
+ xmlSecAppXmlDataDestroy(data);
2573
+ return(NULL);
2574
+ }
2575
+ cur = xmlSecGetNextElementNode(cur->next);
2576
+ }
2577
+
2578
+ xmlFree(buf);
2579
+ }
2580
+ }
2581
+
2582
+
2583
+ /* now find the start node */
2584
+ if(xmlSecAppCmdLineParamGetString(&nodeIdParam) != NULL) {
2585
+ xmlAttrPtr attr;
2586
+
2587
+ attr = xmlGetID(data->doc, BAD_CAST xmlSecAppCmdLineParamGetString(&nodeIdParam));
2588
+ if(attr == NULL) {
2589
+ fprintf(stderr, "Error: failed to find node with id=\"%s\"\n",
2590
+ xmlSecAppCmdLineParamGetString(&nodeIdParam));
2591
+ xmlSecAppXmlDataDestroy(data);
2592
+ return(NULL);
2593
+ }
2594
+ cur = attr->parent;
2595
+ } else if(xmlSecAppCmdLineParamGetString(&nodeNameParam) != NULL) {
2596
+ xmlChar* buf;
2597
+ xmlChar* name;
2598
+ xmlChar* ns;
2599
+
2600
+ buf = xmlStrdup(BAD_CAST xmlSecAppCmdLineParamGetString(&nodeNameParam));
2601
+ if(buf == NULL) {
2602
+ fprintf(stderr, "Error: failed to duplicate node \"%s\"\n",
2603
+ xmlSecAppCmdLineParamGetString(&nodeNameParam));
2604
+ xmlSecAppXmlDataDestroy(data);
2605
+ return(NULL);
2606
+ }
2607
+ name = (xmlChar*)strrchr((char*)buf, ':');
2608
+ if(name != NULL) {
2609
+ (*(name++)) = '\0';
2610
+ ns = buf;
2611
+ } else {
2612
+ name = buf;
2613
+ ns = NULL;
2614
+ }
2615
+
2616
+ cur = xmlSecFindNode(xmlDocGetRootElement(data->doc), name, ns);
2617
+ if(cur == NULL) {
2618
+ fprintf(stderr, "Error: failed to find node with name=\"%s\"\n",
2619
+ name);
2620
+ xmlFree(buf);
2621
+ xmlSecAppXmlDataDestroy(data);
2622
+ return(NULL);
2623
+ }
2624
+ xmlFree(buf);
2625
+ } else if(xmlSecAppCmdLineParamGetString(&nodeXPathParam) != NULL) {
2626
+ xmlXPathContextPtr ctx = NULL;
2627
+ xmlXPathObjectPtr obj = NULL;
2628
+ xmlNodePtr rootNode;
2629
+ xmlNsPtr ns;
2630
+ int ret;
2631
+
2632
+ rootNode = xmlDocGetRootElement(data->doc);
2633
+ if(rootNode == NULL) {
2634
+ fprintf(stderr, "Error: failed to find root node\n");
2635
+ xmlSecAppXmlDataDestroy(data);
2636
+ return(NULL);
2637
+ }
2638
+
2639
+ ctx = xmlXPathNewContext(data->doc);
2640
+ if(ctx == NULL) {
2641
+ fprintf(stderr, "Error: failed to create xpath context\n");
2642
+ xmlSecAppXmlDataDestroy(data);
2643
+ return(NULL);
2644
+ }
2645
+
2646
+ /* register namespaces from the root node */
2647
+ for(ns = rootNode->nsDef; ns != NULL; ns = ns->next) {
2648
+ if(ns->prefix != NULL){
2649
+ ret = xmlXPathRegisterNs(ctx, ns->prefix, ns->href);
2650
+ if(ret != 0) {
2651
+ fprintf(stderr, "Error: failed to register namespace \"%s\"\n", ns->prefix);
2652
+ xmlXPathFreeContext(ctx);
2653
+ xmlSecAppXmlDataDestroy(data);
2654
+ return(NULL);
2655
+ }
2656
+ }
2657
+ }
2658
+
2659
+ obj = xmlXPathEval(BAD_CAST xmlSecAppCmdLineParamGetString(&nodeXPathParam), ctx);
2660
+ if(obj == NULL) {
2661
+ fprintf(stderr, "Error: failed to evaluate xpath expression\n");
2662
+ xmlXPathFreeContext(ctx);
2663
+ xmlSecAppXmlDataDestroy(data);
2664
+ return(NULL);
2665
+ }
2666
+
2667
+ if((obj->nodesetval == NULL) || (obj->nodesetval->nodeNr != 1)) {
2668
+ fprintf(stderr, "Error: xpath expression evaluation does not return a single node as expected\n");
2669
+ xmlXPathFreeObject(obj);
2670
+ xmlXPathFreeContext(ctx);
2671
+ xmlSecAppXmlDataDestroy(data);
2672
+ return(NULL);
2673
+ }
2674
+
2675
+ cur = obj->nodesetval->nodeTab[0];
2676
+ xmlXPathFreeContext(ctx);
2677
+ xmlXPathFreeObject(obj);
2678
+
2679
+ } else {
2680
+ cur = xmlDocGetRootElement(data->doc);
2681
+ if(cur == NULL) {
2682
+ fprintf(stderr, "Error: failed to get root element\n");
2683
+ xmlSecAppXmlDataDestroy(data);
2684
+ return(NULL);
2685
+ }
2686
+ }
2687
+
2688
+ if(defStartNodeName != NULL) {
2689
+ data->startNode = xmlSecFindNode(cur, defStartNodeName, defStartNodeNs);
2690
+ if(data->startNode == NULL) {
2691
+ fprintf(stderr, "Error: failed to find default node with name=\"%s\"\n",
2692
+ defStartNodeName);
2693
+ xmlSecAppXmlDataDestroy(data);
2694
+ return(NULL);
2695
+ }
2696
+ } else {
2697
+ data->startNode = cur;
2698
+ }
2699
+
2700
+ return(data);
2701
+ }
2702
+
2703
+ static void
2704
+ xmlSecAppXmlDataDestroy(xmlSecAppXmlDataPtr data) {
2705
+ if(data == NULL) {
2706
+ fprintf(stderr, "Error: xml data is null\n");
2707
+ return;
2708
+ }
2709
+ if(data->dtd != NULL) {
2710
+ xmlFreeDtd(data->dtd);
2711
+ }
2712
+ if(data->doc != NULL) {
2713
+ xmlFreeDoc(data->doc);
2714
+ }
2715
+ memset(data, 0, sizeof(xmlSecAppXmlData));
2716
+ xmlFree(data);
2717
+ }
2718
+
2719
+ static xmlSecAppCommand
2720
+ xmlSecAppParseCommand(const char* cmd, xmlSecAppCmdLineParamTopic* cmdLineTopics, xmlSecAppCommand* subCommand) {
2721
+ if(subCommand != NULL) {
2722
+ (*subCommand) = xmlSecAppCommandUnknown;
2723
+ }
2724
+
2725
+ if((cmd == NULL) || (cmdLineTopics == NULL)) {
2726
+ return(xmlSecAppCommandUnknown);
2727
+ } else
2728
+
2729
+ if((strcmp(cmd, "help") == 0) || (strcmp(cmd, "--help") == 0)) {
2730
+ (*cmdLineTopics) = 0;
2731
+ return(xmlSecAppCommandHelp);
2732
+ } else
2733
+
2734
+ if((strcmp(cmd, "help-all") == 0) || (strcmp(cmd, "--help-all") == 0)) {
2735
+ (*cmdLineTopics) = xmlSecAppCmdLineTopicAll;
2736
+ return(xmlSecAppCommandHelp);
2737
+ } else
2738
+
2739
+ if((strncmp(cmd, "help-", 5) == 0) || (strncmp(cmd, "--help-", 7) == 0)) {
2740
+ cmd = (cmd[0] == '-') ? cmd + 7 : cmd + 5;
2741
+ if(subCommand) {
2742
+ (*subCommand) = xmlSecAppParseCommand(cmd, cmdLineTopics, NULL);
2743
+ } else {
2744
+ (*cmdLineTopics) = 0;
2745
+ }
2746
+ return(xmlSecAppCommandHelp);
2747
+ } else
2748
+
2749
+ if((strcmp(cmd, "version") == 0) || (strcmp(cmd, "--version") == 0)) {
2750
+ (*cmdLineTopics) = xmlSecAppCmdLineTopicVersion;
2751
+ return(xmlSecAppCommandVersion);
2752
+ } else
2753
+
2754
+ if((strcmp(cmd, "list-key-data") == 0) || (strcmp(cmd, "--list-key-data") == 0)) {
2755
+ (*cmdLineTopics) = xmlSecAppCmdLineTopicCryptoConfig;
2756
+ return(xmlSecAppCommandListKeyData);
2757
+ } else
2758
+
2759
+ if((strcmp(cmd, "check-key-data") == 0) || (strcmp(cmd, "--check-key-data") == 0)) {
2760
+ (*cmdLineTopics) = xmlSecAppCmdLineTopicCryptoConfig;
2761
+ return(xmlSecAppCommandCheckKeyData);
2762
+ } else
2763
+
2764
+ if((strcmp(cmd, "list-transforms") == 0) || (strcmp(cmd, "--list-transforms") == 0)) {
2765
+ (*cmdLineTopics) = xmlSecAppCmdLineTopicCryptoConfig;
2766
+ return(xmlSecAppCommandListTransforms);
2767
+ } else
2768
+
2769
+ if((strcmp(cmd, "check-transforms") == 0) || (strcmp(cmd, "--check-transforms") == 0)) {
2770
+ (*cmdLineTopics) = xmlSecAppCmdLineTopicCryptoConfig;
2771
+ return(xmlSecAppCommandCheckTransforms);
2772
+ } else
2773
+
2774
+ if((strcmp(cmd, "keys") == 0) || (strcmp(cmd, "--keys") == 0)) {
2775
+ (*cmdLineTopics) =
2776
+ xmlSecAppCmdLineTopicGeneral |
2777
+ xmlSecAppCmdLineTopicCryptoConfig |
2778
+ xmlSecAppCmdLineTopicKeysMngr |
2779
+ xmlSecAppCmdLineTopicX509Certs;
2780
+ return(xmlSecAppCommandKeys);
2781
+ } else
2782
+
2783
+ #ifndef XMLSEC_NO_XMLDSIG
2784
+ if((strcmp(cmd, "sign") == 0) || (strcmp(cmd, "--sign") == 0)) {
2785
+ (*cmdLineTopics) =
2786
+ xmlSecAppCmdLineTopicGeneral |
2787
+ xmlSecAppCmdLineTopicCryptoConfig |
2788
+ xmlSecAppCmdLineTopicDSigCommon |
2789
+ xmlSecAppCmdLineTopicDSigSign |
2790
+ xmlSecAppCmdLineTopicKeysMngr |
2791
+ xmlSecAppCmdLineTopicX509Certs;
2792
+ return(xmlSecAppCommandSign);
2793
+ } else
2794
+
2795
+ if((strcmp(cmd, "verify") == 0) || (strcmp(cmd, "--verify") == 0)) {
2796
+ (*cmdLineTopics) =
2797
+ xmlSecAppCmdLineTopicGeneral |
2798
+ xmlSecAppCmdLineTopicCryptoConfig |
2799
+ xmlSecAppCmdLineTopicDSigCommon |
2800
+ xmlSecAppCmdLineTopicDSigVerify |
2801
+ xmlSecAppCmdLineTopicKeysMngr |
2802
+ xmlSecAppCmdLineTopicX509Certs;
2803
+ return(xmlSecAppCommandVerify);
2804
+ } else
2805
+ #ifndef XMLSEC_NO_TMPL_TEST
2806
+ if((strcmp(cmd, "sign-tmpl") == 0) || (strcmp(cmd, "--sign-tmpl") == 0)) {
2807
+ (*cmdLineTopics) =
2808
+ xmlSecAppCmdLineTopicGeneral |
2809
+ xmlSecAppCmdLineTopicCryptoConfig |
2810
+ xmlSecAppCmdLineTopicDSigCommon |
2811
+ xmlSecAppCmdLineTopicDSigSign |
2812
+ xmlSecAppCmdLineTopicKeysMngr |
2813
+ xmlSecAppCmdLineTopicX509Certs;
2814
+ return(xmlSecAppCommandSignTmpl);
2815
+ } else
2816
+ #endif /* XMLSEC_NO_TMPL_TEST */
2817
+
2818
+ #endif /* XMLSEC_NO_XMLDSIG */
2819
+
2820
+ #ifndef XMLSEC_NO_XMLENC
2821
+ if((strcmp(cmd, "encrypt") == 0) || (strcmp(cmd, "--encrypt") == 0)) {
2822
+ (*cmdLineTopics) =
2823
+ xmlSecAppCmdLineTopicGeneral |
2824
+ xmlSecAppCmdLineTopicCryptoConfig |
2825
+ xmlSecAppCmdLineTopicEncCommon |
2826
+ xmlSecAppCmdLineTopicEncEncrypt |
2827
+ xmlSecAppCmdLineTopicKeysMngr |
2828
+ xmlSecAppCmdLineTopicX509Certs;
2829
+ return(xmlSecAppCommandEncrypt);
2830
+ } else
2831
+
2832
+ if((strcmp(cmd, "decrypt") == 0) || (strcmp(cmd, "--decrypt") == 0)) {
2833
+ (*cmdLineTopics) =
2834
+ xmlSecAppCmdLineTopicGeneral |
2835
+ xmlSecAppCmdLineTopicCryptoConfig |
2836
+ xmlSecAppCmdLineTopicEncCommon |
2837
+ xmlSecAppCmdLineTopicEncDecrypt |
2838
+ xmlSecAppCmdLineTopicKeysMngr |
2839
+ xmlSecAppCmdLineTopicX509Certs;
2840
+ return(xmlSecAppCommandDecrypt);
2841
+ } else
2842
+
2843
+ #ifndef XMLSEC_NO_TMPL_TEST
2844
+ if((strcmp(cmd, "encrypt-tmpl") == 0) || (strcmp(cmd, "--encrypt-tmpl") == 0)) {
2845
+ (*cmdLineTopics) =
2846
+ xmlSecAppCmdLineTopicGeneral |
2847
+ xmlSecAppCmdLineTopicCryptoConfig |
2848
+ xmlSecAppCmdLineTopicEncCommon |
2849
+ xmlSecAppCmdLineTopicEncEncrypt |
2850
+ xmlSecAppCmdLineTopicKeysMngr |
2851
+ xmlSecAppCmdLineTopicX509Certs;
2852
+ return(xmlSecAppCommandEncryptTmpl);
2853
+ } else
2854
+ #endif /* XMLSEC_NO_TMPL_TEST */
2855
+ #endif /* XMLSEC_NO_XMLENC */
2856
+
2857
+ #ifndef XMLSEC_NO_XKMS
2858
+ if(strcmp(cmd, "--xkms-server-request") == 0) {
2859
+ (*cmdLineTopics) =
2860
+ xmlSecAppCmdLineTopicGeneral |
2861
+ xmlSecAppCmdLineTopicCryptoConfig |
2862
+ xmlSecAppCmdLineTopicXkmsCommon |
2863
+ xmlSecAppCmdLineTopicKeysMngr |
2864
+ xmlSecAppCmdLineTopicX509Certs;
2865
+ return(xmlSecAppCommandXkmsServerRequest);
2866
+ } else
2867
+ #endif /* XMLSEC_NO_XKMS */
2868
+
2869
+ if(1) {
2870
+ (*cmdLineTopics) = 0;
2871
+ return(xmlSecAppCommandUnknown);
2872
+ }
2873
+ }
2874
+
2875
+ static void
2876
+ xmlSecAppPrintHelp(xmlSecAppCommand command, xmlSecAppCmdLineParamTopic topics) {
2877
+ switch(command) {
2878
+ case xmlSecAppCommandUnknown:
2879
+ case xmlSecAppCommandHelp:
2880
+ fprintf(stdout, "%s%s\n", helpCommands1, helpCommands2);
2881
+ break;
2882
+ case xmlSecAppCommandVersion:
2883
+ fprintf(stdout, "%s\n", helpVersion);
2884
+ break;
2885
+ case xmlSecAppCommandListKeyData:
2886
+ fprintf(stdout, "%s\n", helpListKeyData);
2887
+ break;
2888
+ case xmlSecAppCommandCheckKeyData:
2889
+ fprintf(stdout, "%s\n", helpCheckKeyData);
2890
+ break;
2891
+ case xmlSecAppCommandListTransforms:
2892
+ fprintf(stdout, "%s\n", helpListTransforms);
2893
+ break;
2894
+ case xmlSecAppCommandCheckTransforms:
2895
+ fprintf(stdout, "%s\n", helpCheckTransforms);
2896
+ break;
2897
+ case xmlSecAppCommandKeys:
2898
+ fprintf(stdout, "%s\n", helpKeys);
2899
+ break;
2900
+ case xmlSecAppCommandSign:
2901
+ fprintf(stdout, "%s\n", helpSign);
2902
+ break;
2903
+ case xmlSecAppCommandVerify:
2904
+ fprintf(stdout, "%s\n", helpVerify);
2905
+ break;
2906
+ case xmlSecAppCommandEncrypt:
2907
+ fprintf(stdout, "%s\n", helpEncrypt);
2908
+ break;
2909
+ case xmlSecAppCommandDecrypt:
2910
+ fprintf(stdout, "%s\n", helpDecrypt);
2911
+ break;
2912
+ case xmlSecAppCommandSignTmpl:
2913
+ fprintf(stdout, "%s\n", helpSignTmpl);
2914
+ break;
2915
+ case xmlSecAppCommandEncryptTmpl:
2916
+ fprintf(stdout, "%s\n", helpEncryptTmpl);
2917
+ break;
2918
+ case xmlSecAppCommandXkmsServerRequest:
2919
+ fprintf(stdout, "%s\n", helpXkmsServerRequest);
2920
+ break;
2921
+ }
2922
+ if(topics != 0) {
2923
+ fprintf(stdout, "Options:\n");
2924
+ xmlSecAppCmdLineParamsListPrint(parameters, topics, stdout);
2925
+ fprintf(stdout, "\n");
2926
+ }
2927
+ fprintf(stdout, "\n%s\n", bugs);
2928
+ fprintf(stdout, "%s\n", copyright);
2929
+ }
2930
+
2931
+ static xmlSecTransformUriType
2932
+ xmlSecAppGetUriType(const char* string) {
2933
+ xmlSecTransformUriType type = xmlSecTransformUriTypeNone;
2934
+
2935
+ while((string != NULL) && (string[0] != '\0')) {
2936
+ if(strcmp(string, "empty") == 0) {
2937
+ type |= xmlSecTransformUriTypeEmpty;
2938
+ } else if(strcmp(string, "same-doc") == 0) {
2939
+ type |= xmlSecTransformUriTypeSameDocument;
2940
+ } else if(strcmp(string, "local") == 0) {
2941
+ type |= xmlSecTransformUriTypeLocal;
2942
+ } else if(strcmp(string, "remote") == 0) {
2943
+ type |= xmlSecTransformUriTypeRemote;
2944
+ } else {
2945
+ fprintf(stderr, "Error: invalid uri type: \"%s\"\n", string);
2946
+ return(xmlSecTransformUriTypeNone);
2947
+ }
2948
+ string += strlen(string) + 1;
2949
+ }
2950
+ return(type);
2951
+ }
2952
+
2953
+ static FILE*
2954
+ xmlSecAppOpenFile(const char* filename) {
2955
+ FILE* file;
2956
+
2957
+ if((filename == NULL) || (strcmp(filename, "-") == 0)) {
2958
+ return(stdout);
2959
+ }
2960
+ file = fopen(filename, "wb");
2961
+ if(file == NULL) {
2962
+ fprintf(stderr, "Error: failed to open file \"%s\"\n", filename);
2963
+ return(NULL);
2964
+ }
2965
+
2966
+ return(file);
2967
+ }
2968
+
2969
+ static void
2970
+ xmlSecAppCloseFile(FILE* file) {
2971
+ if((file == NULL) || (file == stdout) || (file == stderr)) {
2972
+ return;
2973
+ }
2974
+
2975
+ fclose(file);
2976
+ }
2977
+
2978
+ static int
2979
+ xmlSecAppWriteResult(xmlDocPtr doc, xmlSecBufferPtr buffer) {
2980
+ FILE* f;
2981
+
2982
+ f = xmlSecAppOpenFile(xmlSecAppCmdLineParamGetString(&outputParam));
2983
+ if(f == NULL) {
2984
+ return(-1);
2985
+ }
2986
+ if(doc != NULL) {
2987
+ xmlDocDump(f, doc);
2988
+ } else if((buffer != NULL) && (xmlSecBufferGetData(buffer) != NULL)) {
2989
+ fwrite(xmlSecBufferGetData(buffer), xmlSecBufferGetSize(buffer), 1, f);
2990
+ } else {
2991
+ fprintf(stderr, "Error: both result doc and result buffer are null\n");
2992
+ xmlSecAppCloseFile(f);
2993
+ return(-1);
2994
+ }
2995
+ xmlSecAppCloseFile(f);
2996
+ return(0);
2997
+ }
2998
+
2999
+ static int
3000
+ xmlSecAppAddIDAttr(xmlNodePtr node, const xmlChar* attrName, const xmlChar* nodeName, const xmlChar* nsHref) {
3001
+ xmlAttrPtr attr, tmpAttr;
3002
+ xmlNodePtr cur;
3003
+ xmlChar* id;
3004
+
3005
+ if((node == NULL) || (attrName == NULL) || (nodeName == NULL)) {
3006
+ return(-1);
3007
+ }
3008
+
3009
+ /* process children first because it does not matter much but does simplify code */
3010
+ cur = xmlSecGetNextElementNode(node->children);
3011
+ while(cur != NULL) {
3012
+ if(xmlSecAppAddIDAttr(cur, attrName, nodeName, nsHref) < 0) {
3013
+ return(-1);
3014
+ }
3015
+ cur = xmlSecGetNextElementNode(cur->next);
3016
+ }
3017
+
3018
+ /* node name must match */
3019
+ if(!xmlStrEqual(node->name, nodeName)) {
3020
+ return(0);
3021
+ }
3022
+
3023
+ /* if nsHref is set then it also should match */
3024
+ if((nsHref != NULL) && (node->ns != NULL) && (!xmlStrEqual(nsHref, node->ns->href))) {
3025
+ return(0);
3026
+ }
3027
+
3028
+ /* the attribute with name equal to attrName should exist */
3029
+ for(attr = node->properties; attr != NULL; attr = attr->next) {
3030
+ if(xmlStrEqual(attr->name, attrName)) {
3031
+ break;
3032
+ }
3033
+ }
3034
+ if(attr == NULL) {
3035
+ return(0);
3036
+ }
3037
+
3038
+ /* and this attr should have a value */
3039
+ id = xmlNodeListGetString(node->doc, attr->children, 1);
3040
+ if(id == NULL) {
3041
+ return(0);
3042
+ }
3043
+
3044
+ /* check that we don't have same ID already */
3045
+ tmpAttr = xmlGetID(node->doc, id);
3046
+ if(tmpAttr == NULL) {
3047
+ xmlAddID(NULL, node->doc, id, attr);
3048
+ } else if(tmpAttr != attr) {
3049
+ fprintf(stderr, "Error: duplicate ID attribute \"%s\"\n", id);
3050
+ xmlFree(id);
3051
+ return(-1);
3052
+ }
3053
+ xmlFree(id);
3054
+ return(0);
3055
+ }
3056
+
3057
+
3058
+