diff options
author | Konrad Lipinski <k.lipinski2@partner.samsung.com> | 2019-06-11 16:25:51 +0200 |
---|---|---|
committer | Konrad Lipinski <k.lipinski2@samsung.com> | 2019-08-01 14:37:53 +0200 |
commit | cc6febdd37186eeea33bcbce89d79f661ee0009f (patch) | |
tree | 100542f7f8fd3b3c9548150362efe35adde47551 | |
parent | c40fbfa8503e7763ef630496852f4d6b5e63b58c (diff) | |
download | xmlsec1-cc6febdd37186eeea33bcbce89d79f661ee0009f.tar.gz xmlsec1-cc6febdd37186eeea33bcbce89d79f661ee0009f.tar.bz2 xmlsec1-cc6febdd37186eeea33bcbce89d79f661ee0009f.zip |
Import upstream commit c4d0493d545b99194eea1b2b058930d5a9bb91b1 (1.2.28)
Change-Id: I10f71567cb140be223923e1cd0b5895e366ac23e
964 files changed, 84094 insertions, 76286 deletions
@@ -4,5 +4,6 @@ Windows port: Igor Zlatkovic <igor@stud.fh-frankfurt.de> Debian port: John Belmonte <jvb@prairienet.org> xmlsec-nss: Tej Arora <tej@netscape.com>, AOL Inc. xmlsec-mscrypto: Wouter Ketting <wsh@xs4all.nl>, Cordys R&D BV +xmlsec-mscng: Miklos Vajna <vmiklos@vmiklos.hu> GOST support: Dmitry Belyavsky <beldmit@cryptocom.ru>, Cryptocom LTD (http://www.cryptocom.ru) @@ -1,3 +1,40 @@ +The changelog file is obsolete, please view the commits log on github + +https://github.com/lsh123/xmlsec/commits/master + + +2016-10-15 Aleksey Sanin <aleksey@aleksey.com> + * 1.2.23 release + +2016-10-14 Aleksey Sanin <aleksey@aleksey.com> + * Fixed gcrypto RSA/DSA keys params ordering + +2016-10-12 Aleksey Sanin <aleksey@aleksey.com> + * Better X509Data templates + +2016-10-07 Aleksey Sanin <aleksey@aleksey.com> + * Fixed memory leak caused by xmlGetProp (patch from Dafan Zhai) + * Fixed KW transforms (overlapping buffer error) for OpenSSL 1.1.0 + * Fixed pkg-config detection + +2016-09-27 Aleksey Sanin <aleksey@aleksey.com> + * Added initial support OpenSSL 1.1.0 (patch from Andrzej Siewior) + +2016-09-19 Aleksey Sanin <aleksey@aleksey.com> + * Fixed signing with RSA SHA2 via mscrypto (patch from PepaRokos) + +2016-07-08 Aleksey Sanin <aleksey@aleksey.com> + * Fixed mscrypto undeclared XMLSEC_DEFAULT_CRYPTO (patch from vmiklos) + +2016-05-31 Aleksey Sanin <aleksey@aleksey.com> + * Fixed mismatched conditional for XMLSEC_NO_ECDSA (patch from Eric Sproul) + +2016-05-20 Aleksey Sanin <aleksey@aleksey.com> + * Fixed openssl cert depth verification param usage (patch from R-Tur) + +2016-04-22 Aleksey Sanin <aleksey@aleksey.com> + * Fixed stdin/stdout in xmlsec1 app + 2016-04-20 Aleksey Sanin <aleksey@aleksey.com> * Restored SOAP support for Lasso * 1.2.22 release @@ -89,6 +89,33 @@ be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from him. +xmlsec-mscng library +------------------------------------------------------------------------------ + +Copyright (C) 2018 Aleksey Sanin. All Rights Reserved. +Copyright (C) 2018 Miklos Vajna. All Rights Reserved. + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is fur- +nished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- +NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +ALEKSEY SANIN BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Aleksey Sanin shall not +be used in advertising or otherwise to promote the sale, use or other deal- +ings in this Software without prior written authorization from him. References ------------------------------------------------------------------------------ @@ -95,17 +95,17 @@ Igor Zlatkovic get an exception for the send before commit rule. - Errors reporting (XMLSEC_ERRORS_R_XMLSEC_FAILED vs. XMLSEC_ERRORS_R_CRYPTO_FAILED) The correct usage rule is: if the failed function starts with "xmlSec" then use - XMLSEC_ERRORS_R_XMLSEC_FAILED - else if it is xmlMalloc/xmlFree/xmlStrdup/etc then use - XMLSEC_ERRORS_R_MALLOC_FAILED + xmlSecInternalError() aka XMLSEC_ERRORS_R_XMLSEC_FAILED + else if it is xmlMalloc/xmlFree/etc then use + xmlSecMallocError() aka XMLSEC_ERRORS_R_MALLOC_FAILED else if the function starts with "xml" or "xslt" (i.e. it comes from libxml or libxslt) then use - XMLSEC_ERRORS_R_XML_FAILED + xmlSecXmlError/xmlSecXmlParserError aka XMLSEC_ERRORS_R_XML_FAILED else if it is related to IO (fopen, fread, fwrite, etc.) then use XMLSEC_ERRORS_R_IO_FAILED else if the function could be used only from xmlsec-crypto (i.e. it is crypto engine related) then use - XMLSEC_ERRORS_R_CRYPTO_FAILED + xmlSecOpenSSLError/... aka XMLSEC_ERRORS_R_CRYPTO_FAILED else if there is another reason (invalid data, invalid size, etc.) corresponding error reason should be used else diff --git a/Makefile.am b/Makefile.am index 3453c011..c23370ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,16 @@ NULL = SAFE_VERSION = @XMLSEC_VERSION_SAFE@ -SUBDIRS = include src apps man docs +SUBDIRS = include src +if XMLSEC_APPS +SUBDIRS += apps +endif +if XMLSEC_MANS +SUBDIRS += man +endif +if XMLSEC_DOCS +SUBDIRS += docs +endif TEST_APP = apps/xmlsec1$(EXEEXT) DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@ @@ -66,8 +75,9 @@ PRECHECK_COMMANDS = \ $(NULL) else PRECHECK_COMMANDS= \ + export LD_LIBRARY_PATH="$(ABS_BUILDDIR)/src/.libs:$$LD_LIBRARY_PATH" ; \ for i in $(XMLSEC_CRYPTO_LIST) ; do \ - export LD_LIBRARY_PATH="$(ABS_BUILDDIR)/src/$$i/.libs:$$LD_LIBRARY_PATH" ; \ + export LTDL_LIBRARY_PATH="$(ABS_BUILDDIR)/src/$$i/.libs:$$LTDL_LIBRARY_PATH" ; \ done && \ cd $(ABS_SRCDIR) \ $(NULL) @@ -89,7 +99,7 @@ check: check-all check-info check-all: $(TEST_APP) for crypto in $(CHECK_CRYPTO_LIST) ; do \ - make check-crypto-$$crypto ; \ + make check-crypto-$$crypto || exit 1 ; \ done check-crypto-%: $(TEST_APP) @@ -4,18 +4,18 @@ XMLSec Library XMLSec library provides C based implementation for major XML Security standards: - * XML Signature Syntax and Processing - http://www.w3.org/TR/xmldsig-core + * XML Signature Syntax and Processing + https://www.w3.org/TR/xmldsig-core * XML Encryption Syntax and Processing - http://www.w3.org/TR/xmlenc-core/ + https://www.w3.org/TR/xmlenc-core/ XMLSec is based on well known LibXML (http://xmlsoft.org), LibXSLT -(http://xmlsoft.org/XSLT) and OpenSSL (http://www.openssl.org) libraries. +(http://xmlsoft.org/XSLT) and OpenSSL (https://www.openssl.org) libraries. XMLSec library documentation is available here: -http://www.aleksey.com/xmlsec/ +https://www.aleksey.com/xmlsec/ This code is released under the MIT Licence see the Copyright file. @@ -1,156 +1 @@ -************************************************* - General -************************************************* - -* Unify password callback (one of parameters: filename) -* Get key usage from certs -* Extend keys manager to return more info when key is found or not found - (what cheks were performed, etc.) - - -************************************************* - Tests status -************************************************* - -------------------------------------------------- -* xmlsec-openssl (April 26, 2010 using OpenSSL 0.9.8g) -------------------------------------------------- - -** Skipped tests due to missing transforms: GOST - -aleksey-xmldsig-01/enveloped-gost - - -------------------------------------------------- -* xmlsec-nss (April 26, 2010 using NSS 3.12.6) -------------------------------------------------- - -** Skipped tests due to missing transforms: RIPEMD160, SHA224, RSA/OAEP, GOST - -aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160 -aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160-64 -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224 -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64 -aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160 -aleksey-xmldsig-01/enveloping-sha224-rsa-sha224 -aleksey-xmldsig-01/enveloped-gost -merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes -merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p -01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1 - -** Failed tests due to no support for CRLs in XML document - -merlin-xmldsig-twenty-three/signature-x509-crt-crl - - -------------------------------------------------- -* xmlsec-mscrypto (May 09, 2010 using Windows XP SP3) -------------------------------------------------- - -** Skipped tests due to missing transforms: RIPEMD160, SHA224 - -aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160 -aleksey-xmldsig-01/enveloping-ripemd160-hmac-ripemd160-64 -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224 -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64 -aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160 -aleksey-xmldsig-01/enveloping-sha224-rsa-sha224 -merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes - -** Failed tests due to no GOST crypto providers on test machine - -aleksey-xmldsig-01/enveloped-gost - -------------------------------------------------- -* xmlsec-gnutls (May 24, 2010 using GnuTLS) -------------------------------------------------- - -** Skipped tests due to missing transforms: RSA PKCS/OAEP, GOST - -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224 -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64 -aleksey-xmldsig-01/enveloping-sha224-rsa-sha224 -merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5 -merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p -aleksey-xmldsig-01/enveloped-gost -phaos-xmldsig-three/signature-rsa-manifest-x509-data-crl - -01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5 -01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5 -01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5 -01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5 -01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1 - -------------------------------------------------- -* xmlsec-gcrypt (May 09, 2010 using GCrypt) -------------------------------------------------- - -** Skipped tests due to missing transforms: DSA, RSA PKCS/OAEP, X509, GOST - -aleksey-xmldsig-01/enveloping-dsa-x509chain -aleksey-xmldsig-01/enveloping-rsa-x509chain -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224 -aleksey-xmldsig-01/enveloping-sha224-hmac-sha224-64 -aleksey-xmldsig-01/enveloping-md5-rsa-md5 -aleksey-xmldsig-01/enveloping-ripemd160-rsa-ripemd160 -aleksey-xmldsig-01/enveloping-sha1-rsa-sha1 -aleksey-xmldsig-01/enveloping-sha224-rsa-sha224 -aleksey-xmldsig-01/enveloping-sha256-rsa-sha256 -aleksey-xmldsig-01/enveloping-sha384-rsa-sha384 -aleksey-xmldsig-01/enveloping-sha512-rsa-sha512 -aleksey-xmldsig-01/enveloping-expired-cert -aleksey-xmldsig-01/x509data-test -aleksey-xmldsig-01/x509data-sn-test - -merlin-xmldsig-twenty-three/signature-keyname -merlin-xmldsig-twenty-three/signature-x509-crt -merlin-xmldsig-twenty-three/signature-x509-sn -merlin-xmldsig-twenty-three/signature-x509-is -merlin-xmldsig-twenty-three/signature-x509-ski -merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt -merlin-xmldsig-twenty-three/signature -merlin-xmlenc-five/encsig-hmac-sha256-rsa-1_5 -merlin-xmlenc-five/encsig-hmac-sha256-rsa-oaep-mgf1p -phaos-xmldsig-three/signature-big -phaos-xmldsig-three/signature-dsa-detached -phaos-xmldsig-three/signature-dsa-enveloped -phaos-xmldsig-three/signature-dsa-enveloping -phaos-xmldsig-three/signature-dsa-manifest -phaos-xmldsig-three/signature-rsa-detached-b64-transform -phaos-xmldsig-three/signature-rsa-detached -phaos-xmldsig-three/signature-rsa-detached-xpath-transform -phaos-xmldsig-three/signature-rsa-detached-xslt-transform-retrieval-method -phaos-xmldsig-three/signature-rsa-detached-xslt-transform -phaos-xmldsig-three/signature-rsa-enveloped -phaos-xmldsig-three/signature-rsa-enveloping -phaos-xmldsig-three/signature-rsa-manifest-x509-data-cert-chain -phaos-xmldsig-three/signature-rsa-manifest-x509-data-cert -phaos-xmldsig-three/signature-rsa-manifest-x509-data-issuer-serial -phaos-xmldsig-three/signature-rsa-manifest-x509-data-ski -phaos-xmldsig-three/signature-rsa-manifest-x509-data-subject-name -phaos-xmldsig-three/signature-rsa-manifest -phaos-xmldsig-three/signature-rsa-xpath-transform-enveloped -aleksey-xmldsig-01/enveloped-gost -merlin-xmldsig-twenty-three/signature-x509-crt-crl -aleksey-xmldsig-01/enveloping-expired-cert -phaos-xmldsig-three/signature-rsa-detached-xslt-transform-bad-retrieval-method -phaos-xmldsig-three/signature-rsa-enveloped-bad-digest-val -phaos-xmldsig-three/signature-rsa-enveloped-bad-sig -phaos-xmldsig-three/signature-rsa-manifest-x509-data-crl - -merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5 -merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p -01-phaos-xmlenc-3/enc-element-3des-kt-rsa1_5 -01-phaos-xmlenc-3/enc-element-3des-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-element-aes128-kt-rsa1_5 -01-phaos-xmlenc-3/enc-element-aes128-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-element-aes192-kt-rsa_oaep_sha1 -01-phaos-xmlenc-3/enc-text-aes192-kt-rsa1_5 -01-phaos-xmlenc-3/enc-content-aes256-kt-rsa1_5 -01-phaos-xmlenc-3/enc-text-aes256-kt-rsa_oaep_sha1 +https://github.com/lsh123/xmlsec/issues diff --git a/apps/cmdline.c b/apps/cmdline.c index f477a4b6..7bf0907e 100644 --- a/apps/cmdline.c +++ b/apps/cmdline.c @@ -84,7 +84,7 @@ xmlSecAppCmdLineParamsListParse(xmlSecAppCmdLineParamPtr* params, assert(params != NULL); assert(argv != NULL); - while((pos < argc) && (argv[pos][0] == '-')) { + while((pos < argc) && (argv[pos][0] == '-') && (strcmp(argv[pos], XMLSEC_STDOUT_FILENAME) != 0)) { param = xmlSecAppCmdLineParamsListFind(params, topics, argv[pos]); if(param == NULL) { fprintf(stderr, "Error: parameter \"%s\" is not supported or the requested\nfeature might have been disabled during compilation.\n", argv[pos]); @@ -101,15 +101,13 @@ xmlSecAppCmdLineParamsListParse(xmlSecAppCmdLineParamPtr* params, /* check that all parameters at the end are filenames */ for(ii = pos; (ii < argc); ++ii) { - if(argv[ii][0] == '-') { + if((argv[ii][0] == '-') && (strcmp(argv[pos], XMLSEC_STDOUT_FILENAME) != 0)) { fprintf(stderr, "Error: filename is expected instead of parameter \"%s\".\n", argv[ii]); return(-1); - } } - - - + + /* done */ return(pos); } @@ -179,8 +177,7 @@ xmlSecAppCmdLineMatchParam(const char* argvParam, const char* paramName, assert(paramName != NULL); if(canHaveNameString != 0) { - int len = strlen(paramName); - + size_t len = strlen(paramName); if((strncmp(argvParam, paramName, len) == 0) && ((argvParam[len] == '\0') || (argvParam[len] == ':'))) { @@ -303,7 +300,11 @@ xmlSecAppCmdLineParamRead(xmlSecAppCmdLineParamPtr param, const char** argv, int return(-1); } value->strValue = argv[++pos]; +#ifdef WIN32 + if(sscanf_s(value->strValue, "%d", &(value->intValue)) != 1) { +#else /* WIN32 */ if(sscanf(value->strValue, "%d", &(value->intValue)) != 1) { +#endif /* WIN32 */ fprintf(stderr, "Error: integer argument \"%s\" is invalid.\n", value->strValue); return(-1); } @@ -333,10 +334,16 @@ xmlSecAppCmdLineTimeParamRead(const char* str, time_t* t) { } memset(&tm, 0, sizeof(tm)); tm.tm_isdst = -1; - + +#ifdef WIN32 + n = sscanf_s(str, "%4d-%2d-%2d%*c%2d:%2d:%2d", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday, + &tm.tm_hour, &tm.tm_min, &tm.tm_sec); +#else /* WIN32 */ n = sscanf(str, "%4d-%2d-%2d%*c%2d:%2d:%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); +#endif /* WIN32 */ if((n != 6) || (tm.tm_year < 1900) || (tm.tm_mon < 1) || (tm.tm_mon > 12) || (tm.tm_mday < 1) || (tm.tm_mday > 31) diff --git a/apps/cmdline.h b/apps/cmdline.h index f47a201d..518faf06 100644 --- a/apps/cmdline.h +++ b/apps/cmdline.h @@ -10,12 +10,12 @@ #ifndef __XMLSEC_APPS_CMDLINE_H__ #define __XMLSEC_APPS_CMDLINE_H__ +#include <time.h> + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include <time.h> - typedef struct _xmlSecAppCmdLineParam xmlSecAppCmdLineParam, *xmlSecAppCmdLineParamPtr; typedef struct _xmlSecAppCmdLineValue xmlSecAppCmdLineValue, @@ -26,6 +26,8 @@ typedef unsigned int xmlSecAppCmdLineParamTopic; #define xmlSecAppCmdLineParamFlagParamNameValue 0x0001 #define xmlSecAppCmdLineParamFlagMultipleValues 0x0002 +#define XMLSEC_STDOUT_FILENAME "-" + typedef enum { xmlSecAppCmdLineParamTypeFlag, xmlSecAppCmdLineParamTypeString, @@ -53,7 +55,7 @@ time_t xmlSecAppCmdLineParamGetTime (xmlSecAppCmdLineParamPt time_t def); int xmlSecAppCmdLineParamsListParse (xmlSecAppCmdLineParamPtr* params, - xmlSecAppCmdLineParamTopic topcis, + xmlSecAppCmdLineParamTopic topics, const char** argv, int argc, int pos); diff --git a/apps/crypto.c b/apps/crypto.c index 1e53bc72..cb23f5b2 100644 --- a/apps/crypto.c +++ b/apps/crypto.c @@ -23,19 +23,11 @@ int xmlSecAppCryptoInit(const char* config) { if(xmlSecCryptoAppInit(config) < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppInit", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoAppInit failed\n"); return(-1); } if(xmlSecCryptoInit() < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoInit", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoInit failed\n"); return(-1); } @@ -45,20 +37,12 @@ xmlSecAppCryptoInit(const char* config) { int xmlSecAppCryptoShutdown(void) { if(xmlSecCryptoShutdown() < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoShutdown", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoShutdown failed\n"); return(-1); } if(xmlSecCryptoAppShutdown() < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppShutdown", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoAppShutdown failed\n"); return(-1); } return(0); @@ -115,24 +99,16 @@ xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(xmlSecKeysMngrPtr mngr, key = xmlSecCryptoAppKeyLoad(files, format, pwd, xmlSecCryptoAppGetDefaultPwdCallback(), (void*)files); if(key == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppKeyLoad", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "uri=%s", - xmlSecErrorsSafeString(files)); + fprintf(stderr, "Error: xmlSecCryptoAppKeyLoad failed: file=%s\n", + xmlSecErrorsSafeString(files)); return(-1); } if(name != NULL) { ret = xmlSecKeySetName(key, BAD_CAST name); - if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeySetName", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "name=%s", - xmlSecErrorsSafeString(name)); + if(ret < 0) { + fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", + xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); return(-1); } @@ -141,13 +117,9 @@ xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(xmlSecKeysMngrPtr mngr, #ifndef XMLSEC_NO_X509 for(files += strlen(files) + 1; (files[0] != '\0'); files += strlen(files) + 1) { ret = xmlSecCryptoAppKeyCertLoad(key, files, format); - if(ret < 0){ - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppKeyCertLoad", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "uri=%s", - xmlSecErrorsSafeString(files)); + if(ret < 0) { + fprintf(stderr, "Error: xmlSecCryptoAppKeyCertLoad failed: file=%s\n", + xmlSecErrorsSafeString(files)); xmlSecKeyDestroy(key); return(-1); } @@ -155,22 +127,14 @@ xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad(xmlSecKeysMngrPtr mngr, #else /* XMLSEC_NO_X509 */ files += strlen(files) + 1; if(files[0] != '\0') { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "x509", - XMLSEC_ERRORS_R_DISABLED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: X509 support is disabled\n"); return(-1); } #endif /* XMLSEC_NO_X509 */ ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppDefaultKeysMngrAdoptKey", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } @@ -191,24 +155,16 @@ xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad(xmlSecKeysMngrPtr mngr, const char *f key = xmlSecCryptoAppKeyLoad(filename, xmlSecKeyDataFormatPkcs12, pwd, xmlSecCryptoAppGetDefaultPwdCallback(), (void*)filename); if(key == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppKeyLoad", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "filename=%s", - xmlSecErrorsSafeString(filename)); + fprintf(stderr, "Error: xmlSecCryptoAppKeyLoad failed: filename=%s\n", + xmlSecErrorsSafeString(filename)); return(-1); } if(name != NULL) { ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeySetName", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "name=%s", - xmlSecErrorsSafeString(name)); + fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", + xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); return(-1); } @@ -216,22 +172,14 @@ xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad(xmlSecKeysMngrPtr mngr, const char *f ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppDefaultKeysMngrAdoptKey", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } return(0); #else /* XMLSEC_NO_X509 */ - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "x509", - XMLSEC_ERRORS_R_DISABLED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: X509 support is disabled\n"); return(-1); #endif /* XMLSEC_NO_X509 */ } @@ -250,33 +198,22 @@ xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad(xmlSecKeysMngrPtr mngr, const char* k dataId = xmlSecKeyDataIdListFindByName(xmlSecKeyDataIdsGet(), BAD_CAST keyKlass, xmlSecKeyDataUsageAny); if(dataId == xmlSecKeyDataIdUnknown) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeyDataIdListFindByName", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "name=%s", - xmlSecErrorsSafeString(keyKlass)); - return(-1); + fprintf(stderr, "Error: xmlSecKeyDataIdListFindByName failed keyKlass=%s\n", + xmlSecErrorsSafeString(keyKlass)); + return(-1); } key = xmlSecKeyReadBinaryFile(dataId, filename); if(key == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeyReadBinaryFile", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecKeyReadBinaryFile failed filename=%s\n", + xmlSecErrorsSafeString(filename)); return(-1); } ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeySetName", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "name=%s", - xmlSecErrorsSafeString(name)); + fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", + xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); return(-1); } @@ -284,11 +221,7 @@ xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad(xmlSecKeysMngrPtr mngr, const char* k /* finally add it to keys manager */ ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppDefaultKeysMngrAdoptKey", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } @@ -307,22 +240,14 @@ xmlSecAppCryptoSimpleKeysMngrKeyGenerate(xmlSecKeysMngrPtr mngr, const char* key key = xmlSecAppCryptoKeyGenerate(keyKlassAndSize, name, xmlSecKeyDataTypePermanent); if(key == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecAppCryptoSimpleKeysMngrKeyGenerate", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "name=%s", - xmlSecErrorsSafeString(name)); + fprintf(stderr, "Error: xmlSecAppCryptoSimpleKeysMngrKeyGenerate failed: name=%s\n", + xmlSecErrorsSafeString(name)); return(-1); } ret = xmlSecCryptoAppDefaultKeysMngrAdoptKey(mngr, key); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecCryptoAppDefaultKeysMngrAdoptKey", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + fprintf(stderr, "Error: xmlSecCryptoAppDefaultKeysMngrAdoptKey failed\n"); xmlSecKeyDestroy(key); return(-1); } @@ -341,56 +266,38 @@ xmlSecAppCryptoKeyGenerate(const char* keyKlassAndSize, const char* name, xmlSec buf = (char*) xmlStrdup(BAD_CAST keyKlassAndSize); if(buf == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - NULL, - XMLSEC_ERRORS_R_STRDUP_FAILED, - "name=%s", - xmlSecErrorsSafeString(name)); + fprintf(stderr, "Error: xmlSecStrdupError(keyKlassAndSize) failed\n"); return(NULL); } /* separate key klass and size */ p = strchr(buf, '-'); if(p == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - NULL, - XMLSEC_ERRORS_R_INVALID_DATA, - "key size is not specified %s", + fprintf(stderr, "Error: key size is not specified in the key definition \"%s\"\n", xmlSecErrorsSafeString(buf)); xmlFree(buf); return(NULL); } *(p++) = '\0'; size = atoi(p); - + key = xmlSecKeyGenerateByName(BAD_CAST buf, size, type); if(key == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeyGenerate", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "klass=%s;size=%d", - xmlSecErrorsSafeString(buf), - size); + fprintf(stderr, "Error: xmlSecKeyGenerateByName() failed: name=%s;size=%d;type=%d\n", + xmlSecErrorsSafeString(buf), size, (int)type); xmlFree(buf); return(NULL); } - + ret = xmlSecKeySetName(key, BAD_CAST name); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecKeySetName", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "name=\"%s\"", - xmlSecErrorsSafeString(name)); + fprintf(stderr, "Error: xmlSecKeySetName failed: name=%s\n", + xmlSecErrorsSafeString(name)); xmlSecKeyDestroy(key); xmlFree(buf); return(NULL); } - + xmlFree(buf); return(key); } diff --git a/apps/crypto.h b/apps/crypto.h index b41d0c0d..3b8e1fc3 100644 --- a/apps/crypto.h +++ b/apps/crypto.h @@ -9,10 +9,6 @@ #ifndef __XMLSEC_APPS_CRYPTO_H__ #define __XMLSEC_APPS_CRYPTO_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include <libxml/tree.h> #include <xmlsec/xmlsec.h> #include <xmlsec/keys.h> @@ -20,6 +16,10 @@ extern "C" { #include <xmlsec/keysmngr.h> #include <xmlsec/crypto.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + int xmlSecAppCryptoInit (const char* config); int xmlSecAppCryptoShutdown (void); diff --git a/apps/xmlsec.c b/apps/xmlsec.c index 94ac80af..2da9cd19 100644 --- a/apps/xmlsec.c +++ b/apps/xmlsec.c @@ -28,11 +28,13 @@ #include <libexslt/exslt.h> #endif /* XMLSEC_NO_XSLT */ +#define XMLSEC_PRIVATE #include <xmlsec/xmlsec.h> #include <xmlsec/xmltree.h> #include <xmlsec/keys.h> #include <xmlsec/keyinfo.h> #include <xmlsec/keysmngr.h> +#include <xmlsec/io.h> #include <xmlsec/transforms.h> #include <xmlsec/xmldsig.h> #include <xmlsec/xmlenc.h> @@ -512,6 +514,31 @@ static xmlSecAppCmdLineParam idAttrParam = { NULL }; +static xmlSecAppCmdLineParam xxeParam = { + xmlSecAppCmdLineTopicAll, + "--xxe", + NULL, + "--xxe" + "\n\tenable External Entity resolution." + "\n\tWARNING: this may allow the reading of arbitrary files and URLs," + "\n\tcontrolled by the input XML document. Use with caution!", + xmlSecAppCmdLineParamTypeFlag, + xmlSecAppCmdLineParamFlagNone, + NULL +}; + +static xmlSecAppCmdLineParam urlMapParam = { + xmlSecAppCmdLineTopicDSigCommon | + xmlSecAppCmdLineTopicEncCommon, + "--url-map", + NULL, + "--url-map:<url> <file>" + "\n\tmaps a given <url> to the given <file> for loading external resources", + xmlSecAppCmdLineParamTypeString, + xmlSecAppCmdLineParamFlagParamNameValue | xmlSecAppCmdLineParamFlagMultipleValues, + NULL +}; + /**************************************************************** * @@ -643,6 +670,17 @@ static xmlSecAppCmdLineParam pkcs12Param = { NULL }; +static xmlSecAppCmdLineParam pkcs12PersistParam = { + xmlSecAppCmdLineTopicKeysMngr, + "--pkcs12-persist", + NULL, + "--pkcs12-persist" + "\n\tpersist loaded private key", + xmlSecAppCmdLineParamTypeFlag, + xmlSecAppCmdLineParamFlagNone, + NULL +}; + static xmlSecAppCmdLineParam pubkeyCertParam = { xmlSecAppCmdLineTopicKeysMngr, "--pubkey-cert-pem", @@ -742,6 +780,17 @@ static xmlSecAppCmdLineParam X509SkipStrictChecksParam = { xmlSecAppCmdLineParamFlagNone, NULL }; + +static xmlSecAppCmdLineParam X509DontVerifyCerts = { + xmlSecAppCmdLineTopicDSigCommon, + "--insecure", + NULL, + "--insecure" + "\n\tdo not verify certificates", + xmlSecAppCmdLineParamTypeFlag, + xmlSecAppCmdLineParamFlagNone, + NULL +}; #endif /* XMLSEC_NO_X509 */ static xmlSecAppCmdLineParamPtr parameters[] = { @@ -795,6 +844,7 @@ static xmlSecAppCmdLineParamPtr parameters[] = { &pwdParam, #ifndef XMLSEC_NO_X509 &pkcs12Param, + &pkcs12PersistParam, &pubkeyCertParam, &pubkeyCertDerParam, &trustedParam, @@ -804,6 +854,7 @@ static xmlSecAppCmdLineParamPtr parameters[] = { &verificationTimeParam, &depthParam, &X509SkipStrictChecksParam, + &X509DontVerifyCerts, #endif /* XMLSEC_NO_X509 */ /* General configuration params */ @@ -813,6 +864,8 @@ static xmlSecAppCmdLineParamPtr parameters[] = { &disableErrorMsgsParam, &printCryptoErrorMsgsParam, &helpParam, + &xxeParam, + &urlMapParam, /* MUST be the last one */ NULL @@ -895,31 +948,70 @@ static int xmlSecAppAddIDAttr (xmlNodePtr cur, const xmlChar* node, const xmlChar* nsHref); + +static int xmlSecAppInputMatchCallback (char const * filename); +static void* xmlSecAppInputOpenCallback (char const * filename); +static int xmlSecAppInputReadCallback (void * context, + char * buffer, + int len); +static int xmlSecAppInputCloseCallback (void * context); + + + xmlSecKeysMngrPtr gKeysMngr = NULL; int repeats = 1; int print_debug = 0; +int print_verbose_debug = 0; +int block_network_io = 0; clock_t total_time = 0; const char* xmlsec_crypto = NULL; const char* tmp = NULL; +const char** utf8_argv = NULL; /* TODO: this should be xmlChar** but it will break things downstream */ + +#if defined(WIN32) && defined(UNICODE) +int wmain(int argc, wchar_t *argv[ ], wchar_t *envp[ ]) { + UNREFERENCED_PARAMETER(envp); +#else /* defined(WIN32) && defined(UNICODE) */ int main(int argc, const char **argv) { +#endif /* defined(WIN32) && defined(UNICODE) */ xmlSecAppCmdLineParamTopic cmdLineTopics; xmlSecAppCommand command, subCommand; int pos, i; int res = 1; +#if defined(WIN32) + /* convert command line to UTF8 from locale or UNICODE */ + utf8_argv = (char**)xmlMalloc(sizeof(char*) * argc); + if(utf8_argv == NULL) { + fprintf(stderr, "Error: can not allocate memory (%d bytes)\n", (int)sizeof(char*) * argc); + goto fail; + } + memset((char**)utf8_argv, 0, sizeof(char*) * argc); + for(i = 0; i < argc; ++i) { + utf8_argv[i] = (const char*)xmlSecWin32ConvertTstrToUtf8(argv[i]); + if(utf8_argv[i] == NULL) { + fprintf(stderr, "Error: can not convert command line parameter at position %d to UTF8\n", i); + goto fail; + } + } +#else /* defined(WIN32) */ + utf8_argv = argv; +#endif /* defined(WIN32) */ + /* read the command (first argument) */ if(argc < 2) { + fprintf(stderr, "Error: not enough arguments\n"); xmlSecAppPrintUsage(); goto fail; } - command = xmlSecAppParseCommand(argv[1], &cmdLineTopics, &subCommand); + command = xmlSecAppParseCommand(utf8_argv[1], &cmdLineTopics, &subCommand); if(command == xmlSecAppCommandUnknown) { - fprintf(stderr, "Error: unknown command \"%s\"\n", argv[1]); + fprintf(stderr, "Error: unknown command \"%s\"\n", utf8_argv[1]); xmlSecAppPrintUsage(); goto fail; } - + /* do as much as we can w/o initialization */ if(command == xmlSecAppCommandHelp) { xmlSecAppPrintHelp(subCommand, cmdLineTopics); @@ -928,21 +1020,21 @@ int main(int argc, const char **argv) { fprintf(stdout, "%s %s (%s)\n", PACKAGE, XMLSEC_VERSION, xmlSecGetDefaultCrypto()); goto success; } - + /* parse command line */ - pos = xmlSecAppCmdLineParamsListParse(parameters, cmdLineTopics, argv, argc, 2); + pos = xmlSecAppCmdLineParamsListParse(parameters, cmdLineTopics, utf8_argv, argc, 2); if(pos < 0) { fprintf(stderr, "Error: invalid parameters\n"); xmlSecAppPrintUsage(); goto fail; } - + /* is it a help request? */ if(xmlSecAppCmdLineParamIsSet(&helpParam)) { xmlSecAppPrintHelp(command, cmdLineTopics); goto success; } - + /* we need to have some files at the end */ switch(command) { case xmlSecAppCommandKeys: @@ -968,8 +1060,8 @@ int main(int argc, const char **argv) { xmlsec_crypto = tmp; } #else /* !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) */ - if((tmp != NULL) && (xmlStrcmp(BAD_CAST tmp, xmlSecGetDefaultCrypto()) != 0)) { - fprintf(stderr, "Error: dynaimc crypto libraries loading is disabled and the only available crypto library is '%s'\n", xmlSecGetDefaultCrypto()); + if((tmp != NULL) && (xmlStrcmp(BAD_CAST tmp, xmlSecGetDefaultCrypto()) != 0) && (xmlStrcmp(BAD_CAST tmp, BAD_CAST "default") != 0)) { + fprintf(stderr, "Error: dynamic xmlsec-crypto library loading is disabled and the only available crypto library is '%s'\n", xmlSecGetDefaultCrypto()); xmlSecAppPrintUsage(); goto fail; } @@ -988,6 +1080,11 @@ int main(int argc, const char **argv) { goto fail; } + /* enable XXE? */ + if(xmlSecAppCmdLineParamIsSet(&xxeParam)) { + xmlSecSetExternalEntityLoader( NULL ); // reset to libxml2's default handler + } + /* get the "repeats" number */ if(xmlSecAppCmdLineParamIsSet(&repeatParam) && (xmlSecAppCmdLineParamGetInt(&repeatParam, 1) > 0)) { @@ -1003,12 +1100,12 @@ int main(int argc, const char **argv) { break; case xmlSecAppCommandCheckKeyData: for(i = pos; i < argc; ++i) { - if(xmlSecAppCheckKeyData(argv[i]) < 0) { - fprintf(stderr, "Error: key data \"%s\" not found\n", argv[i]); - goto fail; - } else { - fprintf(stdout, "Key data \"%s\" found\n", argv[i]); - } + if(xmlSecAppCheckKeyData(utf8_argv[i]) < 0) { + fprintf(stderr, "Error: key data \"%s\" not found\n", utf8_argv[i]); + goto fail; + } else { + fprintf(stdout, "Key data \"%s\" found\n", utf8_argv[i]); + } } break; case xmlSecAppCommandListTransforms: @@ -1016,18 +1113,18 @@ int main(int argc, const char **argv) { break; case xmlSecAppCommandCheckTransforms: for(i = pos; i < argc; ++i) { - if(xmlSecAppCheckTransform(argv[i]) < 0) { - fprintf(stderr, "Error: transform \"%s\" not found\n", argv[i]); - goto fail; - } else { - fprintf(stdout, "Transforms \"%s\" found\n", argv[i]); - } + if(xmlSecAppCheckTransform(utf8_argv[i]) < 0) { + fprintf(stderr, "Error: transform \"%s\" not found\n", utf8_argv[i]); + goto fail; + } else { + fprintf(stdout, "Transforms \"%s\" found\n", utf8_argv[i]); + } } break; case xmlSecAppCommandKeys: for(i = pos; i < argc; ++i) { - if(xmlSecAppCryptoSimpleKeysMngrSave(gKeysMngr, argv[i], xmlSecKeyDataTypeAny) < 0) { - fprintf(stderr, "Error: failed to save keys to file \"%s\"\n", argv[i]); + if(xmlSecAppCryptoSimpleKeysMngrSave(gKeysMngr, utf8_argv[i], xmlSecKeyDataTypeAny) < 0) { + fprintf(stderr, "Error: failed to save keys to file \"%s\"\n", utf8_argv[i]); goto fail; } } @@ -1035,16 +1132,16 @@ int main(int argc, const char **argv) { #ifndef XMLSEC_NO_XMLDSIG case xmlSecAppCommandSign: for(i = pos; i < argc; ++i) { - if(xmlSecAppSignFile(argv[i]) < 0) { - fprintf(stderr, "Error: failed to sign file \"%s\"\n", argv[i]); + if(xmlSecAppSignFile(utf8_argv[i]) < 0) { + fprintf(stderr, "Error: failed to sign file \"%s\"\n", utf8_argv[i]); goto fail; } } break; case xmlSecAppCommandVerify: for(i = pos; i < argc; ++i) { - if(xmlSecAppVerifyFile(argv[i]) < 0) { - fprintf(stderr, "Error: failed to verify file \"%s\"\n", argv[i]); + if(xmlSecAppVerifyFile(utf8_argv[i]) < 0) { + fprintf(stderr, "Error: failed to verify file \"%s\"\n", utf8_argv[i]); goto fail; } } @@ -1062,16 +1159,16 @@ int main(int argc, const char **argv) { #ifndef XMLSEC_NO_XMLENC case xmlSecAppCommandEncrypt: for(i = pos; i < argc; ++i) { - if(xmlSecAppEncryptFile(argv[i]) < 0) { - fprintf(stderr, "Error: failed to encrypt file with template \"%s\"\n", argv[i]); + if(xmlSecAppEncryptFile(utf8_argv[i]) < 0) { + fprintf(stderr, "Error: failed to encrypt file with template \"%s\"\n", utf8_argv[i]); goto fail; } } break; case xmlSecAppCommandDecrypt: for(i = pos; i < argc; ++i) { - if(xmlSecAppDecryptFile(argv[i]) < 0) { - fprintf(stderr, "Error: failed to decrypt file \"%s\"\n", argv[i]); + if(xmlSecAppDecryptFile(utf8_argv[i]) < 0) { + fprintf(stderr, "Error: failed to decrypt file \"%s\"\n", utf8_argv[i]); goto fail; } } @@ -1111,6 +1208,18 @@ fail: } xmlSecAppShutdown(); xmlSecAppCmdLineParamsListClean(parameters); +#if defined(WIN32) + if(utf8_argv != NULL) { + for(i = 0; i < argc; ++i) { + if(utf8_argv[i] != NULL) { + xmlFree(BAD_CAST utf8_argv[i]); + utf8_argv[i] = NULL; + } + } + xmlFree(BAD_CAST utf8_argv); + utf8_argv = NULL; + } +#endif /* defined(WIN32) */ return(res); } @@ -1460,10 +1569,6 @@ xmlSecAppPrintDSigCtx(xmlSecDSigCtxPtr dsigCtx) { return; } - if(xmlSecAppCmdLineParamIsSet(&printDebugParam) || xmlSecAppCmdLineParamIsSet(&printXmlDebugParam)) { - print_debug = 0; - } - /* print debug info if requested */ if((print_debug != 0) || xmlSecAppCmdLineParamIsSet(&printDebugParam)) { xmlSecDSigCtxDebugDump(dsigCtx, stdout); @@ -1638,7 +1743,7 @@ done: #ifndef XMLSEC_NO_TMPL_TEST static int xmlSecAppEncryptTmpl(void) { - const char* data = "Hello, World!"; + const xmlChar data[] = "Hello, World!"; xmlSecEncCtx encCtx; xmlDocPtr doc = NULL; xmlNodePtr cur; @@ -1688,7 +1793,7 @@ xmlSecAppEncryptTmpl(void) { /* encrypt */ start_time = clock(); if(xmlSecEncCtxBinaryEncrypt(&encCtx, xmlDocGetRootElement(doc), - (const xmlSecByte*)data, strlen(data)) < 0) { + (const xmlSecByte*)data, xmlStrlen(data)) < 0) { fprintf(stderr, "Error: failed to encrypt data\n"); goto done; } @@ -1806,6 +1911,8 @@ static int xmlSecAppPrepareKeyInfoReadCtx(xmlSecKeyInfoCtxPtr keyInfoCtx) { xmlSecAppCmdLineValuePtr value; int ret; + xmlSecKeyDataId dataId; + const char* p; if(keyInfoCtx == NULL) { fprintf(stderr, "Error: key info context is null\n"); @@ -1822,6 +1929,9 @@ xmlSecAppPrepareKeyInfoReadCtx(xmlSecKeyInfoCtxPtr keyInfoCtx) { if(xmlSecAppCmdLineParamIsSet(&X509SkipStrictChecksParam)) { keyInfoCtx->flags |= XMLSEC_KEYINFO_FLAGS_X509DATA_SKIP_STRICT_CHECKS; } + if(xmlSecAppCmdLineParamIsSet(&X509DontVerifyCerts)) { + keyInfoCtx->flags |= XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS; + } #endif /* XMLSEC_NO_X509 */ /* read enabled key data list */ @@ -1830,21 +1940,18 @@ xmlSecAppPrepareKeyInfoReadCtx(xmlSecKeyInfoCtxPtr keyInfoCtx) { fprintf(stderr, "Error: invalid value for option \"%s\".\n", enabledKeyDataParam.fullName); return(-1); - } else { - xmlSecKeyDataId dataId; - const char* p; - - for(p = value->strListValue; (p != NULL) && ((*p) != '\0'); p += strlen(p)) { - dataId = xmlSecKeyDataIdListFindByName(xmlSecKeyDataIdsGet(), BAD_CAST p, xmlSecKeyDataUsageAny); - if(dataId == xmlSecKeyDataIdUnknown) { - fprintf(stderr, "Error: key data \"%s\" is unknown.\n", p); - return(-1); - } - ret = xmlSecPtrListAdd(&(keyInfoCtx->enabledKeyData), (const xmlSecPtr)dataId); - if(ret < 0) { - fprintf(stderr, "Error: failed to enable key data \"%s\".\n", p); - return(-1); - } + } + + for(p = value->strListValue; (p != NULL) && ((*p) != '\0'); p += strlen(p)) { + dataId = xmlSecKeyDataIdListFindByName(xmlSecKeyDataIdsGet(), BAD_CAST p, xmlSecKeyDataUsageAny); + if(dataId == xmlSecKeyDataIdUnknown) { + fprintf(stderr, "Error: key data \"%s\" is unknown.\n", p); + return(-1); + } + ret = xmlSecPtrListAdd(&(keyInfoCtx->enabledKeyData), (const xmlSecPtr)dataId); + if(ret < 0) { + fprintf(stderr, "Error: failed to enable key data \"%s\".\n", p); + return(-1); } } } @@ -2053,6 +2160,9 @@ xmlSecAppLoadKeys(void) { #ifndef XMLSEC_NO_X509 /* read all pkcs12 files */ + if(xmlSecAppCmdLineParamIsSet(&pkcs12PersistParam)) { + xmlSecImportSetPersistKey(); + } for(value = pkcs12Param.value; value != NULL; value = value->next) { if(value->strValue == NULL) { fprintf(stderr, "Error: invalid value for option \"%s\".\n", pkcs12Param.fullName); @@ -2159,6 +2269,123 @@ xmlSecAppLoadKeys(void) { return(0); } +/** + * Callbacks for supporting mapping URLs to files + */ +static int +xmlSecAppInputMatchCallback(char const* filename) { + xmlSecAppCmdLineValuePtr value; + + if(filename == NULL) { + return(0); + } + + for(value = urlMapParam.value; value != NULL; value = value->next) { + if((value->strValue == NULL) || (value->paramNameValue == NULL)) { + continue; + } + if(strcmp(filename, value->paramNameValue) == 0) { + if(print_verbose_debug != 0) { + fprintf(stderr, "Debug: found mapped file \"%s\" for url \"%s\"\n", value->strValue, filename); + } + return(1); + } + } + + if(block_network_io != 0) { + static const xmlChar http[] = "http://"; + static const xmlChar https[] = "https://"; + static const xmlChar ftp[] = "ftp://"; + if(xmlStrncasecmp(BAD_CAST filename, http, xmlStrlen(http)) == 0) { + if(print_verbose_debug != 0) { + fprintf(stderr, "Debug: blocking access to \"%s\"\n", filename); + } + return(1); + } + if(xmlStrncasecmp(BAD_CAST filename, https, xmlStrlen(https)) == 0) { + if(print_verbose_debug != 0) { + fprintf(stderr, "Debug: blocking access to \"%s\"\n", filename); + } + return(1); + } + if(xmlStrncasecmp(BAD_CAST filename, ftp, xmlStrlen(ftp)) == 0) { + if(print_verbose_debug != 0) { + fprintf(stderr, "Debug: blocking access to \"%s\"\n", filename); + } + return(1); + } + } + return(0); +} + +static void* +xmlSecAppInputOpenCallback(char const* filename) { + xmlSecAppCmdLineValuePtr value; + + if(filename == NULL) { + return(NULL); + } + + for(value = urlMapParam.value; value != NULL; value = value->next) { + if((value->strValue == NULL) || (value->paramNameValue == NULL)) { + continue; + } + if(strcmp(filename, value->paramNameValue) == 0) { + FILE * f = NULL; +#ifdef WIN32 + fopen_s(&f, value->strValue, "rb"); +#else /* WIN32 */ + f = fopen(value->strValue, "rb"); +#endif /* WIN32 */ + if(f == NULL) { + fprintf(stdout, "Error: can not open file \"%s\" for url \"%s\"\n", value->strValue, filename); + return(NULL); + } + if(print_verbose_debug != 0) { + fprintf(stdout, "Debug: opened file \"%s\" for url \"%s\"\n", value->strValue, filename); + } + return(f); + } + } + return(NULL); +} + +static int +xmlSecAppInputReadCallback(void* context, char* buffer, int len) { + FILE* f = (FILE*)context; + size_t res; + + if(f == NULL) { + return(-1); + } + if(feof(f)) { + return(0); + } + res = fread(buffer, 1, len, f); + if(ferror(f)) { + return(-1); + } + return((int)res); +} + +static int xmlSecAppInputCloseCallback(void* context) { + FILE* f = (FILE*)context; + int ret; + + if(f == NULL) { + return(-1); + } + ret = fclose(f); + if(ret != 0) { + return(-1); + } + if(print_verbose_debug != 0) { + fprintf(stdout, "Debug: closed file\n"); + } + return(0); +} + + static int intialized = 0; #ifndef XMLSEC_NO_XSLT @@ -2167,6 +2394,8 @@ static xsltSecurityPrefsPtr xsltSecPrefs = NULL; static int xmlSecAppInit(void) { + int ret; + if(intialized != 0) { return(0); } @@ -2194,7 +2423,8 @@ xmlSecAppInit(void) { #endif /* XMLSEC_NO_XSLT */ /* Init xmlsec */ - if(xmlSecInit() < 0) { + ret = xmlSecInit(); + if(ret < 0) { fprintf(stderr, "Error: xmlsec intialization failed.\n"); return(-1); } @@ -2203,11 +2433,21 @@ xmlSecAppInit(void) { return(-1); } + /* Setup IO callbacks */ + ret = xmlSecIORegisterCallbacks(xmlSecAppInputMatchCallback, + xmlSecAppInputOpenCallback, + xmlSecAppInputReadCallback, + xmlSecAppInputCloseCallback); + if(ret < 0) { + fprintf(stderr, "Error: xmlsec IO callbacks intialization failed.\n"); + return(-1); + } + #if !defined(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) if(xmlSecCryptoDLLoadLibrary(BAD_CAST xmlsec_crypto) < 0) { fprintf(stderr, "Error: unable to load xmlsec-%s library. Make sure that you have\n" "this it installed, check shared libraries path (LD_LIBRARY_PATH)\n" - "envornment variable or use \"--crypto\" option to specify different\n" + "environment variable or use \"--crypto\" option to specify different\n" "crypto engine.\n", ((xmlsec_crypto != NULL) ? BAD_CAST xmlsec_crypto : xmlSecGetDefaultCrypto()) ); @@ -2252,6 +2492,11 @@ xmlSecAppXmlDataCreate(const char* filename, const xmlChar* defStartNodeName, co xmlSecAppCmdLineValuePtr value; xmlSecAppXmlDataPtr data; xmlNodePtr cur = NULL; + + xmlChar* attrName; + xmlChar* nodeName; + xmlChar* nsHref; + xmlChar* buf; if(filename == NULL) { fprintf(stderr, "Error: xml filename is null\n"); @@ -2299,41 +2544,37 @@ xmlSecAppXmlDataCreate(const char* filename, const xmlChar* defStartNodeName, co idAttrParam.fullName); xmlSecAppXmlDataDestroy(data); return(NULL); + } + attrName = (value->paramNameValue != NULL) ? BAD_CAST value->paramNameValue : BAD_CAST "id"; + + buf = xmlStrdup(BAD_CAST value->strValue); + if(buf == NULL) { + fprintf(stderr, "Error: failed to duplicate string \"%s\"\n", value->strValue); + xmlSecAppXmlDataDestroy(data); + return(NULL); + } + nodeName = (xmlChar*)strrchr((char*)buf, ':'); + if(nodeName != NULL) { + (*(nodeName++)) = '\0'; + nsHref = buf; } else { - xmlChar* attrName = (value->paramNameValue != NULL) ? BAD_CAST value->paramNameValue : BAD_CAST "id"; - xmlChar* nodeName; - xmlChar* nsHref; - xmlChar* buf; - - buf = xmlStrdup(BAD_CAST value->strValue); - if(buf == NULL) { - fprintf(stderr, "Error: failed to duplicate string \"%s\"\n", value->strValue); + nodeName = buf; + nsHref = NULL; + } + + /* process children first because it does not matter much but does simplify code */ + cur = xmlSecGetNextElementNode(data->doc->children); + while(cur != NULL) { + if(xmlSecAppAddIDAttr(cur, attrName, nodeName, nsHref) < 0) { + fprintf(stderr, "Error: failed to add ID attribute \"%s\" for node \"%s\"\n", attrName, value->strValue); + xmlFree(buf); xmlSecAppXmlDataDestroy(data); return(NULL); } - nodeName = (xmlChar*)strrchr((char*)buf, ':'); - if(nodeName != NULL) { - (*(nodeName++)) = '\0'; - nsHref = buf; - } else { - nodeName = buf; - nsHref = NULL; - } - - /* process children first because it does not matter much but does simplify code */ - cur = xmlSecGetNextElementNode(data->doc->children); - while(cur != NULL) { - if(xmlSecAppAddIDAttr(cur, attrName, nodeName, nsHref) < 0) { - fprintf(stderr, "Error: failed to add ID attribute \"%s\" for node \"%s\"\n", attrName, value->strValue); - xmlFree(buf); - xmlSecAppXmlDataDestroy(data); - return(NULL); - } - cur = xmlSecGetNextElementNode(cur->next); - } - - xmlFree(buf); + cur = xmlSecGetNextElementNode(cur->next); } + + xmlFree(buf); } @@ -2350,7 +2591,6 @@ xmlSecAppXmlDataCreate(const char* filename, const xmlChar* defStartNodeName, co } cur = attr->parent; } else if(xmlSecAppCmdLineParamGetString(&nodeNameParam) != NULL) { - xmlChar* buf; xmlChar* name; xmlChar* ns; @@ -2621,6 +2861,9 @@ static void xmlSecAppPrintHelp(xmlSecAppCommand command, xmlSecAppCmdLineParamTopic topics) { switch(command) { case xmlSecAppCommandUnknown: + fprintf(stderr, "Unknown command\n"); + fprintf(stdout, "%s%s\n", helpCommands1, helpCommands2); + break; case xmlSecAppCommandHelp: fprintf(stdout, "%s%s\n", helpCommands1, helpCommands2); break; @@ -2694,12 +2937,16 @@ xmlSecAppGetUriType(const char* string) { static FILE* xmlSecAppOpenFile(const char* filename) { - FILE* file; + FILE* file = NULL; - if((filename == NULL) || (strcmp(filename, "-") == 0)) { + if((filename == NULL) || (strcmp(filename, XMLSEC_STDOUT_FILENAME) == 0)) { return(stdout); } +#ifdef WIN32 + fopen_s(&file, filename, "wb"); +#else /* WIN32 */ file = fopen(filename, "wb"); +#endif /* WIN32 */ if(file == NULL) { fprintf(stderr, "Error: failed to open file \"%s\"\n", filename); return(NULL); diff --git a/configure.ac b/configure.ac index ab69e164..8e01f84f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,15 +1,16 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([xmlsec1],[1.2.22],[http://www.aleksey.com/xmlsec]) +AC_INIT([xmlsec1],[1.2.28],[http://www.aleksey.com/xmlsec]) XMLSEC_PACKAGE=xmlsec1 XMLSEC_VERSION_MAJOR=1 XMLSEC_VERSION_MINOR=2 -XMLSEC_VERSION_SUBMINOR=22 +XMLSEC_VERSION_SUBMINOR=28 XMLSEC_VERSION="$XMLSEC_VERSION_MAJOR.$XMLSEC_VERSION_MINOR.$XMLSEC_VERSION_SUBMINOR" XMLSEC_VERSION_INFO=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'` XMLSEC_VERSION_SAFE=`echo $XMLSEC_VERSION | sed 's/\./_/g'` AC_PREREQ([2.52g]) +AC_LANG(C) AC_CANONICAL_HOST AC_SUBST(XMLSEC_VERSION) @@ -21,7 +22,7 @@ AC_SUBST(XMLSEC_VERSION_SUBMINOR) AC_SUBST(XMLSEC_VERSION_INFO) AC_CONFIG_MACRO_DIR(m4) -AM_INIT_AUTOMAKE([1.7 tar-ustar subdir-objects -Wno-portability]) +AM_INIT_AUTOMAKE([1.7 tar-ustar subdir-objects -Wno-portability foreign]) AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE @@ -43,7 +44,7 @@ LT_INIT dnl dnl Find programs dnl -if test "z$RM" == "z" ; then +if test "z$RM" = "z" ; then AC_PATH_PROG(RM, rm, /bin/rm) fi AC_PATH_PROG(CP, cp, /bin/cp) @@ -51,6 +52,16 @@ AC_PATH_PROG(MV, mv, /bin/mv) AC_PATH_PROG(TAR, tar, /bin/tar) AC_PATH_PROG(PERL, perl) +dnl Programs for man pahes and html docs +AC_PATH_PROG(HELP2MAN, help2man) +AC_PATH_PROG(XSLTPROC, xsltproc) +AC_PATH_PROG(MAN2HTML, man2html) +AC_PATH_PROG(GTKDOC_MKHTML, gtkdoc-mkhtml) +AC_PATH_PROG(GTKDOC_MKDB, gtkdoc-mkdb) +AC_PATH_PROG(GTKDOC_SCAN, gtkdoc-scan) +AM_CONDITIONAL(HAS_HELP2MAN, [test x"$HELP2MAN" != x]) +AM_CONDITIONAL(HAS_MAN2HTML, [test x"$MAN2HTML" != x]) +AM_CONDITIONAL(HAS_XSLTPROC, [test x"$XSLTPROC" != x]) dnl Checks for header files. AC_HEADER_DIRENT @@ -67,67 +78,65 @@ AC_CHECK_FUNCS(strchr strrchr printf sprintf fprintf snprintf vfprintf vsprintf XMLSEC_DEFINES="" dnl ========================================================================== -dnl Specific setup for Aleksey's development environment: +dnl Detect windows +dnl ========================================================================== +build_windows=no +case "${host_os}" in + cygwin*|mingw*) + build_windows=yes + ;; +esac + +dnl ========================================================================== +dnl Specific setup for Aleksey's development environment: dnl - with debug dnl - with pedantic compiler flags dnl - with docs build dnl - with static binaries dnl - without dynamic xmlsec-crypto loading dnl ========================================================================== -AC_MSG_CHECKING(for development environment) -AC_ARG_ENABLE(development, [ --enable-development enable development environment (no)]) +AC_MSG_CHECKING(for development environment) +AC_ARG_ENABLE([development], [AC_HELP_STRING([--enable-development], [enable development environment (no)])]) if test "z$enable_development" = "zyes" ; then enable_debugging="yes" enable_pedantic="yes" enable_static_linking="yes" - enable_manpages_build="yes" - enable_docs_build="yes" + enable_manpages_build="no" + enable_docs_build="no" enable_crypto_dl="no" - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) fi dnl ========================================================================== dnl Do we want to build manpages? dnl ========================================================================== -AC_MSG_CHECKING(for man pages build) -AC_ARG_ENABLE(manpages_build,[ --enable-manpages-build man pages build (no)]) +AC_MSG_CHECKING(for man pages build) +AC_ARG_ENABLE([manpages_build], [AC_HELP_STRING([--enable-manpages-build], [man pages build (no)])]) if test "z$enable_manpages_build" = "zyes" ; then - AC_PATH_PROG(HELP2MAN, help2man) - - AC_MSG_RESULT(yes) + AM_CONDITIONAL(BUILD_MANPAGES, [test x"$HELP2MAN" != x]) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) + AM_CONDITIONAL(BUILD_MANPAGES, [test "x" = "y"]) + AC_MSG_RESULT([disabled]) fi -AM_CONDITIONAL(HAS_HELP2MAN, [test x"$HELP2MAN" != x]) -AM_CONDITIONAL(BUILD_MANPAGES, [test x"$HELP2MAN" != x]) - dnl ========================================================================== dnl Do we want to build docs? dnl ========================================================================== -AC_MSG_CHECKING(for docs build) -AC_ARG_ENABLE(docs_build, [ --enable-docs-build docs build (no)]) +AC_MSG_CHECKING(for docs build) +AC_ARG_ENABLE([docs_build], [AC_HELP_STRING([--enable-docs-build], [docs build (no)])]) if test "z$enable_docs_build" = "zyes" ; then - AC_PATH_PROG(XSLTPROC, xsltproc) - AC_PATH_PROG(MAN2HTML, man2html) - AC_PATH_PROG(GTKDOC_MKHTML, gtkdoc-mkhtml) - AC_PATH_PROG(GTKDOC_MKTMPL, gtkdoc-mktmpl) - AC_PATH_PROG(GTKDOC_MKDB, gtkdoc-mkdb) - AC_PATH_PROG(GTKDOC_SCAN, gtkdoc-scan) - - AC_MSG_RESULT(yes) + AM_CONDITIONAL(BUILD_MAN_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$MAN2HTML" != x]) + AM_CONDITIONAL(BUILD_API_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$GTKDOC_MKHTML" != x && test x"$GTKDOC_MKDB" != x && test x"$GTKDOC_SCAN" != x]) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) + AM_CONDITIONAL(BUILD_MAN_DOCS, [test "x" = "y"]) + AM_CONDITIONAL(BUILD_API_DOCS, [test "x" = "y"]) + AC_MSG_RESULT([disabled]) fi -AM_CONDITIONAL(HAS_MAN2HTML, [test x"$MAN2HTML" != x]) -AM_CONDITIONAL(HAS_XSLTPROC, [test x"$XSLTPROC" != x]) - -AM_CONDITIONAL(BUILD_MAN_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$MAN2HTML" != x]) -AM_CONDITIONAL(BUILD_API_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$GTKDOC_MKHTML" != x && test x"$GTKDOC_MKTMPL" != x && test x"$GTKDOC_MKDB" != x && test x"$GTKDOC_SCAN" != x]) - dnl ========================================================================== dnl Perform host specific configuration dnl ========================================================================== @@ -135,8 +144,6 @@ XMLSEC_EXTRA_LDFLAGS= XMLSEC_CRYPTO_EXTRA_LDFLAGS= dnl should separate extra LDFLAGS for xmlsec and crypto libs ? dnl should --enable-runtime-pseudo-reloc for mingw and cygwin ? - -xmlsec_sharedlib_hack="no" if test -n "$shrext"; then XMLSEC_SHLIBSFX="$shrext" else @@ -154,28 +161,24 @@ case "${host}" in XMLSEC_EXTRA_LDFLAGS="-no-undefined -avoid-version" XMLSEC_CRYPTO_EXTRA_LDFLAGS="-no-undefined -avoid-version" XMLSEC_SHLIBSFX=".dll.a" - xmlsec_sharedlib_hack="yes" ;; *-*-cygwin*) XMLSEC_EXTRA_LDFLAGS="-no-undefined" XMLSEC_CRYPTO_EXTRA_LDFLAGS="-no-undefined" ;; *-*-darwin*) - XMLSEC_SHLIBSFX=".dylib" - ;; + XMLSEC_SHLIBSFX=".dylib" + ;; esac -# To avoid problem with loading of a shared library (dlopen or equivalent) -# at run time on some platforms we need to link crypto modules with extra -# source. It's work without hack on 9x and under emulation. -# On nt 5.x (w2k,xp) the error is 998("Invalid access to memory location"). -AM_CONDITIONAL(SHAREDLIB_HACK, [test "z$xmlsec_sharedlib_hack" = "zyes"]) - dnl ========================================================================== dnl Hack for autoconf version mismatch dnl ========================================================================== -if test "z$shrext" == "z" ; then - shrext=$shrext_cmds +if test "z$shrext" = "z" ; then + AC_MSG_CHECKING(for shared library suffix) + module=no + eval shrext=$shrext_cmds + AC_MSG_RESULT($shrext) fi dnl ========================================================================== @@ -190,19 +193,19 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[char *foo = __func__;]])], [ac_func_exists=yes], [ac_func_exists=no]) -if test "z$ac_func_exists" = "zyes" ; then - AC_MSG_RESULT(__func__) +if test "z$ac_func_exists" = "zyes" ; then + AC_MSG_RESULT([__func__]) XMLSEC_DEFINES="$XMLSEC_DEFINES -D__XMLSEC_FUNCTION__=__func__" elif test "z$ac_function_exists" = "zyes" ; then - AC_MSG_RESULT(__FUNCTION__) + AC_MSG_RESULT([__FUNCTION__]) XMLSEC_DEFINES="$XMLSEC_DEFINES -D__XMLSEC_FUNCTION__=__FUNCTION__" -else - AC_MSG_RESULT("no") +else + AC_MSG_RESULT("no") fi dnl ========================================================================== -dnl check do we have size_t and its size, -dnl TODO: will need to replace this and the xmlSecSize define with +dnl check do we have size_t and its size, +dnl TODO: will need to replace this and the xmlSecSize define with dnl typedef on next ABI refresh dnl ========================================================================== AC_CHECK_SIZEOF(size_t) @@ -211,83 +214,232 @@ if test "$ac_cv_sizeof_size_t" -ne "4" ; then fi dnl ========================================================================== -dnl Check if pkg-config enabled and installed +dnl Check if pkg-config is enabled and installed dnl ========================================================================== -PKG_CONFIG="pkg-config" PKGCONFIG_FOUND="no" -AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig enable pkgconfig for configuration (yes)]) +AC_ARG_ENABLE([pkgconfig], [AC_HELP_STRING([--enable-pkgconfig], [enable pkgconfig for configuration (yes)])]) if test "z$enable_pkgconfig" != "zno" ; then - AC_CHECK_PROG(PKGCONFIG_PRESENT, $PKG_CONFIG, yes, no) - if test "z$PKGCONFIG_PRESENT" = "zyes" ; then - if $PKG_CONFIG --atleast-pkgconfig-version 0.9 ; then - PKGCONFIG_FOUND="yes" - fi - fi + PKG_PROG_PKG_CONFIG + PKGCONFIG_FOUND="yes" +else + PKGCONFIG_FOUND="no" fi dnl ========================================================================== +dnl Check if packages custom config scripts are enabled +dnl ========================================================================== +ENABLE_CUSTOM_CONFIGS="no" +AC_ARG_ENABLE([custom-configs], [AC_HELP_STRING([--enable-custom-configs], [enable package-specific custom scripts for configuration (yes)])]) +if test "z$enable_custom_configs" != "zno" ; then + ENABLE_CUSTOM_CONFIGS="yes" +else + ENABLE_CUSTOM_CONFIGS="no" +fi + +dnl ========================================================================== +dnl Check searching for typical packages folders is enabled +dnl ========================================================================== +ENABLE_FOLDERS_SEARCH="no" +AC_ARG_ENABLE([folders-search], [AC_HELP_STRING([--enable-folders-search], [enable searching for package installation in typical folders (yes)])]) +if test "z$enable_folders_search" != "zno" ; then + ENABLE_FOLDERS_SEARCH="yes" +else + ENABLE_FOLDERS_SEARCH="no" +fi + +dnl ========================================================================== +dnl Common installation locations +dnl ========================================================================== +COMMON_INCLUDE_DIR="/usr/include /usr/local/include" +COMMON_LIB_DIR="/usr/lib /usr/lib64 /usr/local/lib" +case $host in + i*86-*-linux-gnu) COMMON_LIB_DIR="$COMMON_LIB_DIR /usr/lib/i386-linux-gnu" ;; + x86_64-*-linux-gnu) COMMON_LIB_DIR="$COMMON_LIB_DIR /usr/lib/x86_64-linux-gnu" ;; + *) COMMON_LIB_DIR="$COMMON_LIB_DIR /usr/lib/$host" ;; +esac + +dnl Macro to help find the folder that contains marker file. +dnl Usage: AX_FIND_FOLDER(RESULT_VARIABLE, MARKER_FILE, FOLDERS_LIST) +AC_DEFUN([AX_FIND_FOLDER],[ + for dir in $3 ; do + if test -f "$dir/$2" ; then + $1="$dir" + break; + fi + done +]) + +dnl ========================================================================== dnl find libxml dnl ========================================================================== -LIBXML_MIN_VERSION="2.7.4" +LIBXML_MIN_VERSION="2.8.0" +LIBXML_INCLUDE_DIR="$COMMON_INCLUDE_DIR /usr/include/libxml2 /usr/local/include/libxml2 /usr/local/libxml2/include" +LIBXML_LIB_DIR="$COMMON_LIB_DIR /usr/local/libxml2/lib" +LIBXML_INCLUDE_MARKER="libxml/xmlversion.h" +LIBXML_SHARED_LIB_MARKER="libxml2$shrext" +LIBXML_STATIC_LIB_MARKER="libxml2.$libext" +LIBXML_LIBS_LIST="-lxml2" LIBXML_CONFIG="xml2-config" -LIBXML_CFLAGS="" -LIBXML_LIBS="" + +LIBXML_INCLUDE_PATH= +LIBXML_LIB_PATH= +LIBXML_CONFIG_PATH= LIBXML_FOUND="no" -AC_ARG_WITH(libxml, - [ --with-libxml=[PFX] libxml2 location] -) -AC_ARG_WITH(libxml-src, - [ --with-libxml-src=[PFX] not installed yet libxml2 location] -) - -if test "z$with_libxml" = "zno" -o "z$with_libxml_src" = "zno"; then - AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION) - AC_MSG_ERROR(libxml2 >= $LIBXML_MIN_VERSION is required for $XMLSEC_PACKAGE) -elif test "z$with_libxml_src" != "z" ; then - AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION) - CWD=`pwd` - if cd "$with_libxml_src" ; then - SRC_DIR=`pwd` - LIBXML_CONFIG=${SRC_DIR}/xml2-config - LIBXML_LIBS="-L${SRC_DIR}/.libs -lxml2" - LIBXML_CFLAGS="-I${SRC_DIR}/include" - LIBXML_FOUND="yes" - cd $CWD - AC_MSG_RESULT([yes (source)]) - else - AC_MSG_ERROR([libxml source dir not found (${with_libxml_src}), typo?]) - fi -elif test "z$with_libxml" = "z" -a "z$PKGCONFIG_FOUND" = "zyes" ; then +AC_ARG_WITH([libxml], [AC_HELP_STRING([--with-libxml@<:@=PFX@:>@], [libxml2 location])]) +AC_ARG_WITH([libxml-src], [AC_HELP_STRING([--with-libxml-src@<:@=PFX@:>@], [libxml2 source tree location])]) + +dnl Priority 0: LibXML2 is disabled: hard error. +if test "z$with_libxml" = "zno" -o "z$with_libxml_src" = "zno"; then + LIBXML_FOUND="disabled" +fi + +dnl Priority 1: User specifies the path to source code +if test "z$LIBXML_FOUND" = "zno" -a "z$with_libxml_src" != "z" -a "z$with_libxml_src" != "zyes" ; then + AC_MSG_CHECKING(for libxml2 library source tree in "$with_libxml_src" folder) + if test [ -f "$with_libxml_src/include/$LIBXML_INCLUDE_MARKER" ] -a [ -f "$with_libxml_src/.libs/$LIBXML_SHARED_LIB_MARKER" -o -f "$with_libxml_src/.libs/$LIBXML_STATIC_LIB_MARKER"] ; then + LIBXML_INCLUDE_PATH="$with_libxml_src/include" + LIBXML_LIB_PATH="$with_libxml_src/.libs" + LIBXML_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_libxml_src/include/$LIBXML_INCLUDE_MARKER" or "$with_libxml_src/.libs/$LIBXML_SHARED_LIB_MARKER" or "$with_libxml_src/.libs/$LIBXML_STATIC_LIB_MARKER" files don't exist), typo?]) + fi +fi + +dnl Priority 2: User specifies path to installation +if test "z$LIBXML_FOUND" = "zno" -a "z$with_libxml" != "z" -a "z$with_libxml" != "zyes" ; then + AC_MSG_CHECKING(for libxml2 library installation in "$with_libxml" folder) + if test "z$ENABLE_CUSTOM_CONFIGS" = "zyes" -a -f "$with_libxml/bin/$LIBXML_CONFIG" ; then + LIBXML_CONFIG_PATH="$with_libxml/bin/$LIBXML_CONFIG" + LIBXML_FOUND="yes" + AC_MSG_RESULT([yes]) + elif test [ -f "$with_libxml/include/libxml2/$LIBXML_INCLUDE_MARKER" ] -a [ -f "$with_libxml/lib/$LIBXML_SHARED_LIB_MARKER" -o -f "$with_libxml/lib/$LIBXML_STATIC_LIB_MARKER" ] ; then + LIBXML_INCLUDE_PATH="$with_libxml/include/libxml2" + LIBXSLT_LIB_PATH="$with_libxml/lib" + LIBXML_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_libxml/bin/$LIBXML_CONFIG" tool, or "$with_libxml/include/libxml2/$LIBXML_INCLUDE_MARKER" and/or "$with_libxml/lib/$LIBXML_SHARED_LIB_MARKER" or "$with_libxml/lib/$LIBXML_STATIC_LIB_MARKER" files don't exist), typo?]) + fi +fi + +dnl Priority 3: User sets both CFLAGS and LIBS flags +if test "z$LIBXML_FOUND" = "zno" -a "z$LIBXML_CFLAGS" != "z" -a "z$LIBXML_LIBS" != "z" ; then + LIBXML_FOUND="yes" +fi + +dnl Priority 4: Guess with pkg_config +if test "z$LIBXML_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_MIN_VERSION, - [LIBXML_FOUND=yes], - [LIBXML_FOUND=no]) + [LIBXML_FOUND=yes], + [LIBXML_FOUND=no]) +fi + +dnl Priority 5: Guess the config tool location +if test "z$LIBXML_FOUND" = "zno" -a "z$ENABLE_CUSTOM_CONFIGS" = "zyes" ; then + AC_PATH_PROG(LIBXML_CONFIG_PATH, [$LIBXML_CONFIG], [], [$PATH]) + if test "z$LIBXML_CONFIG_PATH" != "z" ; then + LIBXML_FOUND="yes" + fi +fi + +dnl Priority 6: Guess using a list of folders. +if test "z$LIBXML_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for libxml2 library installation in the typical folders) + if test "z$LIBXML_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(LIBXML_INCLUDE_PATH, $LIBXML_INCLUDE_MARKER, $LIBXML_INCLUDE_DIR) + fi + if test "z$LIBXML_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(LIBXML_LIB_PATH, $LIBXML_SHARED_LIB_MARKER, $LIBXML_LIB_DIR) + fi + if test "z$LIBXML_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(LIBXML_LIB_PATH, $LIBXML_STATIC_LIB_MARKER, $LIBXML_LIB_DIR) + fi + if test "z$LIBXML_INCLUDE_PATH" != "z" -a "z$LIBXML_LIB_PATH" != "z" ; then + LIBXML_FOUND="yes" + AC_MSG_RESULT([yes ("-I$LIBXML_INCLUDE_PATH -L$LIBXML_LIB_PATH")]) + else + AC_MSG_RESULT([not found]) + fi fi + +dnl Priority 7: Just try to compile/link and hope for the best if test "z$LIBXML_FOUND" = "zno" ; then - if test "z$with_libxml" != "zyes" ; then - if test "z$with_libxml" != "z" ; then - AC_PATH_PROG([LIBXML_CONFIG], [$LIBXML_CONFIG], [], - [$with_libxml/bin:$PATH]) - else - AC_PATH_PROG([LIBXML_CONFIG], [$LIBXML_CONFIG], [], - [$PATH]) - fi - fi - AC_MSG_CHECKING([libxml2 $LIBXML_CONFIG ]) - if ! LIBXML_VERSION=`$LIBXML_CONFIG --version 2>/dev/null`; then - AC_MSG_ERROR(Could not find libxml2 anywhere.) - fi - vers=`echo $LIBXML_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - minvers=`echo $LIBXML_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$vers" -ge "$minvers" ; then - LIBXML_LIBS="`$LIBXML_CONFIG --libs`" - LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`" - LIBXML_FOUND="yes" - AC_MSG_RESULT([yes ('$LIBXML_VERSION')]) + AC_MSG_CHECKING(for libxml2 library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $LIBXML_LIBS $LIBXML_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <libxml/xmlversion.h> + ]],[[ + int main () { xmlCheckVersion(0);; return(0); } + ]]) + ],[ + LIBXML_FOUND=yes + LIBXML_LIBS="$LIBXML_LIBS $LIBXML_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + LIBXML_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi + +dnl Set CFLAGS/LIBS flags +if test "z$LIBXML_FOUND" = "zyes" ; then + if test "z$LIBXML_CONFIG_PATH" != "z" -a "z$ENABLE_CUSTOM_CONFIGS" = "zyes" ; then + dnl Get the values using config tool (overwrite CFLAGS/LIBS!) + if test "z$LIBXML_CFLAGS" = "z" ; then + LIBXML_CFLAGS="`$LIBXML_CONFIG_PATH --cflags`" + fi + if test "z$LIBXML_LIBS" = "z"; then + LIBXML_LIBS="`$LIBXML_CONFIG_PATH --libs`" + fi + LIBXML_CONFIG=$LIBXML_CONFIG_PATH + LIBXML_FOUND="yes" else - AC_MSG_ERROR(You need at least libxml2 $LIBXML_MIN_VERSION for this version of $XMLSEC_PACKAGE) + dnl Set flags if INCLUDE_PATH or LIB_PATH are set (do NOT overwrite CFLAGS/LIBS!) + if test "z$LIBXML_INCLUDE_PATH" != "z" ; then + LIBXML_CFLAGS="$LIBXML_CFLAGS -I$LIBXML_INCLUDE_PATH" + fi + if test "z$LIBXML_LIB_PATH" != "z" ; then + if test "z$with_gnu_ld" = "zyes" ; then + LIBXML_LIBS="$LIBXML_LIBS -Wl,-rpath-link -Wl,$LIBXML_LIB_PATH" + fi + LIBXML_LIBS="$LIBXML_LIBS -L$LIBXML_LIB_PATH $LIBXML_LIBS_LIST" + fi fi fi +dnl Verify the version. +AC_MSG_CHECKING(for libxml2 library >= $LIBXML_MIN_VERSION) +if test "z$LIBXML_FOUND" = "zyes" ; then + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS" + minvers=`echo $LIBXML_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 100 + $2) * 100 + $3;}'` + AC_EGREP_CPP(greater-than-minvers, [ + #include <libxml/xmlversion.h> + #if LIBXML_VERSION >= $minvers + greater-than-minvers + #endif + ],[ + LIBXML_FOUND=yes + ],[ + LIBXML_FOUND=no + ]) + CPPFLAGS=$OLD_CPPFLAGS +fi +AC_MSG_RESULT([$LIBXML_FOUND]) + +dnl LibXML2 is required so if we didn't find it then it is a fatal error. +if test "z$LIBXML_FOUND" != "zyes" ; then + AC_MSG_ERROR([libxml2 library >= $LIBXML_MIN_VERSION is required for this version of $XMLSEC_PACKAGE]) +fi + +dnl Finally set variables AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) AC_SUBST(LIBXML_CONFIG) @@ -296,82 +448,178 @@ AC_SUBST(LIBXML_MIN_VERSION) dnl ========================================================================== dnl find libxslt dnl ========================================================================== -XMLSEC_NO_LIBXSLT="1" LIBXSLT_MIN_VERSION=1.0.20 -LIBXSLT_PC_FILE_COND="libxslt >= $LIBXSLT_MIN_VERSION" +LIBXSLT_INCLUDE_DIR="$COMMON_INCLUDE_DIR /usr/local/libxslt/include" +LIBXSLT_LIB_DIR="$COMMON_LIB_DIR /usr/local/libxslt/lib" LIBXSLT_CONFIG="xslt-config" -LIBXSLT_CFLAGS="" -LIBXSLT_LIBS="" +LIBXSLT_INCLUDE_MARKER="libxslt/xsltconfig.h" +LIBXSLT_SHARED_LIB_MARKER="libxslt$shrext" +LIBXSLT_STATIC_LIB_MARKER="libxslt.$libext" +LIBXSLT_LIBS_LIST="-lxslt" + +XMLSEC_NO_LIBXSLT="1" +LIBXSLT_INCLUDE_PATH= +LIBXSLT_LIB_PATH= +LIBXSLT_CONFIG_PATH= LIBXSLT_FOUND="no" -AC_ARG_WITH(libxslt, - [ --with-libxslt=[PFX] libxslt location] -) -AC_ARG_WITH(libxslt-src, - [ --with-libxslt-src=[PFX] not installed yet libxslt location] -) +AC_ARG_WITH([libxslt], [AC_HELP_STRING([--with-libxslt@<:@=PFX@:>@], [libxslt location])]) +AC_ARG_WITH([libxslt-src], [AC_HELP_STRING([--with-libxslt-src@<:@=PFX@:>@],[libxslt source tree location])]) + +dnl Priority 0: Check if library is not needed if test "z$with_libxslt" = "zno" -o "z$with_libxslt_src" = "zno" ; then - AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) - AC_MSG_RESULT(no) - LIBXSLT_FOUND="without" -elif test "z$with_libxslt_src" != "z" ; then - AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) - CWD=`pwd` - if cd "$with_libxslt_src" ; then - SRC_DIR=`pwd` - LIBXSLT_CONFIG=${SRC_DIR}/xslt-config - LIBXSLT_LIBS="-L${SRC_DIR}/libxslt/.libs -lxslt" - LIBXSLT_CFLAGS="-I${SRC_DIR}" - LIBXSLT_FOUND="yes" - cd $CWD - AC_MSG_RESULT([yes (source)]) - else - AC_MSG_ERROR([libxslt source dir not found (${with_libxslt_src}), typo?]) - fi -elif test "z$with_libxslt" = "z" -a "z$PKGCONFIG_FOUND" = "zyes" ; then + LIBXSLT_FOUND="disabled" +fi + +dnl Priority 1: User specifies the path to source code +if test "z$LIBXSLT_FOUND" = "zno" -a "z$with_libxslt_src" != "z" -a "z$with_libxslt_src" != "zyes" ; then + AC_MSG_CHECKING(for libxslt library source tree in "$with_libxslt_src" folder) + if test [ -f "$with_libxslt_src/$LIBXSLT_INCLUDE_MARKER" ] -a [ -f "$with_libxslt_src/libxslt/.libs/$LIBXSLT_SHARED_LIB_MARKER" -o -f "$with_libxslt_src/libxslt/.libs/$LIBXSLT_STATIC_LIB_MARKER" ] ; then + LIBXSLT_INCLUDE_PATH="$with_libxslt_src" + LIBXSLT_LIB_PATH="$with_libxslt_src/libxslt/.libs" + LIBXSLT_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_libxslt_src/$LIBXSLT_INCLUDE_MARKER" and/or "$with_libxslt_src/libxslt/.libs/$LIBXSLT_SHARED_LIB_MARKER" or "$with_libxslt_src/libxslt/.libs/$LIBXSLT_STATIC_LIB_MARKER" files don't exist), typo?]) + fi +fi + +dnl Priority 2: User specifies path to installation +if test "z$LIBXSLT_FOUND" = "zno" -a "z$with_libxslt" != "z" -a "z$with_libxslt" != "zyes" ; then + AC_MSG_CHECKING(for libxslt library installation in "$with_libxslt" folder) + if test "z$ENABLE_CUSTOM_CONFIGS" = "zyes" -a -f "$with_libxslt/bin/$LIBXSLT_CONFIG" ; then + LIBXSLT_CONFIG_PATH="$with_libxslt/bin/$LIBXSLT_CONFIG" + LIBXSLT_FOUND="yes" + AC_MSG_RESULT([yes]) + elif test [ -f "$with_libxslt/include/$LIBXSLT_INCLUDE_MARKER" ] -a [ -f "$with_libxslt/lib/$LIBXSLT_SHARED_LIB_MARKER" -o -f "$with_libxslt/lib/$LIBXSLT_STATIC_LIB_MARKER" ] ; then + LIBXSLT_INCLUDE_PATH="$with_libxslt/include" + LIBXSLT_LIB_PATH="$with_libxslt/lib" + LIBXSLT_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_libxslt/bin/$LIBXSLT_CONFIG" tool, or "$with_libxslt/include/$LIBXSLT_INCLUDE_MARKER" and/or "$with_libxslt/lib/$LIBXSLT_SHARED_LIB_MARKER" or "$with_libxslt/lib/$LIBXSLT_STATIC_LIB_MARKER" files don't exist), typo?]) + fi +fi + +dnl Priority 3: User sets both CFLAGS and LIBS flags +if test "z$LIBXSLT_FOUND" = "zno" -a "z$LIBXSLT_CFLAGS" != "z" -a "z$LIBXSLT_LIBS" != "z" ; then + LIBXSLT_FOUND="yes" +fi + +dnl Priority 4: Guess with pkg_config +if test "z$LIBXSLT_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" ; then PKG_CHECK_MODULES(LIBXSLT, libxslt >= $LIBXSLT_MIN_VERSION, - [LIBXSLT_FOUND=yes], - [LIBXSLT_FOUND=no]) + [LIBXSLT_FOUND=yes], + [LIBXSLT_FOUND=no]) +fi + +dnl Priority 5: Guess the config tool location +if test "z$LIBXSLT_FOUND" = "zno" -a "z$ENABLE_CUSTOM_CONFIGS" = "zyes" ; then + AC_PATH_PROG(LIBXSLT_CONFIG_PATH, [$LIBXSLT_CONFIG], [], [$PATH]) + if test "z$LIBXSLT_CONFIG_PATH" != "z" ; then + LIBXSLT_FOUND="yes" + fi +fi + +dnl Priority 6: Guess using a list of folders. +if test "z$LIBXSLT_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for libxslt library installation in the typical folders) + if test "z$LIBXSLT_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(LIBXSLT_INCLUDE_PATH, $LIBXSLT_INCLUDE_MARKER, $LIBXSLT_INCLUDE_DIR) + fi + if test "z$LIBXSLT_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(LIBXSLT_LIB_PATH, $LIBXSLT_SHARED_LIB_MARKER, $LIBXSLT_LIB_DIR) + fi + if test "z$LIBXSLT_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(LIBXSLT_LIB_PATH, $LIBXSLT_STATIC_LIB_MARKER, $LIBXSLT_LIB_DIR) + fi + if test "z$LIBXSLT_INCLUDE_PATH" != "z" -a "z$LIBXSLT_LIB_PATH" != "z" ; then + LIBXSLT_FOUND="yes" + AC_MSG_RESULT([yes ("-I$LIBXSLT_INCLUDE_PATH -L$LIBXSLT_LIB_PATH")]) + else + AC_MSG_RESULT([not found]) + fi fi +dnl Priority 7: Just try to compile/link and hope for the best if test "z$LIBXSLT_FOUND" = "zno" ; then - if test "z$with_libxslt" != "zyes" ; then - if test "z$with_libxslt" != "z" ; then - AC_PATH_PROG([LIBXSLT_CONFIG], [$LIBXSLT_CONFIG], [], - [$with_libxslt/bin:$PATH]) - else - AC_PATH_PROG([LIBXSLT_CONFIG], [$LIBXSLT_CONFIG], [], - [$PATH]) + AC_MSG_CHECKING(for libxslt library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS $LIBXSLT_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $LIBXML_LIBS $LIBXSLT_LIBS $LIBXSLT_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <libxslt/xslt.h> + ]],[[ + int main () { xsltInit(); return(0); } + ]]) + ],[ + LIBXSLT_FOUND=yes + LIBXSLT_LIBS="$LIBXSLT_LIBS $LIBXSLT_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + LIBXSLT_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi + +dnl Set CFLAGS/LIBS flags +if test "z$LIBXSLT_FOUND" = "zyes" ; then + if test "z$LIBXSLT_CONFIG_PATH" != "z" -a "z$ENABLE_CUSTOM_CONFIGS" = "zyes" ; then + dnl Get the values using config tool (overwrite CFLAGS/LIBS!) + if test "z$LIBXSLT_CFLAGS" = "z" ; then + LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG_PATH --cflags`" fi - fi - AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) - if ! LIBXSLT_VERSION=`$LIBXSLT_CONFIG --version 2>/dev/null`; then - if test "z$with_libxslt" != "zyes" ; then - AC_MSG_ERROR(Unable to find libxslt at '$with_libxslt') - else - AC_MSG_RESULT(no) - fi + if test "z$LIBXSLT_LIBS" = "z"; then + LIBXSLT_LIBS="`$LIBXSLT_CONFIG_PATH --libs`" + fi + LIBXSLT_CONFIG=$LIBXSLT_CONFIG_PATH + LIBXSLT_FOUND="yes" else - vers=`echo $LIBXSLT_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$vers" -ge "$minvers" ; then - LIBXSLT_LIBS="`$LIBXSLT_CONFIG --libs`" - LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG --cflags`" - LIBXSLT_FOUND="yes" - AC_MSG_RESULT([yes ('$LIBXSLT_VERSION')]) - else - AC_MSG_ERROR(You need at least libxslt $LIBXSLT_MIN_VERSION for this version of $XMLSEC_PACKAGE) - fi + dnl Set flags if INCLUDE_PATH or LIB_PATH are set (do NOT overwrite CFLAGS/LIBS!) + if test "z$LIBXSLT_INCLUDE_PATH" != "z" ; then + LIBXSLT_CFLAGS="$LIBXSLT_CFLAGS -I$LIBXSLT_INCLUDE_PATH" + fi + if test "z$LIBXSLT_LIB_PATH" != "z" ; then + if test "z$with_gnu_ld" = "zyes" ; then + LIBXSLT_LIBS="$LIBXSLT_LIBS -Wl,-rpath-link -Wl,$LIBXSLT_LIB_PATH" + fi + LIBXSLT_LIBS="$LIBXSLT_LIBS -L$LIBXSLT_LIB_PATH $LIBXSLT_LIBS_LIST" + fi fi fi +dnl Verify the version +AC_MSG_CHECKING(for libxslt library >= $LIBXSLT_MIN_VERSION) +if test "z$LIBXSLT_FOUND" = "zyes" ; then + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $LIBXSLT_CFLAGS" + minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 100 + $2) * 100 + $3;}'` + AC_EGREP_CPP(greater-than-minvers, [ + #include <libxslt/xsltconfig.h> + #if LIBXSLT_VERSION >= $minvers + greater-than-minvers + #endif + ],[ + LIBXSLT_FOUND=yes + ],[ + LIBXSLT_FOUND=no + ]) + CPPFLAGS=$OLD_CPPFLAGS +fi +AC_MSG_RESULT([$LIBXSLT_FOUND]) + +dnl Finally set variables if test "z$LIBXSLT_FOUND" = "zyes" ; then XMLSEC_NO_LIBXSLT="0" + LIBXSLT_PC_FILE_COND="libxslt >= $LIBXSLT_MIN_VERSION" else + XMLSEC_NO_LIBXSLT="1" LIBXSLT_PC_FILE_COND="" - LIBXSLT_MIN_VERSION="" XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XSLT=1" fi - AC_SUBST(XMLSEC_NO_LIBXSLT) AC_SUBST(LIBXSLT_CFLAGS) AC_SUBST(LIBXSLT_LIBS) @@ -388,192 +636,231 @@ XMLSEC_CRYPTO_DISABLED_LIST="" dnl ========================================================================== dnl OpenSSL dnl ========================================================================== -ac_openssl_lib_dir="/usr/local/lib /usr/lib /usr/lib64 /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg" -ac_openssl_inc_dir="/usr/local/include /usr/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include" +OPENSSL_MIN_VERSION="1.0.0" +OPENSSL_INCLUDE_DIR="$COMMON_INCLUDE_DIR /usr/local/ssl/include" +OPENSSL_LIB_DIR="$COMMON_LIB_DIR /usr/local/ssl/lib" +OPENSSL_CRYPTO_LIB="$XMLSEC_PACKAGE-openssl" +OPENSSL_INCLUDE_MARKER="openssl/opensslv.h" +OPENSSL_LIB_SHARED_MARKER="libcrypto$shrext" +OPENSSL_LIB_STATIC_MARKER="libcrypto.a" +OPENSSL_LIBS_LIST="-lcrypto" +case $host in + *-*-mingw*) OPENSSL_EXTRA_LIBS=;; + *-*-osf5*) OPENSSL_EXTRA_LIBS=;; + *-*-openbsd*) OPENSSL_EXTRA_LIBS=;; + *-*-netbsd*) OPENSSL_EXTRA_LIBS=;; + *-*-freebsd*|*-*-dragonfly*) OPENSSL_EXTRA_LIBS=;; + *-*-darwin*) OPENSSL_EXTRA_LIBS=;; + #FIXME: check if lib "dl" is required + *) OPENSSL_EXTRA_LIBS=-ldl;; +esac XMLSEC_NO_OPENSSL="1" -OPENSSL_MIN_VERSION="0.9.8" OPENSSL_VERSION="" -OPENSSL_CFLAGS="" -OPENSSL_LIBS="" -OPENSSL_CRYPTO_LIB="$XMLSEC_PACKAGE-openssl" +OPENSSL_INCLUDE_PATH= +OPENSSL_LIB_PATH= OPENSSL_FOUND=no -AC_ARG_WITH(openssl, [ --with-openssl=[PFX] openssl location]) +AC_ARG_WITH([openssl], [AC_HELP_STRING([--with-openssl@<:@=PFX@:>@], [openssl location])]) + +dnl Priority 0: Check if library is disabled if test "z$with_openssl" = "zno" ; then - OPENSSL_FOUND=without - AC_MSG_CHECKING(for openssl libraries >= $OPENSSL_MIN_VERSION) - AC_MSG_RESULT(no) -elif test "z$with_openssl" != "z" ; then - case $host in - *-*-mingw*) openssl_exlibs=;; - *-*-osf5*) openssl_exlibs=;; - *-*-openbsd*) openssl_exlibs=;; - *-*-netbsd*) openssl_exlibs=;; - #FIXME: check if lib "dl" is required - *) openssl_exlibs=-ldl;; - esac - OPENSSL_CFLAGS="$OPENSSL_CFLAGS -I$with_openssl/include" - if test -f "$with_openssl/lib/libcrypto${XMLSEC_SHLIBSFX}" ; then - OPENSSL_LIBS="-L$with_openssl/lib -lcrypto $openssl_exlibs" + OPENSSL_FOUND=disabled +fi + +dnl Priority 1: User specifies the path to installation +if test "z$OPENSSL_FOUND" = "zno" -a "z$with_openssl" != "z" -a "z$with_openssl" != "zyes" ; then + AC_MSG_CHECKING(for openssl library installation in "$with_openssl" folder) + if test -f "$with_openssl/include/$OPENSSL_INCLUDE_MARKER" -a -f "$with_openssl/lib/$OPENSSL_LIB_SHARED_MARKER" ; then + OPENSSL_INCLUDE_PATH="$with_openssl/include" + OPENSSL_LIB_PATH="$with_openssl/lib" + OPENSSL_FOUND="yes" + AC_MSG_RESULT([yes]) + elif test -f "$with_openssl/include/$OPENSSL_INCLUDE_MARKER" -a -f "$with_openssl/lib/$OPENSSL_LIB_STATIC_MARKER" ; then + OPENSSL_INCLUDE_PATH="$with_openssl/include" + OPENSSL_LIB_PATH="$with_openssl/lib" + OPENSSL_FOUND="yes" + AC_MSG_RESULT([yes]) else - OPENSSL_LIBS="$with_openssl/lib/libcrypto.a $openssl_exlibs" + AC_MSG_ERROR([not found: "$with_openssl/include/$OPENSSL_INCLUDE_MARKER" or "$with_openssl/lib/$OPENSSL_LIB_SHARED_MARKER" or "$with_openssl/lib/$OPENSSL_LIB_STATIC_MARKER" files don't exist), typo?]) fi +fi + +dnl Priority 2: User sets both CFLAGS and LIBS flags +if test "z$OPENSSL_FOUND" = "zno" -a "z$OPENSSL_CFLAGS" != "z" -a "z$OPENSSL_LIBS" != "z" ; then OPENSSL_FOUND="yes" -elif test "z$PKGCONFIG_FOUND" = "zyes" ; then - if test "z$OPENSSL_VERSION" = "z" ; then - PKG_CHECK_MODULES(OPENSSL, openssl >= 1.1.0, - [OPENSSL_VERSION="1.1.0"], - [OPENSSL_VERSION=""]) - fi +fi - if test "z$OPENSSL_VERSION" = "z" ; then - PKG_CHECK_MODULES(OPENSSL, openssl >= 1.0.0, - [OPENSSL_VERSION="1.0.0"], - [OPENSSL_VERSION=""]) - fi +dnl Priority 3: Guess with pkg_config +if test "z$OPENSSL_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" ; then + PKG_CHECK_MODULES(OPENSSL, openssl >= $OPENSSL_MIN_VERSION, + [OPENSSL_FOUND=yes], + [OPENSSL_FOUND=no]) +fi - if test "z$OPENSSL_VERSION" = "z" ; then - PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.8, - [OPENSSL_VERSION="0.9.8"], - [OPENSSL_VERSION=""]) +dnl Priority 4: Guess using a list of folders (do not overwrite CFLAGS/LIBS flags). +if test "z$OPENSSL_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for openssl library installation in the typical folders) + if test "z$OPENSSL_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(OPENSSL_INCLUDE_PATH, $OPENSSL_INCLUDE_MARKER, $OPENSSL_INCLUDE_DIR) fi - - if test "z$OPENSSL_VERSION" = "z" ; then - PKG_CHECK_MODULES(OPENSSL, openssl >= $OPENSSL_MIN_VERSION, - [OPENSSL_VERSION="$OPENSSL_MIN_VERSION"], - [OPENSSL_VERSION=""]) + if test "z$OPENSSL_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(OPENSSL_LIB_PATH, $OPENSSL_LIB_SHARED_MARKER, $OPENSSL_LIB_DIR) fi - - if test "z$OPENSSL_VERSION" != "z" ; then + if test "z$OPENSSL_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(OPENSSL_LIB_PATH, $OPENSSL_LIB_STATIC_MARKER, $OPENSSL_LIB_DIR) + fi + if test "z$OPENSSL_INCLUDE_PATH" != "z" -a "z$OPENSSL_LIB_PATH" != "z" ; then OPENSSL_FOUND="yes" + AC_MSG_RESULT([yes ("-I$OPENSSL_INCLUDE_PATH -L$OPENSSL_LIB_PATH")]) + else + AC_MSG_RESULT([not found]) fi fi +dnl Priority 5: Just try to compile/link and hope for the best if test "z$OPENSSL_FOUND" = "zno" ; then - OPENSSL_INCLUDES_FOUND="no" - OPENSSL_LIBS_FOUND="no" - - for dir in $ac_openssl_inc_dir ; do - if test -f $dir/openssl/ssl.h ; then - dnl do not add -I/usr/include because compiler does it anyway - if test "z$dir" = "z/usr/include" ; then - OPENSSL_CFLAGS="$OPENSSL_CFLAGS " - else - OPENSSL_CFLAGS="$OPENSSL_CFLAGS -I$dir" - fi - OPENSSL_INCLUDES_FOUND="yes" - break - fi - done + AC_MSG_CHECKING(for openssl library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $OPENSSL_LIBS $OPENSSL_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <openssl/opensslv.h> + ]],[[ + int main () { + #if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); + #else + OPENSSL_init_ssl(0, NULL); + #endif + return(0); + } + ]]) + ],[ + OPENSSL_FOUND=yes + OPENSSL_LIBS="$OPENSSL_LIBS $OPENSSL_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + OPENSSL_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi - for dir in $ac_openssl_lib_dir ; do - if test -f $dir/libcrypto.a ; then - dnl do not add -L/usr/lib because compiler does it anyway - if test "z$dir" = "z/usr/lib" ; then - OPENSSL_LIBS="-lcrypto -ldl" - else - OPENSSL_LIBS="-L$dir -lcrypto -ldl" - fi - OPENSSL_LIBS_FOUND="yes" - ac_found_openssl_lib_dir=$dir - break; - fi - done - - if test "z$OPENSSL_INCLUDES_FOUND" = "zyes" -a "z$OPENSSL_LIBS_FOUND" = "zyes" ; then - OPENSSL_FOUND="yes" +dnl Set flags if INCLUDE_PATH or LIB_PATH are set +if test "z$OPENSSL_FOUND" = "zyes" -a "z$OPENSSL_INCLUDE_PATH" != "z" ; then + OPENSSL_CFLAGS="$OPENSSL_CFLAGS -I$OPENSSL_INCLUDE_PATH -I$OPENSSL_INCLUDE_PATH/openssl" +fi +if test "z$OPENSSL_FOUND" = "zyes" -a "z$OPENSSL_LIB_PATH" != "z" ; then + if test -f "$OPENSSL_LIB_PATH/$OPENSSL_LIB_SHARED_MARKER" ; then + if test "z$with_gnu_ld" = "zyes" ; then + OPENSSL_LIBS="$OPENSSL_LIBS -Wl,-rpath-link -Wl,$OPENSSL_LIB_PATH" + fi fi + OPENSSL_LIBS="$OPENSSL_LIBS -L$OPENSSL_LIB_PATH $OPENSSL_LIBS_LIST $OPENSSL_EXTRA_LIBS" fi -if test "z$OPENSSL_FOUND" = "zyes" -a "z$OPENSSL_VERSION" = "z" ; then - AC_MSG_CHECKING(for openssl libraries >= $OPENSSL_MIN_VERSION) - - dnl Check the OpenSSL version +dnl Check the OpenSSL version; if you change this code then you probably want to +dnl change include/xmlsec/openssl/crypto.h as well. +AC_MSG_CHECKING(for openssl library >= $OPENSSL_MIN_VERSION) +if test "z$OPENSSL_FOUND" = "zyes" ; then OLD_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$OPENSSL_CFLAGS" + CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS" + if test "z$OPENSSL_VERSION" = "z" ; then + AC_EGREP_CPP(greater-than-minvers, [ + #include <openssl/opensslv.h> + #if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L + greater-than-minvers + #endif + ],[ + OPENSSL_VERSION="1.0.0 (LibreSSL < 2.7)" + ],[ + OPENSSL_VERSION="" + ]) + fi if test "z$OPENSSL_VERSION" = "z" ; then - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP(greater-than-minvers, [ #include <openssl/opensslv.h> - #if OPENSSL_VERSION_NUMBER >= 0x10100000L - yes - #endif - ],[ - OPENSSL_VERSION="1.1.0" - ],[ - OPENSSL_VERSION="" - ]) + #if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L + greater-than-minvers + #endif + ],[ + OPENSSL_VERSION="1.1.0 (LibreSSL >= 2.7)" + ],[ + OPENSSL_VERSION="" + ]) fi if test "z$OPENSSL_VERSION" = "z" ; then - AC_EGREP_CPP(yes,[ - #include <openssl/opensslv.h> - #if OPENSSL_VERSION_NUMBER >= 0x10000000L - yes - #endif - ],[ - OPENSSL_VERSION="1.0.0" - ],[ - OPENSSL_VERSION="" - ]) + AC_EGREP_CPP(greater-than-minvers, [ + #include <openssl/opensslv.h> + #include <openssl/crypto.h> + #if OPENSSL_VERSION_NUMBER >= 0x10100000L + #ifdef OPENSSL_IS_BORINGSSL + greater-than-minvers + #endif + #endif + ],[ + OPENSSL_VERSION="1.1.0 (BoringSSL)" + enable_ripemd160=no + enable_dsa=no + ],[ + OPENSSL_VERSION="" + ]) fi if test "z$OPENSSL_VERSION" = "z" ; then - AC_EGREP_CPP(yes,[ - #include <openssl/opensslv.h> - #if OPENSSL_VERSION_NUMBER >= 0x00908000L - yes - #endif - ],[ - OPENSSL_VERSION="0.9.8" - ],[ - OPENSSL_VERSION="" - ]) + AC_EGREP_CPP(greater-than-minvers, [ + #include <openssl/opensslv.h> + #if OPENSSL_VERSION_NUMBER >= 0x10100000L + greater-than-minvers + #endif + ],[ + OPENSSL_VERSION="1.1.0" + ],[ + OPENSSL_VERSION="" + ]) fi if test "z$OPENSSL_VERSION" = "z" ; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT([yes ('$OPENSSL_VERSION')]) + AC_EGREP_CPP(greater-than-minvers, [ + #include <openssl/opensslv.h> + #if OPENSSL_VERSION_NUMBER >= 0x10000000L + greater-than-minvers + #endif + ],[ + OPENSSL_VERSION="1.0.0" + ],[ + OPENSSL_VERSION="" + ]) fi - CPPFLAGS=$OLD_CPPFLAGS -fi + if test "z$OPENSSL_VERSION" != "z" ; then + OPENSSL_FOUND=yes + else + OPENSSL_FOUND=no + fi +fi if test "z$OPENSSL_FOUND" = "zyes" ; then - dnl Check availability of ECDSA - OLD_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$OPENSSL_CFLAGS" - - AC_EGREP_CPP(yes,[ - #include <openssl/opensslconf.h> - #ifdef OPENSSL_NO_ECDSA - yes - #endif - ],[ - OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_NO_ECDSA=1" - ]) - CPPFLAGS=$OLD_CPPFLAGS + AC_MSG_RESULT([yes (openssl version '$OPENSSL_VERSION')]) +else + AC_MSG_RESULT([$OPENSSL_FOUND]) fi +dnl Finally set all the flags if test "z$OPENSSL_FOUND" = "zyes" ; then XMLSEC_NO_OPENSSL="0" - if test "z$OPENSSL_VERSION" = "z0.9.8" ; then - OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_ECDSA=1 -DXMLSEC_NO_SHA256=1" - fi - if test "z$OPENSSL_VERSION" = "z1.0.0" ; then - OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_100=1" - fi - if test "z$OPENSSL_VERSION" = "z1.1.0" ; then - OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_110=1" - fi OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_CRYPTO_OPENSSL=1" XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST openssl" else XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST openssl" fi -AM_CONDITIONAL(XMLSEC_NO_OPENSSL, test "z$XMLSEC_NO_OPENSSL" == "z1") +AM_CONDITIONAL(XMLSEC_NO_OPENSSL, test "z$XMLSEC_NO_OPENSSL" = "z1") AC_SUBST(XMLSEC_NO_OPENSSL) AC_SUBST(OPENSSL_CFLAGS) AC_SUBST(OPENSSL_LIBS) @@ -594,232 +881,291 @@ dnl AND / OR dnl dnl 2. separate NSS & NSPR distributions dnl options: [--with-nss=<PFX>] [--with-nspr=<PFX>] -dnl +dnl dnl 2 overrides 1 dnl dnl ========================================================================== -XMLSEC_NO_NSS="1" +NSS_MIN_VERSION="3.11.1" +NSPR_MIN_VERSION="4.4.1" SEAMONKEY_MIN_VERSION="1.0" MOZILLA_MIN_VERSION="1.4" -NSS_MIN_VERSION="3.9" -NSPR_MIN_VERSION="4.4.1" -NSS_CFLAGS="" -NSS_LIBS="" -NSS_LIBS_LIST="-lnss3 -lsmime3" -NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss" -NSS_FOUND="no" NSPR_PACKAGE=mozilla-nspr NSS_PACKAGE=mozilla-nss +NSPR_INCLUDE_MARKER="nspr/nspr.h" +NSPR_LIB_MARKER="libnspr4$shrext" +NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" +NSS_INCLUDE_MARKER="nss/nss.h" +NSS_LIB_MARKER="libnss3$shrext" +NSS_LIBS_LIST="-lnss3 -lsmime3" +XMLSEC_NO_NSS="1" +NSPR_INCLUDE_PATH= +NSPR_LIB_PATH= +NSS_INCLUDE_PATH= +NSS_LIB_PATH= +NSS_FOUND="no" +NSPR_FOUND="no" +AC_ARG_WITH([nss], [AC_HELP_STRING([--with-nss@<:@=PFX@:>@], [nss location])]) +AC_ARG_WITH([nspr], [AC_HELP_STRING([--with-nspr@<:@=PFX@:>@], [nspr location (needed for NSS)])]) +AC_ARG_WITH([seamonkey_ver], [AC_HELP_STRING([--with-seamonkey-ver@<:@=VER@:>@], [mozilla version (alt to --with-nss, --with-nspr)])]) +AC_ARG_WITH([mozilla_ver], [AC_HELP_STRING([--with-mozilla-ver@<:@=VER@:>@], [mozilla version (alt to --with-nss, --with-nspr)])]) -dnl if nss is disabled, bail out early -AC_ARG_WITH(nss, [ --with-nss=[PFX] nss location]) -AC_ARG_WITH(nspr, [ --with-nspr=[PFX] nspr location (needed for NSS)]) -AC_ARG_WITH(seamonkey_ver, [ --with-seamonkey-ver=[VER] mozilla version (alt to --with-nss, --with-nspr)]) -AC_ARG_WITH(mozilla_ver, [ --with-mozilla-ver=[VER] mozilla version (alt to --with-nss, --with-nspr)]) +dnl Priority 0: Check if library is disabled if test "z$with_nss" = "zno" -o "z$with_nspr" = "zno" ; then - AC_MSG_CHECKING(for NSS libraries) - AC_MSG_RESULT(no) - NSS_FOUND="without" -elif test "z$with_nss" = "z" -a "z$with_nspr" = "z" -a "z$with_mozilla_ver" = "z" -a "z$with_seamonkey_ver" = "z" -a "z$PKGCONFIG_FOUND" = "zyes" ; then - dnl - dnl Mozilla's NSS/NSPR are distributed under different names - dnl in different distribution: - dnl seamonkey-nspr and seamonkey-nss - dnl mozilla-nspr and mozilla-nss - dnl xulrunner-nspr and xulrunner-nss - dnl nspr and nss - dnl We are going to try all options - dnl + NSS_FOUND="disabled" + NSPR_FOUND="disabled" +fi + +dnl Priority 1: User specifies the path to installation +if test "z$NSPR_FOUND" = "zno" -a "z$with_nspr" != "z" -a "z$with_nspr" != "zyes" ; then + AC_MSG_CHECKING(for nspr library installation in "$with_nspr" folder) + if test -f "$with_nspr/include/$NSPR_INCLUDE_MARKER" -a -f "$with_nspr/lib/$NSPR_LIB_MARKER" ; then + NSPR_INCLUDE_PATH="$with_nspr/include" + NSPR_LIB_PATH="$with_nspr/lib" + NSPR_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_nspr/include/$NSPR_INCLUDE_MARKER" and/or "$with_nspr/lib/$NSPR_LIB_MARKER" files don't exist), typo?]) + fi +fi +if test "z$NSS_FOUND" = "zno" -a "z$with_nss" != "z" -a "z$with_nss" != "zyes" ; then + AC_MSG_CHECKING(for nss library installation in "$with_nss" folder) + if test -f "$with_nss/include/$NSS_INCLUDE_MARKER" -a -f "$with_nss/lib/$NSS_LIB_MARKER" ; then + NSS_INCLUDE_PATH="$with_nss/include" + NSS_LIB_PATH="$with_nss/lib" + NSS_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_nss/include/$NSS_INCLUDE_MARKER" and/or "$with_nss/lib/$NSS_LIB_MARKER" files don't exist), typo?]) + fi +fi + +dnl Priority 2: User sets both CFLAGS and LIBS flags +if test "z$NSPR_FOUND" = "zno" -a "z$NSPR_CFLAGS" != "z" -a "z$NSPR_LIBS" != "z" ; then + NSPR_FOUND="yes" +fi +if test "z$NSS_FOUND" = "zno" -a "z$NSS_CFLAGS" != "z" -a "z$NSS_LIBS" != "z" ; then + NSS_FOUND="yes" +fi + +dnl Priority 3: Guess with pkg_config +dnl +dnl Mozilla's NSS/NSPR are distributed under different names in different distribution, +dnl we are going to try all options: +dnl seamonkey-nspr and seamonkey-nss +dnl mozilla-nspr and mozilla-nss +dnl xulrunner-nspr and xulrunner-nss +dnl nspr and nss +if test "z$NSPR_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" -a "z$with_mozilla_ver" = "z" -a "z$with_seamonkey_ver" ; then + if test "z$NSPR_FOUND" = "zno" ; then + PKG_CHECK_MODULES(NSPR, seamonkey-nspr >= $NSPR_MIN_VERSION, + [NSPR_FOUND=yes NSPR_PACKAGE=seamonkey-nspr], + [NSPR_FOUND=no]) + fi + if test "z$NSPR_FOUND" = "zno" ; then + PKG_CHECK_MODULES(NSPR, mozilla-nspr >= $MOZILLA_MIN_VERSION, + [NSPR_FOUND=yes NSPR_PACKAGE=mozilla-nspr], + [NSPR_FOUND=no]) + fi + if test "z$NSPR_FOUND" = "zno" ; then + PKG_CHECK_MODULES(NSPR, xulrunner-nspr >= $NSPR_MIN_VERSION, + [NSPR_FOUND=yes NSPR_PACKAGE=xulrunner-nspr], + [NSPR_FOUND=no]) + fi + if test "z$NSPR_FOUND" = "zno" ; then + PKG_CHECK_MODULES(NSPR, nspr >= $NSPR_MIN_VERSION, + [NSPR_FOUND=yes NSPR_PACKAGE=nspr], + [NSPR_FOUND=no]) + fi +fi +if test "z$NSS_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" -a "z$with_mozilla_ver" = "z" -a "z$with_seamonkey_ver" ; then if test "z$NSS_FOUND" = "zno" ; then - PKG_CHECK_MODULES(NSS, seamonkey-nspr >= $NSPR_MIN_VERSION seamonkey-nss >= $SEAMONKEY_MIN_VERSION, - [NSS_FOUND=yes NSPR_PACKAGE=seamonkey-nspr NSS_PACKAGE=seamonkey-nss], - [NSS_FOUND=no]) + PKG_CHECK_MODULES(NSS, seamonkey-nss >= $SEAMONKEY_MIN_VERSION, + [NSS_FOUND=yes NSS_PACKAGE=seamonkey-nss], + [NSS_FOUND=no]) fi if test "z$NSS_FOUND" = "zno" ; then - PKG_CHECK_MODULES(NSS, mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION, - [NSS_FOUND=yes NSPR_PACKAGE=mozilla-nspr NSS_PACKAGE=mozilla-nss], - [NSS_FOUND=no]) + PKG_CHECK_MODULES(NSS, mozilla-nss >= $MOZILLA_MIN_VERSION, + [NSS_FOUND=yes NSS_PACKAGE=mozilla-nss], + [NSS_FOUND=no]) fi if test "z$NSS_FOUND" = "zno" ; then - PKG_CHECK_MODULES(NSS, xulrunner-nspr >= $NSPR_MIN_VERSION xulrunner-nss >= $NSS_MIN_VERSION, - [NSS_FOUND=yes NSPR_PACKAGE=xulrunner-nspr NSS_PACKAGE=xulrunner-nss], - [NSS_FOUND=no]) + PKG_CHECK_MODULES(NSS, xulrunner-nss >= $NSS_MIN_VERSION, + [NSS_FOUND=yes NSS_PACKAGE=xulrunner-nss], + [NSS_FOUND=no]) fi if test "z$NSS_FOUND" = "zno" ; then - PKG_CHECK_MODULES(NSS, nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION, - [NSS_FOUND=yes NSPR_PACKAGE=nspr NSS_PACKAGE=nss], - [NSS_FOUND=no]) + PKG_CHECK_MODULES(NSS, nss >= $NSS_MIN_VERSION, + [NSS_FOUND=yes NSS_PACKAGE=nss], + [NSS_FOUND=no]) fi fi -if test "z$NSS_FOUND" = "zno" ; then - dnl process the mozilla options if any - if test "z$with_seamonkey_ver" != "z" ; then - ac_mozilla_name=seamonkey-$with_seamonkey_ver - elif test "z$with_mozilla_ver" != "z" ; then - ac_mozilla_name=mozilla-$with_mozilla_ver - else - ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION - fi - - ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name" - ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name" - - AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION) - NSPR_INCLUDES_FOUND="no" - NSPR_LIBS_FOUND="no" - NSPR_FOUND="no" - NSPR_PRINIT_H="" - - if test "z$with_nspr" != "z" ; then - NSPR_PREFIX="$with_nspr" - NSPR_CFLAGS="-I$with_nspr/include -I$with_nspr/include/nspr" - if test "z$with_gnu_ld" = "zyes" ; then - NSPR_LIBS="-Wl,-rpath-link -Wl,$with_nspr/lib -L$with_nspr/lib $NSPR_LIBS_LIST" - else - NSPR_LIBS="-L$with_nspr/lib $NSPR_LIBS_LIST" - fi - NSPR_INCLUDES_FOUND="yes" - NSPR_LIBS_FOUND="yes" - NSPR_PRINIT_H="$with_nspr/include/prinit.h" +dnl Priority 4: Guess using a list of folders using mozilla/seamonkey version hints (if any) +if test "z$with_seamonkey_ver" != "z" ; then + NSS_MOZILLA_NAME=seamonkey-$with_seamonkey_ver +elif test "z$with_mozilla_ver" != "z" ; then + NSS_MOZILLA_NAME=mozilla-$with_mozilla_ver +else + NSS_MOZILLA_NAME=mozilla-$MOZILLA_MIN_VERSION +fi +NSS_INCLUDE_DIR="$COMMON_INCLUDE_DIR /usr/include/mozilla /usr/local/include/mozilla /usr/include/$NSS_MOZILLA_NAME /usr/local/include/$NSS_MOZILLA_NAME" +NSS_LIB_DIR="$COMMON_LIB_DIR /usr/lib/$NSS_MOZILLA_NAME /usr/local/lib/$NSS_MOZILLA_NAME" +if test "z$NSPR_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for nspr library installation in the typical folders) + if test "z$NSPR_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(NSPR_INCLUDE_PATH, $NSPR_INCLUDE_MARKER, $NSS_INCLUDE_DIR) + fi + if test "z$NSPR_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(NSPR_LIB_PATH, $NSPR_LIB_MARKER, $NSS_LIB_DIR) + fi + if test "z$NSPR_INCLUDE_PATH" != "z" -a "z$NSPR_LIB_PATH" != "z" ; then + NSPR_FOUND=yes + AC_MSG_RESULT([yes ("-I$NSPR_INCLUDE_PATH -L$NSPR_LIB_PATH")]) else - for dir in $ac_nss_inc_dir ; do - if test -f $dir/nspr/prinit.h ; then - dnl do not add -I/usr/include because compiler does it anyway - if test "z$dir" = "z/usr/include" ; then - NSPR_CFLAGS="" - else - NSPR_CFLAGS="-I$dir/nspr" - fi - NSPR_INCLUDES_FOUND="yes" - NSPR_PRINIT_H="$dir/nspr/prinit.h" - break - fi - done - - for dir in $ac_nss_lib_dir ; do - if test -f $dir/libnspr4$shrext ; then - dnl do not add -L/usr/lib because compiler does it anyway - if test "z$dir" = "z/usr/lib" ; then - NSPR_LIBS="$NSPR_LIBS_LIST" - else - if test "z$with_gnu_ld" = "zyes" ; then - NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST" - else - NSPR_LIBS="-L$dir $NSPR_LIBS_LIST" - fi - fi - NSPR_LIBS_FOUND="yes" - break - fi - done - fi - - if test "z$NSPR_INCLUDES_FOUND" = "zyes" -a "z$NSPR_LIBS_FOUND" = "zyes" ; then - OLD_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$NSPR_CFLAGS" - AC_EGREP_CPP(yes,[ - #include <prinit.h> - #if PR_VMAJOR >= 4 - yes - #endif - ],[ - NSPR_FOUND=yes - ],[ - NSPR_FOUND=no - ]) - CPPFLAGS="$OLD_CPPFLAGS" - fi - - if test "z$NSPR_FOUND" = "zyes" ; then - AC_MSG_RESULT(yes) + AC_MSG_RESULT([not found]) + fi +fi +if test "z$NSS_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for nss library installation in the typical folders) + if test "z$NSS_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(NSS_INCLUDE_PATH, $NSS_INCLUDE_MARKER, $NSS_INCLUDE_DIR) + fi + if test "z$NSS_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(NSS_LIB_PATH, $NSS_LIB_MARKER, $NSS_LIB_DIR) + fi + if test "z$NSS_INCLUDE_PATH" != "z" -a "z$NSS_LIB_PATH" != "z" ; then + NSS_FOUND=yes + AC_MSG_RESULT([yes ("-I$NSS_INCLUDE_PATH -L$NSS_LIB_PATH")]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([not found]) fi +fi - dnl look for nss - AC_MSG_CHECKING(for nss libraries >= $NSS_MIN_VERSION) - NSS_INCLUDES_FOUND="no" - NSS_LIBS_FOUND="no" - NSS_NSS_H="" +dnl Priority 5 (NSPR): Just try to compile/link and hope for the best +if test "z$NSPR_FOUND" = "zno" ; then + AC_MSG_CHECKING(for nspr library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $NSPR_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $NSPR_LIBS $NSPR_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <nspr/nspr.h> + ]],[[ + int main () { printf("v=%s\n", PR_GetVersion()); return(0); } + ]]) + ],[ + NSPR_FOUND=yes + NSPR_LIBS="$NSPR_LIBS $NSPR_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + NSPR_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi - if test "z$with_nss" != "z" ; then - NSS_CFLAGS="$NSS_CFLAGS -I$with_nss/include -I$with_nss/include/nss" - if test "z$with_gnu_ld" = "zyes" ; then - NSS_LIBS="$NSS_LIBS -Wl,-rpath-link -Wl,$with_nss/lib -L$with_nss/lib $NSS_LIBS_LIST" - else - NSS_LIBS="$NSS_LIBS -L$with_nss/lib $NSS_LIBS_LIST" - fi - NSS_INCLUDES_FOUND="yes" - NSS_LIBS_FOUND="yes" - NSS_NSS_H="$with_nss/include/nss.h" - else - for dir in $ac_nss_inc_dir ; do - if test -f $dir/nss/nss.h ; then - dnl do not add -I/usr/include because compiler does it anyway - if test "z$dir" = "z/usr/include" ; then - NSS_CFLAGS="$NSS_CFLAGS" - else - NSS_CFLAGS="$NSS_CFLAGS -I$dir/nss" - fi - NSS_INCLUDES_FOUND="yes" - NSS_NSS_H="$dir/nss/nss.h" - break - fi - done - - for dir in $ac_nss_lib_dir ; do - if test -f $dir/libnss3$shrext ; then - dnl do not add -L/usr/lib because compiler does it anyway - if test "z$dir" = "z/usr/lib" ; then - NSS_LIBS="$NSS_LIBS_LIST" - else - if test "z$with_gnu_ld" = "zyes" ; then - NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST" - else - NSS_LIBS="-L$dir $NSS_LIBS_LIST" - fi - fi - NSS_LIBS_FOUND="yes" - break - fi - done - fi - - if test "z$NSS_INCLUDES_FOUND" = "zyes" -a "z$NSS_LIBS_FOUND" = "zyes" ; then - OLD_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$NSPR_CFLAGS $NSS_CFLAGS" - AC_EGREP_CPP(yes,[ - #include <nss.h> - #if NSS_VMAJOR >= 3 && NSS_VMINOR >= 2 - yes - #endif - ],[ - NSS_FOUND=yes - ],[ - NSS_FOUND=no - ]) - CPPFLAGS="$OLD_CPPFLAGS" - fi - - if test "z$NSS_FOUND" = "zyes" ; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) +dnl NSRP: Set flags if INCLUDE_PATH or LIB_PATH are set (need to do it before we try to find NSS) +if test "z$NSPR_FOUND" = "zyes" -a "z$NSPR_INCLUDE_PATH" != "z" ; then + NSPR_CFLAGS="$NSPR_CFLAGS -I$NSPR_INCLUDE_PATH -I$NSPR_INCLUDE_PATH/nspr" +fi +if test "z$NSPR_FOUND" = "zyes" -a "z$NSPR_LIB_PATH" != "z" ; then + if test "z$with_gnu_ld" = "zyes" ; then + NSPR_LIBS="$NSPR_LIBS -Wl,-rpath-link -Wl,$NSPR_LIB_PATH" fi + NSPR_LIBS="$NSPR_LIBS -L$NSPR_LIB_PATH/lib $NSPR_LIBS_LIST" +fi + +dnl Priority 5 (NSS): Just try to compile/link and hope for the best +if test "z$NSS_FOUND" = "zno" ; then + AC_MSG_CHECKING(for nss library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $NSPR_CFLAGS $NSS_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $NSS_LIBS $NSPR_LIBS $NSS_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <nss/nss.h> + ]],[[ + int main () { printf("v=%s\n", NSS_GetVersion()); return(0); } + ]]) + ],[ + NSS_FOUND=yes + NSS_LIBS="$NSS_LIBS $NSS_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + NSS_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi - dnl check that we have found both NSS and NSPR - if test "z$NSPR_FOUND" = "zyes" -a "z$NSS_FOUND" = "zyes" ; then - NSS_CFLAGS="$NSS_CFLAGS $NSPR_CFLAGS" - NSS_LIBS="$NSS_LIBS $NSPR_LIBS" - elif test "z$NSPR_FOUND" != "zyes" -a "z$NSS_FOUND" = "zyes" ; then - NSS_FOUND="no" - AC_MSG_RESULT(NSPR library is required for NSS, ignoring NSS library we have found) +dnl NSS: Set flags if INCLUDE_PATH or LIB_PATH are set +if test "z$NSS_FOUND" = "zyes" -a "z$NSS_INCLUDE_PATH" != "z" ; then + NSS_CFLAGS="$NSS_CFLAGS -I$NSS_INCLUDE_PATH -I$NSS_INCLUDE_PATH/nss" +fi +if test "z$NSS_FOUND" = "zyes" -a "z$NSS_LIB_PATH" != "z" ; then + if test "z$with_gnu_ld" = "zyes" ; then + NSS_LIBS="$NSS_LIBS -Wl,-rpath-link -Wl,$NSS_LIB_PATH" fi + NSS_LIBS="$NSS_LIBS -L$NSS_LIB_PATH/lib $NSS_LIBS_LIST" fi +dnl Check NSS and NSPR versions +AC_MSG_CHECKING(for nspr library >= $NSPR_MIN_VERSION) +if test "z$NSPR_FOUND" = "zyes" ; then + minvers=`echo $NSPR_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 100 + $2) * 100 + $3;}'` + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $NSPR_CFLAGS" + AC_EGREP_CPP(greater-than-minvers, [ + #include <prinit.h> + #if ((PR_VMAJOR * 100 + PR_VMINOR) * 100 + PR_VPATCH) >= $minvers + greater-than-minvers + #endif + ],[ + NSPR_FOUND=yes + ],[ + NSPR_FOUND=no + ]) + CPPFLAGS="$OLD_CPPFLAGS" +fi +AC_MSG_RESULT([$NSPR_FOUND]) + +AC_MSG_CHECKING(for nss library >= $NSS_MIN_VERSION) +if test "z$NSS_FOUND" = "zyes" ; then + minvers=`echo $NSS_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 100 + $2) * 100 + $3;}'` + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $NSPR_CFLAGS $NSS_CFLAGS" + AC_EGREP_CPP(greater-than-minvers, [ + #include <nss.h> + #if ((NSS_VMAJOR * 100 + NSS_VMINOR) * 100 + NSS_VPATCH) >= $minvers + greater-than-minvers + #endif + ],[ + NSS_FOUND=yes + ],[ + NSS_FOUND=no + ]) + CPPFLAGS="$OLD_CPPFLAGS" +fi +AC_MSG_RESULT([$NSS_FOUND]) + +dnl Check that we have found both NSS and NSPR +if test "z$NSPR_FOUND" = "zyes" -a "z$NSS_FOUND" = "zyes" ; then + NSS_CFLAGS="$NSS_CFLAGS $NSPR_CFLAGS" + NSS_LIBS="$NSS_LIBS $NSPR_LIBS" +elif test "z$NSPR_FOUND" != "zyes" -a "z$NSS_FOUND" = "zyes" ; then + NSS_FOUND="no" + AC_MSG_RESULT([NSPR library is required for NSS, ignoring NSS library we have found]) +fi + +dnl Finally set all the flags if test "z$NSS_FOUND" = "zyes" ; then XMLSEC_NO_NSS="0" NSS_CFLAGS="$NSS_CFLAGS -DXMLSEC_CRYPTO_NSS=1" @@ -839,66 +1185,175 @@ AC_SUBST(NSS_MIN_VERSION) AC_SUBST(NSPR_MIN_VERSION) AC_SUBST(MOZILLA_MIN_VERSION) - dnl ========================================================================== dnl See if we can find GCrypt dnl ========================================================================== -GCRYPT_CONFIG="libgcrypt-config" -XMLSEC_NO_GCRYPT="1" GCRYPT_MIN_VERSION="1.4.0" -GCRYPT_VERSION="" -GCRYPT_CFLAGS="" -GCRYPT_LIBS="" +GCRYPT_INCLUDE_DIR="$COMMON_INCLUDE_DIR /usr/local/gcrypt/include" +GCRYPT_LIB_DIR="$COMMON_LIB_DIR /usr/local/gcrypt/lib" +GCRYPT_CONFIG="libgcrypt-config" +GCRYPT_INCLUDE_MARKER="gcrypt.h" +GCRYPT_LIB_MARKER="libgcrypt$shrext" GCRYPT_CRYPTO_LIB="$XMLSEC_PACKAGE-gcrypt" +GCRYPT_LIBS_LIST="-lgcrypt" + +XMLSEC_NO_GCRYPT="1" +GCRYPT_VERSION= +GCRYPT_INCLUDE_PATH= +GCRYPT_LIB_PATH= GCRYPT_FOUND="no" -AC_ARG_WITH(gcrypt, [ --with-gcrypt=[PFX] gcrypt location]) +AC_ARG_WITH([gcrypt], [AC_HELP_STRING([--with-gcrypt@<:@=PFX@:>@], [gcrypt location])]) + +dnl Priority 0: Check if library is not needed if test "z$with_gcrypt" = "zno" ; then - AC_MSG_CHECKING(for gcrypt libraries >= $GCRYPT_MIN_VERSION) - AC_MSG_RESULT(no) - GCRYPT_FOUND="without" -elif test "z$with_gcrypt" = "z" -a "z$PKGCONFIG_FOUND" = "zyes" ; then - PKG_CHECK_MODULES(GCRYPT, gcrypt >= $GCRYPT_MIN_VERSION, - [GCRYPT_FOUND=yes], - [GCRYPT_FOUND=no]) + GCRYPT_FOUND="disabled" +fi - if test "z$GCRYPT_FOUND" = "zno" ; then - PKG_CHECK_MODULES(GCRYPT, libgcrypt >= $GCRYPT_MIN_VERSION, - [GCRYPT_FOUND=yes], - [GCRYPT_FOUND=no]) +dnl Priority 1: User specifies the path to installation +if test "z$GCRYPT_FOUND" = "zno" -a "z$with_gcrypt" != "z" -a "z$with_gcrypt" != "zyes" ; then + AC_MSG_CHECKING(for libgcrypt library installation in "$with_gcrypt" folder) + if test "z$ENABLE_CUSTOM_CONFIGS" = "zyes" -a -f "$with_gcrypt/bin/$GCRYPT_CONFIG" ; then + GCRYPT_CONFIG_PATH="$with_gcrypt/bin/$GCRYPT_CONFIG" + GCRYPT_FOUND="yes" + AC_MSG_RESULT([yes]) + elif test -f "$with_gcrypt/include/$GCRYPT_INCLUDE_MARKER" -a -f "$with_gcrypt/lib/$GCRYPT_LIB_MARKER" ; then + GCRYPT_INCLUDE_PATH="$with_gcrypt/include" + GCRYPT_LIB_PATH="$with_gcrypt/lib" + GCRYPT_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_gcrypt/bin/$GCRYPT_CONFIG" tool, or "$with_gcrypt/include/$GCRYPT_INCLUDE_MARKER" and/or "$with_gcrypt/lib/$GCRYPT_LIB_MARKER" files don't exist), typo?]) fi +fi + +dnl Priority 2: User sets both CFLAGS and LIBS flags +if test "z$GCRYPT_FOUND" = "zno" -a "z$GCRYPT_CFLAGS" != "z" -a "z$GCRYPT_LIBS" != "z" ; then + GCRYPT_FOUND="yes" +fi +dnl Priority 3: Guess with pkg_config +if test "z$GCRYPT_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" ; then + if test "z$GCRYPT_FOUND" = "zno" ; then + PKG_CHECK_MODULES(GCRYPT, gcrypt >= $GCRYPT_MIN_VERSION, + [GCRYPT_FOUND=yes], + [GCRYPT_FOUND=no]) + fi + if test "z$GCRYPT_FOUND" = "zno" ; then + PKG_CHECK_MODULES(GCRYPT, libgcrypt20 >= $GCRYPT_MIN_VERSION, + [GCRYPT_FOUND=yes], + [GCRYPT_FOUND=no]) + fi if test "z$GCRYPT_FOUND" = "zno" ; then PKG_CHECK_MODULES(GCRYPT, libgcrypt11 >= $GCRYPT_MIN_VERSION, - [GCRYPT_FOUND=yes], - [GCRYPT_FOUND=no]) + [GCRYPT_FOUND=yes], + [GCRYPT_FOUND=no]) + fi + if test "z$GCRYPT_FOUND" = "zno" ; then + PKG_CHECK_MODULES(GCRYPT, libgcrypt >= $GCRYPT_MIN_VERSION, + [GCRYPT_FOUND=yes], + [GCRYPT_FOUND=no]) fi fi +dnl Priority 4: Guess the config tool location +if test "z$GCRYPT_FOUND" = "zno" -a "z$ENABLE_CUSTOM_CONFIGS" = "zyes" ; then + AC_PATH_PROG(GCRYPT_CONFIG_PATH, [$GCRYPT_CONFIG], [], [$PATH]) + if test "z$GCRYPT_CONFIG_PATH" != "z" ; then + GCRYPT_FOUND="yes" + fi +fi + +dnl Priority 5: Guess using a list of folders. +if test "z$GCRYPT_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for libgcrypt library installation in the typical folders) + if test "z$GCRYPT_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(GCRYPT_INCLUDE_PATH, $GCRYPT_INCLUDE_MARKER, $GCRYPT_INCLUDE_DIR) + fi + if test "z$GCRYPT_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(GCRYPT_LIB_PATH, $GCRYPT_LIB_MARKER, $GCRYPT_LIB_DIR) + fi + if test "z$GCRYPT_INCLUDE_PATH" != "z" -a "z$GCRYPT_LIB_PATH" != "z" ; then + GCRYPT_FOUND="yes" + AC_MSG_RESULT([yes ("-I$GCRYPT_INCLUDE_PATH -L$GCRYPT_LIB_PATH")]) + else + AC_MSG_RESULT([not found]) + fi +fi + +dnl Priority 6: Just try to compile/link and hope for the best if test "z$GCRYPT_FOUND" = "zno" ; then - AC_MSG_CHECKING(for gcrypt libraries >= $GCRYPT_MIN_VERSION) - if test "z$with_gcrypt" != "z" ; then - GCRYPT_CONFIG=$with_gcrypt/bin/$GCRYPT_CONFIG - fi - if ! $GCRYPT_CONFIG --version > /dev/null 2>&1 ; then - if test "z$with_gcrypt" != "z" ; then - AC_MSG_ERROR(Unable to find gcrypt at '$with_gcrypt') - else - AC_MSG_RESULT(no) - fi + AC_MSG_CHECKING(for gcrypt library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $GCRYPT_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $GCRYPT_LIBS $GCRYPT_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <gcrypt.h> + ]],[[ + int main () { printf("v=%s\n", gcry_check_version("0")); return(0); } + ]]) + ],[ + GCRYPT_FOUND=yes + GCRYPT_LIBS="$GCRYPT_LIBS $GCRYPT_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + GCRYPT_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi + +dnl Set CFLAGS/LIBS flags +if test "z$GCRYPT_FOUND" = "zyes" ; then + if test "z$GCRYPT_CONFIG_PATH" != "z" -a "z$ENABLE_CUSTOM_CONFIGS" = "zyes" ; then + dnl Get the values using config tool (overwrite CFLAGS/LIBS!) + if test "z$GCRYPT_CFLAGS" = "z" ; then + GCRYPT_CFLAGS="`$GCRYPT_CONFIG_PATH --cflags`" + fi + if test "z$GCRYPT_LIBS" = "z"; then + GCRYPT_LIBS="`$GCRYPT_CONFIG_PATH --libs`" + fi + GCRYPT_CONFIG=$GCRYPT_CONFIG_PATH + GCRYPT_FOUND="yes" else - vers=`$GCRYPT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - minvers=`echo $GCRYPT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$vers" -ge "$minvers" ; then - GCRYPT_CFLAGS="$GCRYPT_CFLAGS `$GCRYPT_CONFIG --cflags`" - GCRYPT_LIBS="$GCRYPT_LIBS `$GCRYPT_CONFIG --libs`" - GCRYPT_FOUND=yes - else - AC_MSG_ERROR(You need at least gcrypt $GCRYPT_MIN_VERSION for this version of $XMLSEC_PACKAGE) - fi + dnl Set flags if INCLUDE_PATH or LIB_PATH are set (do NOT overwrite CFLAGS/LIBS!) + if test "z$GCRYPT_INCLUDE_PATH" != "z" ; then + GCRYPT_CFLAGS="$GCRYPT_CFLAGS -I$GCRYPT_INCLUDE_PATH" + fi + if test "z$GCRYPT_LIB_PATH" != "z" ; then + if test "z$with_gnu_ld" = "zyes" ; then + GCRYPT_LIBS="$GCRYPT_LIBS -Wl,-rpath-link -Wl,$GCRYPT_LIB_PATH" + fi + GCRYPT_LIBS="$GCRYPT_LIBS -L$GCRYPT_LIB_PATH $GCRYPT_LIBS_LIST" + fi fi fi -if test "z$GCRYPT_FOUND" = "zyes" ; then +dnl Verify the version +AC_MSG_CHECKING(for libgcrypt library >= $GCRYPT_MIN_VERSION) +if test "z$GCRYPT_FOUND" = "zyes" ; then + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $GCRYPT_CFLAGS" + dnl gcrypt uses hex digits for version number + minvers=`echo $GCRYPT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 256 + $2) * 256 + $3;}'` + AC_EGREP_CPP(greater-than-minvers, [ + #include <gcrypt.h> + #if GCRYPT_VERSION_NUMBER >= $minvers + greater-than-minvers + #endif + ],[ + GCRYPT_FOUND=yes + ], [ + GCRYPT_FOUND=no + ]) + CPPFLAGS=$OLD_CPPFLAGS +fi +AC_MSG_RESULT([$GCRYPT_FOUND]) + +dnl Finally set variables +if test "z$GCRYPT_FOUND" = "zyes" ; then XMLSEC_NO_GCRYPT="0" GCRYPT_CFLAGS="$GCRYPT_CFLAGS -DXMLSEC_CRYPTO_GCRYPT=1" XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST gcrypt" @@ -913,68 +1368,148 @@ AC_SUBST(GCRYPT_LIBS) AC_SUBST(GCRYPT_CRYPTO_LIB) AC_SUBST(GCRYPT_MIN_VERSION) - dnl ========================================================================== dnl See if we can find GnuTLS dnl ========================================================================== -GNUTLS_CONFIG="libgnutls-config" -XMLSEC_NO_GNUTLS="1" GNUTLS_MIN_VERSION="2.8.0" -GNUTLS_VERSION="" -GNUTLS_CFLAGS="" -GNUTLS_LIBS="" +GNUTLS_INCLUDE_DIR="$COMMON_INCLUDE_DIR /usr/local/gnutls/include" +GNUTLS_LIB_DIR="$COMMON_LIB_DIR /usr/local/gnutls/lib" +GNUTLS_INCLUDE_MARKER="gnutls/gnutls.h" +GNUTLS_LIB_MARKER="libgnutls$shrext" GNUTLS_CRYPTO_LIB="$XMLSEC_PACKAGE-gnutls" +GNUTLS_LIBS_LIST="-lgnutls" + +XMLSEC_NO_GNUTLS="1" +GNUTLS_INCLUDE_PATH= +GNUTLS_LIB_PATH= GNUTLS_FOUND="no" -AC_ARG_WITH(gnutls, [ --with-gnutls=[PFX] gnutls location]) +AC_ARG_WITH([gnutls], [AC_HELP_STRING([--with-gnutls@<:@=PFX@:>@], [gnutls location])]) + +dnl Priority 0: Check if library is not needed if test "z$with_gnutls" = "zno" ; then - AC_MSG_CHECKING(for gnutls libraries >= $GNUTLS_MIN_VERSION) - AC_MSG_RESULT(no) - GNUTLS_FOUND="without" -elif test "z$with_gnutls" = "z" -a "z$PKGCONFIG_FOUND" = "zyes" ; then - PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_MIN_VERSION, - [GNUTLS_FOUND=yes], - [GNUTLS_FOUND=no]) - if test "z$GNUTLS_FOUND" = "zno" ; then + GNUTLS_FOUND="disabled" +fi + +dnl Priority 1: User specifies the path to installation +if test "z$GNUTLS_FOUND" = "zno" -a "z$with_gnutls" != "z" -a "z$with_gnutls" != "zyes" ; then + AC_MSG_CHECKING(for libgnutls library installation in "$with_gnutls" folder) + if test -f "$with_gnutls/include/$GNUTLS_INCLUDE_MARKER" -a -f "$with_gnutls/lib/$GNUTLS_LIB_MARKER" ; then + GNUTLS_INCLUDE_PATH="$with_gnutls/include" + GNUTLS_LIB_PATH="$with_gnutls/lib" + GNUTLS_FOUND="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([not found: "$with_gnutls/bin/$GNUTLS_CONFIG" tool, or "$with_gnutls/include/$GNUTLS_INCLUDE_MARKER" and/or "$with_gnutls/lib/$GNUTLS_LIB_MARKER" files don't exist), typo?]) + fi +fi + +dnl Priority 2: User sets both CFLAGS and LIBS flags +if test "z$GNUTLS_FOUND" = "zno" -a "z$GNUTLS_CFLAGS" != "z" -a "z$GNUTLS_LIBS" != "z" ; then + GNUTLS_FOUND="yes" +fi + +dnl Priority 3: Guess with pkg_config +if test "z$GNUTLS_FOUND" = "zno" -a "z$PKGCONFIG_FOUND" = "zyes" ; then + if test "z$GNUTLS_FOUND" = "zno" ; then + PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_MIN_VERSION, + [GNUTLS_FOUND=yes], + [GNUTLS_FOUND=no]) + fi + if test "z$GNUTLS_FOUND" = "zno" ; then PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION, - [GNUTLS_FOUND=yes], - [GNUTLS_FOUND=no]) + [GNUTLS_FOUND=yes], + [GNUTLS_FOUND=no]) fi fi -if test "z$GNUTLS_FOUND" = "zno" ; then - AC_MSG_CHECKING(for gnutls libraries >= $GNUTLS_MIN_VERSION) - if test "z$with_gnutls" != "z" ; then - GNUTLS_CONFIG=$with_gnutls/bin/$GNUTLS_CONFIG - fi - if ! $GNUTLS_CONFIG --version > /dev/null 2>&1 ; then - if test "z$with_gnutls" != "z" ; then - AC_MSG_ERROR(Unable to find gnutls at '$with_gnutls') - else - AC_MSG_RESULT(no) - fi +dnl Priority 4: Guess using a list of folders. +if test "z$GNUTLS_FOUND" = "zno" -a "z$ENABLE_FOLDERS_SEARCH" = "zyes" ; then + AC_MSG_CHECKING(for libgnutls library installation in the typical folders) + if test "z$GNUTLS_INCLUDE_PATH" = "z" ; then + AX_FIND_FOLDER(GNUTLS_INCLUDE_PATH, $GNUTLS_INCLUDE_MARKER, $GNUTLS_INCLUDE_DIR) + fi + if test "z$GNUTLS_LIB_PATH" = "z" ; then + AX_FIND_FOLDER(GNUTLS_LIB_PATH, $GNUTLS_LIB_MARKER, $GNUTLS_LIB_DIR) + fi + if test "z$GNUTLS_INCLUDE_PATH" != "z" -a "z$GNUTLS_LIB_PATH" != "z" ; then + GNUTLS_FOUND="yes" + AC_MSG_RESULT([yes ("-I$GNUTLS_INCLUDE_PATH -L$GNUTLS_LIB_PATH")]) else - vers=`$GNUTLS_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - minvers=`echo $GNUTLS_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$vers" -ge "$minvers" ; then - GNUTLS_CFLAGS="$GNUTLS_CFLAGS `$GNUTLS_CONFIG --cflags`" - GNUTLS_LIBS="$GNUTLS_LIBS `$GNUTLS_CONFIG --libs`" - GNUTLS_FOUND=yes - else - AC_MSG_ERROR(You need at least gnutls $GNUTLS_MIN_VERSION for this version of $XMLSEC_PACKAGE) - fi + AC_MSG_RESULT([not found]) fi fi -if test "z$GNUTLS_FOUND" = "zyes" ; then - XMLSEC_NO_GNUTLS="0" - GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_CRYPTO_GNUTLS=1" - XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST gnutls" +dnl Priority 5: Just try to compile/link and hope for the best +if test "z$GNUTLS_FOUND" = "zno" ; then + AC_MSG_CHECKING(for gnutls library installation) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $GCRYPT_CFLAGS $GNUTLS_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $GNUTLS_LIBS $GCRYPT_LIBS $GNUTLS_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <gnutls/gnutls.h> + ]],[[ + int main () { gnutls_global_init(); return(0); } + ]]) + ],[ + GNUTLS_FOUND=yes + GNUTLS_LIBS="$GNUTLS_LIBS $GNUTLS_LIBS_LIST" + AC_MSG_RESULT([yes]) + ],[ + GNUTLS_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi - dnl xmlsec-gnutls is using xmlsec-gcrypt - if test "z$GCRYPT_FOUND" != "zyes" ; then - AC_MSG_ERROR(xmlsec-gnutls library requires xmlsec-gcrypt library which is disabled or missing) +dnl Set CFLAGS/LIBS flags +if test "z$GNUTLS_FOUND" = "zyes" ; then + dnl Set flags if INCLUDE_PATH or LIB_PATH are set (do NOT overwrite CFLAGS/LIBS!) + if test "z$GNUTLS_INCLUDE_PATH" != "z" ; then + GNUTLS_CFLAGS="$GNUTLS_CFLAGS -I$GNUTLS_INCLUDE_PATH" fi + if test "z$GNUTLS_LIB_PATH" != "z" ; then + if test "z$with_gnu_ld" = "zyes" ; then + GNUTLS_LIBS="$GNUTLS_LIBS -Wl,-rpath-link -Wl,$GNUTLS_LIB_PATH" + fi + GNUTLS_LIBS="$GNUTLS_LIBS -L$GNUTLS_LIB_PATH $GNUTLS_LIBS_LIST" + fi +fi +dnl Verify the version +AC_MSG_CHECKING(for libgnutls library >= $GNUTLS_MIN_VERSION) +if test "z$GNUTLS_FOUND" = "zyes" ; then + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS" + dnl gnutls uses hex digits for version number + minvers=`echo $GNUTLS_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 256 + $2) * 256 + $3;}'` + AC_EGREP_CPP(greater-than-minvers, [ + #include <gnutls/gnutls.h> + #if GNUTLS_VERSION_NUMBER >= $minvers + greater-than-minvers + #endif + ],[ + GNUTLS_FOUND=yes + ],[ + GNUTLS_FOUND=no + ]) + CPPFLAGS=$OLD_CPPFLAGS +fi +AC_MSG_RESULT([$GNUTLS_FOUND]) + +dnl Check that we have found gcrypt +if test "z$GNUTLS_FOUND" = "zyes" -a "z$GCRYPT_FOUND" != "zyes" ; then + GNUTLS_FOUND="no" + AC_MSG_RESULT([xmlsec-gnutls library requires xmlsec-gcrypt library which is disabled or missing, ignoring libgnutls library we have found]) +fi + +dnl Finally set all the flags +if test "z$GNUTLS_FOUND" = "zyes" ; then + XMLSEC_NO_GNUTLS="0" + GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_CRYPTO_GNUTLS=1" + XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST gnutls" else XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST gnutls" fi @@ -990,47 +1525,75 @@ AC_SUBST(GNUTLS_MIN_VERSION) dnl ========================================================================== dnl See if we can find MSCrypto dnl ========================================================================== -XMLSEC_NO_MSCRYPTO="1" -MSCRYPTO_CFLAGS="" -MSCRYPTO_LIBS="" MSCRYPTO_CRYPTO_LIB="$XMLSEC_PACKAGE-mscrypto" -MSCRYPTO_ENABLE='none' -AC_ARG_ENABLE(mscrypto, - [ --enable-mscrypto enable mscrypto (no)], - [MSCRYPTO_ENABLE=$enableval]) -if test "z$MSCRYPTO_ENABLE" != "zyes" ; then - AC_MSG_CHECKING(for mscrypto libraries) - AC_MSG_RESULT([$MSCRYPTO_ENABLE]) -else -dnl cannot detect __stdcall functions -dnl AC_CHECK_LIB(crypt32, CertOpenStore, .... - LIBS_SAVE="$LIBS" - LIBS="$LIBS -lcrypt32" - AC_MSG_CHECKING(for mscrypto libraries) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ - #include <windows.h> - #include <wincrypt.h>],[ - int main () { CertOpenStore(0,0,0,0,0);; return(0); } - ])], - [], - [MSCRYPTO_ENABLE="no"]) - AC_MSG_RESULT([$MSCRYPTO_ENABLE]) - LIBS="$LIBS_SAVE" -fi - -if test "z$MSCRYPTO_ENABLE" = "zyes" ; then - XMLSEC_NO_MSCRYPTO="0" +case $host in +*-w64-mingw*) + MSCRYPTO_XMLSEC_DEFINES= + MSCRYPTO_LIBS_LIST="-lcrypt32" + ;; +*-*-mingw*) + dnl use own def-file and header as mingw.org crypt32 + dnl is limited (library and header) + MSCRYPTO_XMLSEC_DEFINES="-DXMLSEC_CUSTOM_CRYPT32=1" + MSCRYPTO_LIBS_LIST="-Wl,$(srcdir)/mingw-crypt32.def" + ;; +*) + MSCRYPTO_XMLSEC_DEFINES= + MSCRYPTO_LIBS_LIST="-lcrypt32" + ;; +esac - MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1" - case $host in - *-*-mingw*) - dnl since mingw crypt32 library is limited - dnl we use own def-file - MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';; - *) - MSCRYPTO_LIBS="-lcrypt32";; - esac +XMLSEC_NO_MSCRYPTO="1" +MSCRYPTO_FOUND="no" +AC_ARG_ENABLE([mscrypto], [AC_HELP_STRING([--enable-mscrypto], [enable mscrypto (no)])]) + +dnl Priority 0: Check if library is not needed +if test "z$enable_mscrypto" = "zno" ; then + MSCRYPTO_FOUND="disabled" +fi + +dnl Priority 1: User sets both CFLAGS and LIBS flags +if test "z$MSCRYPTO_FOUND" = "zno" -a "z$MSCRYPTO_CFLAGS" != "z" -a "z$MSCRYPTO_LIBS" != "z" ; then + MSCRYPTO_FOUND=yes +fi +dnl Priority 2: Just try to compile/link and hope for the best +if test "z$MSCRYPTO_FOUND" = "zno" ; then + AC_MSG_CHECKING(for mscrypto) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $MSCRYPTO_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $MSCRYPTO_LIBS $MSCRYPTO_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <windows.h> + #include <wincrypt.h> + ]],[[ + int main () { CertOpenStore(0,0,0,0,0);; return(0); } + ]]) + ],[ + MSCRYPTO_FOUND=yes + AC_MSG_RESULT([yes]) + ],[ + MSCRYPTO_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi + +dnl Set CFLAGS/LIBS flags, do not change CFLAGS/LIBS if both are set +if test "z$MSCRYPTO_FOUND" = "zyes" ; then + if test "z$MSCRYPTO_CFLAGS" = "z" -o "z$MSCRYPTO_LIBS" = "z" ; then + XMLSEC_DEFINES="$XMLSEC_DEFINES $MSCRYPTO_XMLSEC_DEFINES" + MSCRYPTO_LIBS="$MSCRYPTO_LIBS $MSCRYPTO_LIBS_LIST" + fi +fi + +dnl Finally set all the flags +if test "z$MSCRYPTO_FOUND" = "zyes" ; then + XMLSEC_NO_MSCRYPTO="0" + MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1" XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST mscrypto" else XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST mscrypto" @@ -1044,6 +1607,81 @@ AC_SUBST(MSCRYPTO_CRYPTO_LIB) dnl ========================================================================== +dnl See if we can find MSCng +dnl ========================================================================== +MSCNG_CRYPTO_LIB="$XMLSEC_PACKAGE-mscng" +dnl This is tested on w64-mingw only so far. +MSCNG_XMLSEC_DEFINES= +MSCNG_LIBS_LIST="-lcrypt32 -lbcrypt -lncrypt" + +XMLSEC_NO_MSCNG="1" +MSCNG_FOUND="no" +AC_ARG_ENABLE([mscng], [AC_HELP_STRING([--enable-mscng], [enable mscng (no)])]) + +dnl Priority 0: Check if library is not needed +if test "z$enable_mscng" = "zno" ; then + MSCNG_FOUND="disabled" +fi + +dnl Priority 1: User sets both CFLAGS and LIBS flags +if test "z$MSCNG_FOUND" = "zno" -a "z$MSCNG_CFLAGS" != "z" -a "z$MSCNG_LIBS" != "z" ; then + MSCNG_FOUND=yes +fi + +dnl Priority 2: Just try to compile/link and hope for the best +if test "z$MSCNG_FOUND" = "zno" ; then + AC_MSG_CHECKING(for mscng) + OLD_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $MSCNG_CFLAGS" + OLD_LIBS=$LIBS + LIBS="$LIBS $MSCNG_LIBS $MSCNG_LIBS_LIST" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <windows.h> + #include <wincrypt.h> + ]],[[ + int main () { + BCRYPT_ALG_HANDLE hAlg; + BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_SHA256_ALGORITHM, NULL, 0); + return(0); + } + ]]) + ],[ + MSCNG_FOUND=yes + AC_MSG_RESULT([yes]) + ],[ + MSCNG_FOUND=no + AC_MSG_RESULT([not found]) + ]) + CPPFLAGS=$OLD_CPPFLAGS + LIBS=$OLD_LIBS +fi + +dnl Set CFLAGS/LIBS flags, do not change CFLAGS/LIBS if both are set +if test "z$MSCNG_FOUND" = "zyes" ; then + if test "z$MSCNG_CFLAGS" = "z" -o "z$MSCNG_LIBS" = "z" ; then + XMLSEC_DEFINES="$XMLSEC_DEFINES $MSCNG_XMLSEC_DEFINES" + MSCNG_LIBS="$MSCNG_LIBS $MSCNG_LIBS_LIST" + fi +fi + +dnl Finally set all the flags +if test "z$MSCNG_FOUND" = "zyes" ; then + XMLSEC_NO_MSCNG="0" + MSCNG_CFLAGS="$MSCNG_CFLAGS -DXMLSEC_CRYPTO_MSCNG=1" + XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST mscng" +else + XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST mscng" +fi + +AM_CONDITIONAL(XMLSEC_NO_MSCNG, [test "z$XMLSEC_NO_MSCNG" = "z1"]) +AC_SUBST(XMLSEC_NO_MSCNG) +AC_SUBST(MSCNG_CFLAGS) +AC_SUBST(MSCNG_LIBS) +AC_SUBST(MSCNG_CRYPTO_LIB) + + +dnl ========================================================================== dnl Figure out the default crypt - the first crypto library wins dnl ========================================================================== XMLSEC_DEFAULT_CRYPTO="" @@ -1051,7 +1689,7 @@ XMLSEC_CRYPTO_LIB="" XMLSEC_CRYPTO_CFLAGS="" XMLSEC_CRYPTO_LIBS="" AC_MSG_CHECKING(for default crypto library) -AC_ARG_WITH(default_crypto, [ --with-default-crypto=name default crypto name]) +AC_ARG_WITH([default_crypto], [AC_HELP_STRING([--with-default-crypto=name], [default crypto name])]) # check the argument case "z$with_default_crypto" in @@ -1062,6 +1700,13 @@ case "z$with_default_crypto" in AC_MSG_ERROR('$with_default_crypto' is specified as default crypto library but it is not configured or found) fi ;; + 'zmscng') + if test "z$XMLSEC_NO_MSCNG" != "z1" ; then + XMLSEC_DEFAULT_CRYPTO="mscng" + else + AC_MSG_ERROR('$with_default_crypto' is specified as default crypto library but it is not configured or found) + fi + ;; 'zopenssl') if test "z$XMLSEC_NO_OPENSSL" != "z1" ; then XMLSEC_DEFAULT_CRYPTO="openssl" @@ -1094,6 +1739,8 @@ case "z$with_default_crypto" in dnl The first crypto library wins if test "z$XMLSEC_NO_MSCRYPTO" != "z1" ; then XMLSEC_DEFAULT_CRYPTO="mscrypto" + elif test "z$XMLSEC_NO_MSCNG" != "z1" ; then + XMLSEC_DEFAULT_CRYPTO="mscng" elif test "z$XMLSEC_NO_OPENSSL" != "z1" ; then XMLSEC_DEFAULT_CRYPTO="openssl" elif test "z$XMLSEC_NO_NSS" != "z1" ; then @@ -1118,6 +1765,11 @@ case "$XMLSEC_DEFAULT_CRYPTO" in XMLSEC_CRYPTO_CFLAGS="$MSCRYPTO_CFLAGS" XMLSEC_CRYPTO_LIBS="$MSCRYPTO_LIBS" ;; + 'mscng') + XMLSEC_CRYPTO_LIB="$MSCNG_CRYPTO_LIB" + XMLSEC_CRYPTO_CFLAGS="$MSCNG_CFLAGS" + XMLSEC_CRYPTO_LIBS="$MSCNG_LIBS" + ;; 'openssl') XMLSEC_CRYPTO_LIB="$OPENSSL_CRYPTO_LIB" XMLSEC_CRYPTO_CFLAGS="$OPENSSL_CFLAGS" @@ -1142,117 +1794,131 @@ case "$XMLSEC_DEFAULT_CRYPTO" in AC_MSG_ERROR(The value \"$XMLSEC_DEFAULT_CRYPTO\" is not a recongnized crypto library name) ;; esac -AC_MSG_RESULT(yes ('$XMLSEC_DEFAULT_CRYPTO')) +AC_MSG_RESULT([yes ("$XMLSEC_DEFAULT_CRYPTO")]) + +dnl ========================================================================== +dnl Do we need to use Unicode (Windows build only) +dnl ========================================================================== +if test "z$build_windows" = "zyes" ; then + AC_MSG_CHECKING(for Unicode support) + AC_ARG_ENABLE([unicode], [AC_HELP_STRING([--enable-unicode], [enable Unicode support on Windows (yes)])]) + if test "z$enable_unicode" = "zyes" ; then + XMLSEC_DEFINES="$XMLSEC_DEFINES -DUNICODE=1" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +fi dnl ========================================================================== dnl See do we need MD5 support dnl ========================================================================== -AC_MSG_CHECKING(for MD5 support) -AC_ARG_ENABLE(md5, [ --enable-md5 enable MD5 support (yes)]) +AC_MSG_CHECKING(for MD5 support) +AC_ARG_ENABLE([md5], [AC_HELP_STRING([--enable-md5], [enable MD5 support (yes)])]) if test "z$enable_md5" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_MD5=1" XMLSEC_NO_MD5="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_MD5="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_MD5, test "z$XMLSEC_NO_MD5" = "z1") AC_SUBST(XMLSEC_NO_MD5) dnl ========================================================================== dnl See do we need RIPEMD-160 support dnl ========================================================================== -AC_MSG_CHECKING(for RIPEMD-160 support) -AC_ARG_ENABLE(ripemd160, [ --enable-ripemd160 enable RIPEMD-160 support (yes)]) +AC_MSG_CHECKING(for RIPEMD-160 support) +AC_ARG_ENABLE([ripemd160], [AC_HELP_STRING([--enable-ripemd160], [enable RIPEMD-160 support (yes)])]) if test "z$enable_ripemd160" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_RIPEMD160=1" XMLSEC_NO_RIPEMD160="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_RIPEMD160="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_RIPEMD160, test "z$XMLSEC_NO_RIPEMD160" = "z1") AC_SUBST(XMLSEC_NO_RIPEMD160) dnl ========================================================================== dnl See do we need SHA1 support dnl ========================================================================== -AC_MSG_CHECKING(for SHA1 support) -AC_ARG_ENABLE(sha1, [ --enable-sha1 enable SHA1 support (yes)]) +AC_MSG_CHECKING(for SHA1 support) +AC_ARG_ENABLE([sha1], [AC_HELP_STRING([--enable-sha1], [enable SHA1 support (yes)])]) if test "z$enable_sha1" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA1=1" XMLSEC_NO_SHA1="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_SHA1="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_SHA1, test "z$XMLSEC_NO_SHA1" = "z1") AC_SUBST(XMLSEC_NO_SHA1) dnl ========================================================================== dnl See do we need SHA224 support dnl ========================================================================== -AC_MSG_CHECKING(for SHA224 support) -AC_ARG_ENABLE(sha224, [ --enable-sha224 enable SHA224 support (yes)]) +AC_MSG_CHECKING(for SHA224 support) +AC_ARG_ENABLE([sha224], [AC_HELP_STRING([--enable-sha224], [enable SHA224 support (yes)])]) if test "z$enable_sha224" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA224=1" XMLSEC_NO_SHA224="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_SHA224="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_SHA224, test "z$XMLSEC_NO_SHA224" = "z1") AC_SUBST(XMLSEC_NO_SHA224) dnl ========================================================================== dnl See do we need SHA256 support dnl ========================================================================== -AC_MSG_CHECKING(for SHA256 support) -AC_ARG_ENABLE(sha256, [ --enable-sha256 enable SHA256 support (yes)]) +AC_MSG_CHECKING(for SHA256 support) +AC_ARG_ENABLE([sha256], [AC_HELP_STRING([--enable-sha256], [enable SHA256 support (yes)])]) if test "z$enable_sha256" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA256=1" XMLSEC_NO_SHA256="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_SHA256="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_SHA256, test "z$XMLSEC_NO_SHA256" = "z1") AC_SUBST(XMLSEC_NO_SHA256) dnl ========================================================================== dnl See do we need SHA384 support dnl ========================================================================== -AC_MSG_CHECKING(for SHA384 support) -AC_ARG_ENABLE(sha384, [ --enable-sha384 enable SHA384 support (yes)]) +AC_MSG_CHECKING(for SHA384 support) +AC_ARG_ENABLE([sha384], [AC_HELP_STRING([--enable-sha384], [enable SHA384 support (yes)])]) if test "z$enable_sha384" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA384=1" XMLSEC_NO_SHA384="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_SHA384="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_SHA384, test "z$XMLSEC_NO_SHA384" = "z1") AC_SUBST(XMLSEC_NO_SHA384) dnl ========================================================================== dnl See do we need SHA512 support dnl ========================================================================== -AC_MSG_CHECKING(for SHA512 support) -AC_ARG_ENABLE(sha512, [ --enable-sha512 enable SHA512 support (yes)]) +AC_MSG_CHECKING(for SHA512 support) +AC_ARG_ENABLE([sha512], [AC_HELP_STRING([--enable-sha512], [enable SHA512 support (yes)])]) if test "z$enable_sha512" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA512=1" XMLSEC_NO_SHA512="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_SHA512="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_SHA512, test "z$XMLSEC_NO_SHA512" = "z1") AC_SUBST(XMLSEC_NO_SHA512) @@ -1260,96 +1926,96 @@ AC_SUBST(XMLSEC_NO_SHA512) dnl ========================================================================== dnl See do we need HMAC support dnl ========================================================================== -AC_MSG_CHECKING(for HMAC support) -AC_ARG_ENABLE(hmac, [ --enable-hmac enable HMAC support (yes)]) +AC_MSG_CHECKING(for HMAC support) +AC_ARG_ENABLE([hmac], [AC_HELP_STRING([--enable-hmac], [enable HMAC support (yes)])]) if test "z$enable_hmac" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_HMAC=1" XMLSEC_NO_HMAC="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_HMAC="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_HMAC, test "z$XMLSEC_NO_HMAC" = "z1") AC_SUBST(XMLSEC_NO_HMAC) dnl ========================================================================== dnl See do we need DSA support dnl ========================================================================== -AC_MSG_CHECKING(for DSA support) -AC_ARG_ENABLE(dsa, [ --enable-dsa enable DSA support (yes)]) +AC_MSG_CHECKING(for DSA support) +AC_ARG_ENABLE([dsa], [AC_HELP_STRING([--enable-dsa], [enable DSA support (yes)])]) if test "z$enable_dsa" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_DSA=1" XMLSEC_NO_DSA="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_DSA="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_DSA, test "z$XMLSEC_NO_DSA" = "z1") AC_SUBST(XMLSEC_NO_DSA) dnl ========================================================================== dnl See do we need RSA support dnl ========================================================================== -AC_MSG_CHECKING(for RSA support) -AC_ARG_ENABLE(rsa, [ --enable-rsa enable RSA support (yes)]) +AC_MSG_CHECKING(for RSA support) +AC_ARG_ENABLE([rsa], [AC_HELP_STRING([--enable-rsa], [enable RSA support (yes)])]) if test "z$enable_rsa" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_RSA=1" XMLSEC_NO_RSA="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_RSA="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_RSA, test "z$XMLSEC_NO_RSA" = "z1") AC_SUBST(XMLSEC_NO_RSA) dnl ========================================================================== dnl See do we need x509 support dnl ========================================================================== -AC_MSG_CHECKING(for x509 support) -AC_ARG_ENABLE(x509, [ --enable-x509 enable x509 support (yes)]) +AC_MSG_CHECKING(for x509 support) +AC_ARG_ENABLE([x509], [AC_HELP_STRING([--enable-x509], [enable x509 support (yes)])]) if test "z$enable_x509" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_X509=1" XMLSEC_NO_X509="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_X509="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_X509, test "z$XMLSEC_NO_X509" = "z1") AC_SUBST(XMLSEC_NO_X509) dnl ========================================================================== dnl See do we need DES support dnl ========================================================================== -AC_MSG_CHECKING(for DES support) -AC_ARG_ENABLE(des, [ --enable-des enable DES support (yes)]) +AC_MSG_CHECKING(for DES support) +AC_ARG_ENABLE([des], [AC_HELP_STRING([--enable-des], [enable DES support (yes)])]) if test "z$enable_des" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_DES=1" XMLSEC_NO_DES="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_DES="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_DES, test "z$XMLSEC_NO_DES" = "z1") AC_SUBST(XMLSEC_NO_DES) dnl ========================================================================== dnl See do we need AES support dnl ========================================================================== -AC_MSG_CHECKING(for AES support) -AC_ARG_ENABLE(aes, [ --enable-aes enable AES support]) +AC_MSG_CHECKING(for AES support) +AC_ARG_ENABLE([aes], [AC_HELP_STRING([--enable-aes], [enable AES support])]) if test "z$enable_aes" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_AES=1" XMLSEC_NO_AES="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_AES="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_AES, test "z$XMLSEC_NO_AES" = "z1") AC_SUBST(XMLSEC_NO_AES) @@ -1357,14 +2023,14 @@ dnl ========================================================================== dnl See do we need GOST support dnl ========================================================================== AC_MSG_CHECKING(for GOST support) -AC_ARG_ENABLE(gost, [ --enable-gost enable GOST support (no)]) +AC_ARG_ENABLE([gost], [AC_HELP_STRING([--enable-gost], [enable GOST support (no)])]) if test "z$enable_gost" != "zyes" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_GOST=1" XMLSEC_NO_GOST="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_GOST="0" - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) fi AM_CONDITIONAL(XMLSEC_NO_GOST, test "z$XMLSEC_NO_GOST" = "z1") AC_SUBST(XMLSEC_NO_GOST) @@ -1374,14 +2040,14 @@ dnl ========================================================================== dnl See do we need GOST2012 support dnl ========================================================================== AC_MSG_CHECKING(for EXPERMIENTAL GOST2012 support) -AC_ARG_ENABLE(gost, [ --enable-gost2012 enable EXPERMIENTAL GOST2012 support (no)]) +AC_ARG_ENABLE([gost2012], [AC_HELP_STRING([--enable-gost2012], [enable EXPERMIENTAL GOST2012 support (no)])]) if test "z$enable_gost2012" != "zyes" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_GOST2012=1" XMLSEC_NO_GOST2012="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_GOST2012="0" - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) fi AM_CONDITIONAL(XMLSEC_NO_GOST2012, test "z$XMLSEC_NO_GOST2012" = "z1") AC_SUBST(XMLSEC_NO_GOST2012) @@ -1390,66 +2056,142 @@ AC_SUBST(XMLSEC_NO_GOST2012) dnl ========================================================================== dnl See do we need XMLDSig support dnl ========================================================================== -AC_MSG_CHECKING(for XMLDSig support) -AC_ARG_ENABLE(xmldsig, [ --enable-xmldsig enable XMLDSig support (yes)]) +AC_MSG_CHECKING(for XMLDSig support) +AC_ARG_ENABLE([xmldsig], [AC_HELP_STRING([--enable-xmldsig], [enable XMLDSig support (yes)])]) if test "z$enable_xmldsig" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XMLDSIG=1" XMLSEC_NO_XMLDSIG="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_XMLDSIG="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_XMLDSIG, test "z$XMLSEC_NO_XMLDSIG" = "z1") AC_SUBST(XMLSEC_NO_XMLDSIG) dnl ========================================================================== dnl See do we need XMLEnc support dnl ========================================================================== -AC_MSG_CHECKING(for XMLEnc support) -AC_ARG_ENABLE(xmlenc, [ --enable-xmlenc enable XMLEnc support (yes)]) +AC_MSG_CHECKING(for XMLEnc support) +AC_ARG_ENABLE([xmlenc], [AC_HELP_STRING([--enable-xmlenc], [enable XMLEnc support (yes)])]) if test "z$enable_xmlenc" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XMLENC=1" XMLSEC_NO_XMLENC="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else XMLSEC_NO_XMLENC="0" - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi AM_CONDITIONAL(XMLSEC_NO_XMLENC, test "z$XMLSEC_NO_XMLENC" = "z1") AC_SUBST(XMLSEC_NO_XMLENC) dnl ========================================================================== +dnl See do we need soap support (deprecated) +dnl ========================================================================== +AC_MSG_CHECKING(for soap support) +AC_ARG_ENABLE([soap], [AC_HELP_STRING([--enable-soap], [enable soap support (no)])]) +if test "z$enable_soap" = "zyes" ; then + XMLSEC_ENABLE_SOAP="1" + AC_MSG_RESULT([yes]) +else + XMLSEC_ENABLE_SOAP="0" + AC_MSG_RESULT([disabled]) +fi +AM_CONDITIONAL(XMLSEC_ENABLE_SOAP, test "z$XMLSEC_ENABLE_SOAP" = "z1") + +dnl ========================================================================== +dnl See do we need mans +dnl ========================================================================== +AC_MSG_CHECKING(for mans) +AC_ARG_ENABLE([mans], [AC_HELP_STRING([--enable-mans], [enable manual pages (yes)])]) +if test "z$enable_mans" = "zno" ; then + XMLSEC_MANS="0" + AC_MSG_RESULT([disabled]) +else + XMLSEC_MANS="1" + AC_MSG_RESULT([yes]) +fi +AM_CONDITIONAL(XMLSEC_MANS, test "z$XMLSEC_MANS" = "z1") +AC_SUBST(XMLSEC_MANS) + +dnl ========================================================================== +dnl See do we need docs +dnl ========================================================================== +AC_MSG_CHECKING(for docs) +AC_ARG_ENABLE([docs], [AC_HELP_STRING([--enable-docs], [enable documentation (yes)])]) +if test "z$enable_docs" = "zno" ; then + XMLSEC_DOCS="0" + AC_MSG_RESULT([disabled]) +else + XMLSEC_DOCS="1" + AC_MSG_RESULT([yes]) +fi +AM_CONDITIONAL(XMLSEC_DOCS, test "z$XMLSEC_DOCS" = "z1") +AC_SUBST(XMLSEC_DOCS) + +dnl ========================================================================== +dnl See if we need apps +dnl ========================================================================== +AC_MSG_CHECKING(for apps) +AC_ARG_ENABLE([apps], [AC_HELP_STRING([--enable-apps], [enable applications (yes)])]) +if test "z$enable_apps" = "zno" ; then + XMLSEC_APPS="0" + AC_MSG_RESULT([disabled]) +else + XMLSEC_APPS="1" + AC_MSG_RESULT([yes]) +fi +AM_CONDITIONAL(XMLSEC_APPS, test "z$XMLSEC_APPS" = "z1") +AC_SUBST(XMLSEC_APPS) + +dnl ========================================================================== +dnl Static linking (implies enable_crypto_dl="no") +dnl ========================================================================== +XMLSEC_STATIC_BINARIES="" +AC_MSG_CHECKING(for static linking) +AC_ARG_ENABLE([static_linking], [AC_HELP_STRING([--enable-static-linking], [enable static linking (no)])]) +if test "z$enable_static_linking" = "zyes" ; then + XMLSEC_STATIC_BINARIES="-static" + XMLSEC_APP_DEFINES="$XMLSEC_APP_DEFINES -DXMLSEC_STATIC=1" + enable_crypto_dl="no" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([disabled]) +fi +AC_SUBST(XMLSEC_STATIC_BINARIES) + +dnl ========================================================================== dnl check if we need dynamic loading support dnl ========================================================================== XMLSEC_DL_INCLUDES="" XMLSEC_DL_LIBS="" -AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support) -AC_ARG_ENABLE(crypto_dl, [ --enable-crypto-dl enable dynamic loading support for xmlsec-crypto libraries (yes)]) +AC_ARG_ENABLE([crypto_dl], [AC_HELP_STRING([--enable-crypto-dl], [enable dynamic loading support for xmlsec-crypto libraries (yes)])]) if test "z$enable_crypto_dl" = "zno" ; then + AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support) XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1" XMLSEC_NO_CRYPTO_DYNAMIC_LOADING="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else - AC_CHECK_HEADER([ltdl.h], - [ - XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_DL_LIBLTDL=1" - AC_CHECK_LIB( - [ltdl], - [lt_dlopenext], - [LIBLTDL=-lltdl], - [LIBLTDL=] - )], - [LIBLTDL=] - ) + AC_CHECK_HEADER([ltdl.h], [ + XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_DL_LIBLTDL=1" + AC_CHECK_LIB( + [ltdl], + [lt_dlopenext], + [LIBLTDL=-lltdl], + [LIBLTDL=] + ) + ], [ + LIBLTDL= + ]) + AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support) if test "z$LIBLTDL" != "z" ; then - XMLSEC_DL_INCLUDES="$INCLTDL" - XMLSEC_DL_LIBS="$LIBLTDL" - XMLSEC_NO_CRYPTO_DYNAMIC_LOADING="0" - AC_MSG_RESULT(yes) + XMLSEC_DL_INCLUDES="$INCLTDL" + XMLSEC_DL_LIBS="$LIBLTDL" + XMLSEC_NO_CRYPTO_DYNAMIC_LOADING="0" + AC_MSG_RESULT([yes]) else - AC_MSG_ERROR([libltdl is required for xmlsec-crypto dynamic loading]) + AC_MSG_ERROR([libltdl is required for xmlsec-crypto dynamic loading]) fi fi AM_CONDITIONAL(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING, test "z$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING" = "z1") @@ -1460,114 +2202,114 @@ AC_SUBST(XMLSEC_DL_LIBS) dnl ========================================================================== dnl check if we need dynamic loading in the xmlsec apps dnl ========================================================================== -AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support in command line tool) -AC_ARG_ENABLE(apps_crypto_dl, [ --enable-apps-crypto-dl enable dynamic loading support for xmlsec-crypto libraries in xmlsec command line tool (yes)]) +AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support in command line tool) +AC_ARG_ENABLE([apps_crypto_dl], [AC_HELP_STRING([--enable-apps-crypto-dl], [ enable dynamic loading support for xmlsec-crypto libraries in xmlsec command line tool (yes)])]) if test "z$enable_apps_crypto_dl" = "z" ; then enable_apps_crypto_dl="$enable_crypto_dl" fi if test "z$enable_apps_crypto_dl" = "zno" ; then XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING="1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) elif test "z$enable_crypto_dl" = "zno" ; then - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) AC_MSG_ERROR(xmlsec-crypto libraries dynamic loading support in xmlsec command line tool is requested but no dynamic loading in xmlsec itself is disabled) else XMLSEC_APP_DEFINES="$XMLSEC_APP_DEFINES -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1" XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING="0" - AC_MSG_RESULT(yes) -fi -AM_CONDITIONAL(XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING, + AC_MSG_RESULT([yes]) +fi +AM_CONDITIONAL(XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING, test "z$XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING" = "z1") AC_SUBST(XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING) dnl ========================================================================== dnl Where do we want to install docs dnl ========================================================================== -AC_MSG_CHECKING(for docs folder) -AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) +AC_MSG_CHECKING(for docs folder) +AC_ARG_WITH([html-dir], [AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs])]) if test "z$with_html_dir" != "z" ; then - XMLSEC_DOCDIR=$with_html_dir + XMLSEC_DOCDIR="$with_html_dir" +elif test "z$htmldir" != "z" ; then + XMLSEC_DOCDIR='$(htmldir)' else XMLSEC_DOCDIR='$(datadir)/doc/xmlsec1' fi -AC_MSG_RESULT($XMLSEC_DOCDIR) +AC_MSG_RESULT([$XMLSEC_DOCDIR]) AC_SUBST(XMLSEC_DOCDIR) dnl ========================================================================== -dnl See do we need Simple Keys Manager +dnl See do we need Simple Keys Manager dnl ========================================================================== -AC_MSG_CHECKING(for Simple Keys Manager testing) -AC_ARG_ENABLE(skm, [ --enable-skm enable Simple Keys Manager testing (yes)]) +AC_MSG_CHECKING(for Simple Keys Manager testing) +AC_ARG_ENABLE([skm], [AC_HELP_STRING([--enable-skm], [enable Simple Keys Manager testing (yes)])]) if test "z$enable_skm" = "zno" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SKM_TEST=1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) fi dnl ========================================================================== dnl See do we need templates tests dnl ========================================================================== -AC_MSG_CHECKING(for templates testing) -AC_ARG_ENABLE(tmpl_tests, [ --enable-tmpl-tests enable templates testing in xmlsec utility (yes)]) +AC_MSG_CHECKING(for templates testing) +AC_ARG_ENABLE([tmpl_tests], [AC_HELP_STRING([--enable-tmpl-tests], [enable templates testing in xmlsec utility (yes)])]) if test "z$enable_tmpl_tests" = "zyes" ; then XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_TMPL_TEST=1" - AC_MSG_RESULT(no) + AC_MSG_RESULT([disabled]) else - AC_MSG_RESULT(yes) -fi + AC_MSG_RESULT([yes]) +fi dnl ========================================================================== -dnl Debug +dnl Debug dnl ========================================================================== AC_MSG_CHECKING(for debugging) -AC_ARG_ENABLE(debugging, [ --enable-debugging enable debugging compilation flags (no)]) +AC_ARG_ENABLE([debugging], [AC_HELP_STRING([--enable-debugging], [enable debugging compilation flags (no)])]) if test "z$enable_debugging" = "zyes" ; then CFLAGS="$CFLAGS -g" - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([disabled]) +fi + +dnl ========================================================================== +dnl Warnings as errors +dnl ========================================================================== +AC_MSG_CHECKING(for warnings as errors) +AC_ARG_ENABLE([werror], [AC_HELP_STRING([--enable-werror], [handle warnings as errors (no)])]) +if test "z$enable_werror" = "zyes" ; then + CFLAGS="$CFLAGS -Werror" + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) -fi + AC_MSG_RESULT([disabled]) +fi dnl ========================================================================== -dnl Profiling +dnl Profiling dnl ========================================================================== -AC_MSG_CHECKING(for profiling) -AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling compilation flags (no)]) +AC_MSG_CHECKING(for profiling) +AC_ARG_ENABLE([profiling], [AC_HELP_STRING([--enable-profiling], [enable profiling compilation flags (no)])]) if test "z$enable_profiling" = "zyes" ; then CFLAGS="$CFLAGS -pg" - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) -fi + AC_MSG_RESULT([disabled]) +fi dnl ========================================================================== dnl Pedantic compilation dnl ========================================================================== -AC_MSG_CHECKING(for pedantic) -AC_ARG_ENABLE(pedantic, [ --enable-pedantic enable pedantic compilation flags (no)]) +AC_MSG_CHECKING(for pedantic) +AC_ARG_ENABLE([pedantic], [AC_HELP_STRING([--enable-pedantic], [enable pedantic compilation flags (no)])]) if test "z$enable_pedantic" = "zyes" ; then dnl CFLAGS="$CFLAGS -pedantic -Wall -std=c99 -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wredundant-decls" CFLAGS="$CFLAGS -O -pedantic -Wall -std=c99 -fno-inline -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wredundant-decls" - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) -fi - -dnl ========================================================================== -dnl Static linking -dnl ========================================================================== -XMLSEC_STATIC_BINARIES="" -AC_MSG_CHECKING(for static linking) -AC_ARG_ENABLE(static_linking, [ --enable-static-linking enable static linking (no)]) -if test "z$enable_static_linking" = "zyes" ; then - XMLSEC_STATIC_BINARIES="-static" - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi -AC_SUBST(XMLSEC_STATIC_BINARIES) + AC_MSG_RESULT([disabled]) +fi dnl ========================================================================== dnl Final steps: xmlsec config @@ -1608,6 +2350,12 @@ dnl XMLSEC_MSCRYPTO_LIBS="-L${libdir} -l$MSCRYPTO_CRYPTO_LIB $XMLSEC_CORE_LIBS $ dnl AC_SUBST(XMLSEC_MSCRYPTO_CFLAGS) dnl AC_SUBST(XMLSEC_MSCRYPTO_LIBS) +dnl No we will not generate pkg-config file for mscng. +dnl XMLSEC_MSCNG_CFLAGS="$XMLSEC_CORE_CFLAGS $MSCNG_CFLAGS" +dnl XMLSEC_MSCNG_LIBS="-L${libdir} -l$MSCNG_CRYPTO_LIB $XMLSEC_CORE_LIBS $MSCNG_LIBS";; +dnl AC_SUBST(XMLSEC_MSCNG_CFLAGS) +dnl AC_SUBST(XMLSEC_MSCNG_LIBS) + XMLSEC_CFLAGS="$XMLSEC_CORE_CFLAGS $LIBXML_CFLAGS $LIBXSLT_CFLAGS $XMLSEC_CRYPTO_CFLAGS" XMLSEC_LIBS="-L${libdir} -l$XMLSEC_CRYPTO_LIB $XMLSEC_CORE_LIBS $LIBXML_LIBS $LIBXSLT_LIBS $XMLSEC_CRYPTO_LIBS" AC_SUBST(XMLSEC_CFLAGS) @@ -1630,8 +2378,9 @@ AC_SUBST(XMLSEC_CRYPTO_LIBS) XMLSEC_CRYPTO_PC_FILES_LIST="" for i in $XMLSEC_CRYPTO_LIST ; do - dnl skip pkg-config file for mscrypto + dnl skip pkg-config file for mscrypto/mscng test x$i = xmscrypto && continue + test x$i = xmscng && continue XMLSEC_CRYPTO_PC_FILES_LIST="$XMLSEC_CRYPTO_PC_FILES_LIST $XMLSEC_PACKAGE-$i.pc" done AC_SUBST(XMLSEC_CRYPTO_PC_FILES_LIST) @@ -1659,6 +2408,10 @@ if test "z$XMLSEC_NO_MSCRYPTO" != "z1" ; then AC_CONFIG_FILES([include/xmlsec/mscrypto/Makefile src/mscrypto/Makefile]) fi +if test "z$XMLSEC_NO_MSCNG" != "z1" ; then +AC_CONFIG_FILES([include/xmlsec/mscng/Makefile src/mscng/Makefile]) +fi + if test "z$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING" = "z1" ; then (rm -f xmlsec1.pc && $LN_S xmlsec1-$XMLSEC_DEFAULT_CRYPTO.pc xmlsec1.pc) else diff --git a/docs/Makefile.am b/docs/Makefile.am index 32bf780c..a89ba76c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -9,12 +9,14 @@ EXTRA_DIST=\ $(builddir)/*.html \ $(builddir)/*.ico \ $(builddir)/xmlsec.xsl \ + $(builddir)/xmlsec-ga.xsl \ $(NULL) XMLSEC1_MAN=$(top_builddir)/man/xmlsec1.1 XMLSEC_HTML=$(builddir)/xmlsec-man.html -all: docs +all: + @echo "======= Run 'make docs' in the xmlsec/docs folder to rebuild docs" # docs is legacy docs: docs-copy man-docs docs-format @@ -22,7 +24,7 @@ docs: docs-copy man-docs docs-format docs-copy: @( \ echo "Copying docs..."; \ - if [ z"$(srcdir)" != z"$(builddir)" ]; \ + if [ z"$(srcdir)" != z"$(builddir)" -a z"`uname`" != z"Darwin" ]; \ then \ $(CP) -ru $(srcdir)/*.html $(srcdir)/*.ico $(srcdir)/images $(builddir)/ ; \ chmod u+w $(builddir)/*.html ; \ @@ -70,6 +72,19 @@ docs-format: sed 's/\xA0/ /g' $$i > $$i.tmp ; \ mv $$i.tmp $$i ; \ done) +docs-format-ga: + @(echo "Formatting html documents to add Google Analytics"; \ + for i in `find $(builddir) -name "*.html" -print`; \ + do \ + echo "Processing $$i"; \ + $(XSLTPROC) --html --output $$i.tmp $(srcdir)/xmlsec-ga.xsl $$i; \ + if [ $$? != 0 ]; \ + then \ + echo "ERROR: processing file $$i"; \ + exit 1; \ + fi; \ + mv $$i.tmp $$i; \ + done) else # do nothing docs-format: diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am index 2a3c329e..a1ffd3a7 100644 --- a/docs/api/Makefile.am +++ b/docs/api/Makefile.am @@ -11,17 +11,14 @@ INCLUDE_DIR2=$(top_builddir)/include SCAN_DIR=$(builddir) SGML_DIR=$(builddir)/sgml.tmp -XML_DIR=$(builddir)/xml.tmp EXAMPLES_DIR=$(SGML_DIR)/examples SOURCE_CODE_DIR=$(builddir)/code +GTKDOC_MKDB_OUTPUT_DIR=$(builddir)/xml # We need to copy some files to make gkdoc happy that # everything is in one folder -TMPL_DIR=$(builddir)/tmpl -TMPL_SRC_DIR=$(srcdir)/tmpl - -MAIN_SGML_FILE=$(SGML_DIR)/xmlsec-main.sgml +MAIN_SGML_FILE=$(SGML_DIR)/xmlsec.sgml MAIN_SGML_SRC_FILE=$(srcdir)/src/xmlsec.sgml SGML_CHAPTERS_DIR=$(SGML_DIR)/chapters @@ -29,18 +26,28 @@ SGML_CHAPTERS_SRC_DIR=$(srcdir)/src/chapters EXTRA_DIST = \ - $(TMPL_DIR) \ $(srcdir)/src \ $(srcdir)/images \ + $(srcdir)/style.css \ $(NULL) SOURCE_FILES_TO_COPY = \ $(srcdir)/src \ $(srcdir)/images \ + $(srcdir)/style.css \ $(srcdir)/*.html \ $(srcdir)/*.png \ $(NULL) +CRYPTO_LIBS_LIST = \ + openssl \ + nss \ + gnutls \ + gcrypt \ + mscrypto \ + mscng \ + $(NULL) + # # We need to pre-process original source files # because gtkdoc does not understand some C features @@ -73,7 +80,7 @@ else docs: @( \ echo "Copying api-docs..."; \ - if [ z"$(srcdir)" != z"$(builddir)" ]; \ + if [ z"$(srcdir)" != z"$(builddir)" -a z"`uname`" != z"Darwin" ]; \ then \ $(CP) -ru $(SOURCE_FILES_TO_COPY) $(builddir)/ ; \ fi \ @@ -81,7 +88,7 @@ docs: endif html-cleanup: html - ( echo "Cleaning up result files"; \ + @( echo "Cleaning up result files"; \ $(PERL) $(REMOVE_GTKDOCLINK) `find . -name "*.html" -print` \ ) @@ -103,7 +110,7 @@ $(MAIN_SGML_FILE): $(MAIN_SGML_SRC_FILE) # We also fix a bunch of stupid errors from gtkdoc # sgml: sgml-base - (for i in `find $(SGML_DIR) -name "*.sgml" -print` ; do \ + (for i in `find $(SGML_DIR) -name "*.sgml" -or -name "*.xml" -print` ; do \ echo "Fixing up '$$i'" ; \ cat $$i | \ sed 's!\(<dsig:\)\([^/]*\)\(\/>\)!\<dsig:\2\/\>!g' | \ @@ -116,6 +123,7 @@ sgml: sgml-base sed 's!linkend=\"\(.*\)Ptr\"!linkend=\"\1\"!g' | \ sed 's!<colspec [^/]*\/>!!g' | \ sed 's!<programlisting language="C"!<programlisting!g' | \ + sed 's!\%gtkdocentities;!!g' | \ $(PERL) -pe 's!title>\n!title>!g' | \ $(PERL) -pe 's!title>\n!title>!g' | \ $(PERL) -pe 's!<\/title><\/refsect1>\n!<\/title><para><\/para><\/refsect1>!g' | \ @@ -124,97 +132,46 @@ sgml: sgml-base mv -f $$i.tmp $$i; \ done); -sgml-base: templates $(SGML_DIR)/.sentinel - $(GTKDOC_MKDB) --module=xmlsec \ - --main-sgml-file=$(SGML_DIR)/xmlsec-base.sgml \ - --output-dir=$(SGML_DIR)/ \ - --tmpl-dir=$(TMPL_DIR)/base \ - --source-dir=$(SOURCE_CODE_DIR)/src/base \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base - $(GTKDOC_MKDB) --module=xmlsec-openssl \ - --main-sgml-file=$(SGML_DIR)/xmlsec-openssl.sgml \ - --tmpl-dir=$(TMPL_DIR)/openssl \ - --output-dir=$(SGML_DIR)/openssl \ - --source-dir=$(SOURCE_CODE_DIR)/src/openssl \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/openssl - $(GTKDOC_MKDB) --module=xmlsec-gnutls \ - --main-sgml-file=$(SGML_DIR)/xmlsec-gnutls.sgml \ - --tmpl-dir=$(TMPL_DIR)/gnutls \ - --output-dir=$(SGML_DIR)/gnutls \ - --source-dir=$(SOURCE_CODE_DIR)/src/gnutls \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gnutls - $(GTKDOC_MKDB) --module=xmlsec-gcrypt \ - --main-sgml-file=$(SGML_DIR)/xmlsec-gcrypt.sgml \ - --tmpl-dir=$(TMPL_DIR)/gcrypt \ - --output-dir=$(SGML_DIR)/gcrypt \ - --source-dir=$(SOURCE_CODE_DIR)/src/gcrypt \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gcrypt - $(GTKDOC_MKDB) --module=xmlsec-nss \ - --main-sgml-file=$(SGML_DIR)/xmlsec-nss.sgml \ - --tmpl-dir=$(TMPL_DIR)/nss \ - --output-dir=$(SGML_DIR)/nss \ - --source-dir=$(SOURCE_CODE_DIR)/src/nss \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/nss - $(GTKDOC_MKDB) --module=xmlsec-mscrypto \ - --main-sgml-file=$(SGML_DIR)/xmlsec-mscrypto.sgml \ - --tmpl-dir=$(TMPL_DIR)/mscrypto \ - --output-dir=$(SGML_DIR)/mscrypto \ - --source-dir=$(SOURCE_CODE_DIR)/src/mscrypto \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/mscrypto - -templates: scan templates-copy - $(GTKDOC_MKTMPL) --module=xmlsec \ - --output-dir=$(TMPL_DIR)/base - $(GTKDOC_MKTMPL) --module=xmlsec-openssl \ - --output-dir=$(TMPL_DIR)/openssl - $(GTKDOC_MKTMPL) --module=xmlsec-gnutls \ - --output-dir=$(TMPL_DIR)/gnutls - $(GTKDOC_MKTMPL) --module=xmlsec-gcrypt \ - --output-dir=$(TMPL_DIR)/gcrypt - $(GTKDOC_MKTMPL) --module=xmlsec-nss \ - --output-dir=$(TMPL_DIR)/nss - $(GTKDOC_MKTMPL) --module=xmlsec-mscrypto \ - --output-dir=$(TMPL_DIR)/mscrypto - -# make sure to run chmod since we will update templates -templates-copy: $(TMPL_SRC_DIR) $(TMPL_DIR)/.sentinel - @echo "Copying original template files into '$(TMPL_DIR)' ..." - ( if [ z"$(TMPL_DIR)" != z"$(TMPL_SRC_DIR)" ] ; then \ - $(CP) -ru $(TMPL_SRC_DIR)/* $(TMPL_DIR)/ ; \ - fi ; ) - chmod -R u+w $(TMPL_DIR) +# gtkdoc-mkdb doesn't support --output-dir thus we have to "hack" it a litle bit +sgml-base: scan $(SGML_DIR)/.sentinel + @( \ + echo "Create DocBook files for xmlsec-core" ; \ + rm -rf $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/base ; \ + $(GTKDOC_MKDB) --module=xmlsec \ + --xml-mode \ + --main-sgml-file=$(SGML_DIR)/xmlsec-base.sgml \ + --source-dir=$(SOURCE_CODE_DIR)/src/base \ + --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base ; \ + mv $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/base ; \ + ); + @(for i in $(CRYPTO_LIBS_LIST) ; do \ + echo "Create DocBook files for xmlsec-$$i" ; \ + rm -rf $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/$$i ; \ + $(GTKDOC_MKDB) --module=xmlsec-$$i \ + --xml-mode \ + --main-sgml-file=$(SGML_DIR)/xmlsec-$$i.sgml \ + --source-dir=$(SOURCE_CODE_DIR)/src/$$i \ + --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/$$i ; \ + mv $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/$$i ; \ + done); scan: SOURCE_CODEs example_sources - $(GTKDOC_SCAN) --module=xmlsec \ - --rebuild-sections \ + @( \ + echo "Scanning source code for xmlsec-core" ; \ + $(GTKDOC_SCAN) --module=xmlsec \ + --rebuild-sections \ --output-dir=$(SCAN_DIR) \ --source-dir=$(SOURCE_CODE_DIR)/src/base \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base - $(GTKDOC_SCAN) --module=xmlsec-openssl \ - --rebuild-sections \ - --output-dir=$(SCAN_DIR) \ - --source-dir=$(SOURCE_CODE_DIR)/src/openssl \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/openssl - $(GTKDOC_SCAN) --module=xmlsec-gnutls \ - --rebuild-sections \ - --output-dir=$(SCAN_DIR) \ - --source-dir=$(SOURCE_CODE_DIR)/src/gnutls \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gnutls - $(GTKDOC_SCAN) --module=xmlsec-gcrypt \ - --rebuild-sections \ - --output-dir=$(SCAN_DIR) \ - --source-dir=$(SOURCE_CODE_DIR)/src/gcrypt \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gcrypt - $(GTKDOC_SCAN) --module=xmlsec-nss \ - --rebuild-sections \ + --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base ; \ + ); + @(for i in $(CRYPTO_LIBS_LIST) ; do \ + echo "Scanning source code for xmlsec-$$i" ; \ + $(GTKDOC_SCAN) --module=xmlsec-$$i \ + --rebuild-sections \ --output-dir=$(SCAN_DIR) \ - --source-dir=$(SOURCE_CODE_DIR)/src/nss \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/nss - $(GTKDOC_SCAN) --module=xmlsec-mscrypto \ - --rebuild-sections \ - --output-dir=$(SCAN_DIR) \ - --source-dir=$(SOURCE_CODE_DIR)/src/mscrypto \ - --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/mscrypto + --source-dir=$(SOURCE_CODE_DIR)/src/$$i \ + --source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/$$i ; \ + done); # # Prepare source files by coping them to "code" folder and @@ -308,12 +265,9 @@ dist-hook: done ; ) clean-local: - -rm -rf $(SOURCE_CODE_DIR) $(EXAMPLES_DIR) $(SCAN_DIR)/*.txt $(SGML_DIR) $(XML_DIR) - -rm -f *.stamp *.types *.css index.sgml - ( if [ z"$(TMPL_SRC_DIR)" != z"$(TMPL_DIR)" ] && [ -d "$(TMPL_DIR)" ] ; then \ - chmod -R u+w $(TMPL_DIR) && rm -rf $(TMPL_DIR) ; \ - fi ; ) - ( if [ z"$(builddir)" != z"$(srcdir)" ] ; then \ + -rm -rf $(SOURCE_CODE_DIR) $(EXAMPLES_DIR) $(SCAN_DIR)/*.txt $(SGML_DIR) $(GTKDOC_MKDB_OUTPUT_DIR) + -rm -f *.stamp *.types index.sgml + @( if [ z"$(builddir)" != z"$(srcdir)" ] ; then \ chmod -R u+w $(builddir)/src && rm -rf $(builddir)/src ; \ chmod -R u+w $(builddir)/images && rm -rf $(builddir)/images ; \ chmod -R u+w $(builddir)/*.png && rm -rf $(builddir)/*.png ; \ diff --git a/docs/api/home.png b/docs/api/home.png Binary files differindex 28c2e27c..b293af53 100644 --- a/docs/api/home.png +++ b/docs/api/home.png diff --git a/docs/api/index.html b/docs/api/index.html index 6260bf13..4d08d1b8 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -1,120 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>XML Security Library Reference Manual</title> -<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79"> -<link rel="NEXT" title="XML Security Library Tutorial" href="xmlsec-notes.html"> -<style type="text/css">.synopsis, .classsynopsis { - background: #eeeeee; - border: solid 1px #aaaaaa; - padding: 0.5em; -} -.programlisting { - background: #eeeeff; - border: solid 1px #aaaaff; - padding: 0.5em; -} -.variablelist { - padding: 4px; - margin-left: 3em; -} -.navigation { - background: #ffeeee; - border: solid 1px #ffaaaa; - margin-top: 0.5em; - margin-bottom: 0.5em; -} -.navigation a { - color: #770000; -} -.navigation a:visited { - color: #550000; -} -.navigation .title { - font-size: 200%; -}</style> -<style type="text/css"> -table.CALSTABLE > tbody > tr:nth-child(1) > td:nth-child(1) { - width: 20em; -} -.synopsis, .classsynopsis { - background: #eeeeee; - border: solid 1px #aaaaaa; -} -.programlisting { - background: #eeeeee; - border: solid 1px #000000; -} -.navigation { - background: #eeeeee; - border: solid 1px #000000; -} -.navigation a { - color: initial; -} -.navigation a:visited { - color: initial; -} -</style> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>XML Security Library Reference Manual: XML Security Library Reference Manual</title> +<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> +<meta name="description" content="This manual documents the interfaces of the xmlsec library and has some short notes to help get you up to speed with using the library."> +<link rel="home" href="index.html" title="XML Security Library Reference Manual"> +<link rel="next" href="xmlsec-notes.html" title="Part I. XML Security Library Tutorial"> +<meta name="generator" content="GTK-Doc V1.27 (XML mode)"> +<link rel="stylesheet" href="style.css" type="text/css"> </head> -<body><table width="100%" valign="top"><tr valign="top"> -<td valign="top" align="left" width="210"> -<img src="../images/logo.gif" alt="XML Security Library" border="0"><p></p> -<ul> -<li><a href="../index.html">Home</a></li> -<li><a href="../download.html">Download</a></li> -<li><a href="../news.html">News</a></li> -<li><a href="../documentation.html">Documentation</a></li> -<ul> -<li><a href="../faq.html">FAQ</a></li> -<li><a href="../api/xmlsec-notes.html">Tutorial</a></li> -<li><a href="../api/xmlsec-reference.html">API reference</a></li> -<li><a href="../api/xmlsec-examples.html">Examples</a></li> -</ul> -<li><a href="../xmldsig.html">XML Digital Signature</a></li> -<ul><li><a href="http://www.aleksey.com/xmlsec/xmldsig-verifier.html">Online Verifier</a></li></ul> -<li><a href="../xmlenc.html">XML Encryption</a></li> -<li><a href="../c14n.html">XML Canonicalization</a></li> -<li><a href="../bugs.html">Reporting Bugs</a></li> -<li><a href="http://www.aleksey.com/pipermail/xmlsec">Mailing list</a></li> -<li><a href="../related.html">Related</a></li> -<li><a href="../authors.html">Authors</a></li> -</ul> -<table width="100%"> -<tr> -<td width="15"></td> -<td><a href="http://xmlsoft.org/"><img src="../images/libxml2-logo.png" alt="LibXML2" border="0"></a></td> -</tr> -<tr> -<td width="15"></td> -<td><a href="http://xmlsoft.org/XSLT"><img src="../images/libxslt-logo.png" alt="LibXSLT" border="0"></a></td> -</tr> -<tr> -<td width="15"></td> -<td><a href="http://www.openssl.org/"><img src="../images/openssl-logo.png" alt="OpenSSL" border="0"></a></td> -</tr> -<!--Links - start--><!--Links - end--> -</table> -</td> -<td valign="top"><table width="100%" valign="top"><tr><td valign="top" align="left" id="xmlsecContent"> -<div class="BOOK"> -<div class="TITLEPAGE"> -<table class="navigation" width="100%" cellpadding="2" cellspacing="0"><tr><th align="center" valign="MIDDLE"><p class="TITLE">XML Security Library Reference Manual<a name="AEN2"></a></p></th></tr></table> -<h3 class="AUTHOR"> -<a name="AEN5"></a>Aleksey Sanin</h3> -<div class="AFFILIATION"><div class="ADDRESS"><p class="ADDRESS"> <code class="EMAIL"><<a href="mailto:aleksey@aleksey.com">aleksey@aleksey.com</a>></code><br> - </p></div></div> -<p class="COPYRIGHT">Copyright © 2002-2003 Aleksey Sanin</p> -<div><div class="ABSTRACT"> -<p></p> -<a name="AEN18"></a><p>This manual documents the interfaces of the xmlsec - library and has some short notes to help get you up to speed - with using the library.</p> -<p></p> -</div></div> -<div class="LEGALNOTICE"> -<p></p> -<a name="AEN14"></a><p>Permission is granted to make and distribute verbatim +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<div class="book"> +<div class="titlepage"> +<div> +<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">XML Security Library Reference Manual</p></th></tr></table></div> +<div><div class="authorgroup"><div class="author"> +<h3 class="author"> +<span class="firstname">Aleksey</span> <span class="surname">Sanin</span> +</h3> +<div class="affiliation"><div class="address"><p><br> +     <code class="email"><<a class="email" href="mailto:aleksey@aleksey.com">aleksey@aleksey.com</a>></code><br> +   </p></div></div> +</div></div></div> +<div><p class="copyright">Copyright © 2002-2017 Aleksey Sanin</p></div> +<div><div class="legalnotice"> +<a name="id-1.1.4"></a><p>Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.</p> <p>Permission is granted to copy and distribute modified @@ -125,206 +36,314 @@ table.CALSTABLE > tbody > tr:nth-child(1) > td:nth-child(1) { <p>Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.</p> -<p></p> +</div></div> +<div><div class="abstract"> +<p class="title"><b>Abstract</b></p> +<p>This manual documents the interfaces of the xmlsec + library and has some short notes to help get you up to speed + with using the library.</p> +</div></div> </div> +<hr> </div> -<div class="TOC"><dl> -<dt><b>Table of Contents</b></dt> -<dt>I. <a href="xmlsec-notes.html">XML Security Library Tutorial</a> -</dt> +<div class="toc"><dl class="toc"> +<dt><span class="part"><a href="xmlsec-notes.html">I. XML Security Library Tutorial</a></span></dt> +<dd><dl> +<dt><span class="chapter"><a href="xmlsec-notes-overview.html">Overview.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-notes-structure.html">XML Security Library Structure.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-notes-compiling.html">Building the application with XML Security Library.</a></span></dt> +<dd><dl> +<dt><span class="sect1"><a href="xmlsec-notes-compiling.html#xmlsec-notes-compiling-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-include-files.html">Include files.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-compiling-unix.html">Compiling and linking on Unix.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-compiling-windows.html">Compiling and linking on Windows.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-compiling-others.html">Compiling and linking on other systems.</a></span></dt> +</dl></dd> +<dt><span class="chapter"><a href="xmlsec-notes-init-shutdown.html">Initialization and shutdown.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-notes-sign-encrypt.html">Signing and encrypting documents.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-overview.html">Overview.</a></dt> -<dt><a href="xmlsec-notes-structure.html">XML Security Library Structure.</a></dt> -<dt><a href="xmlsec-notes-compiling.html">Building the application with XML Security Library.</a></dt> +<dt><span class="sect1"><a href="xmlsec-notes-sign-encrypt.html#xmlsec-notes-sign-encrypt-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-sign.html">Signing a document.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-encrypt.html">Encrypting data.</a></span></dt> +</dl></dd> +<dt><span class="chapter"><a href="xmlsec-notes-templates.html">Creating dynamic templates.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-compiling.html#XMLSEC-NOTES-COMPILING-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-include-files.html">Include files.</a></dt> -<dt><a href="xmlsec-notes-compiling-unix.html">Compiling and linking on Unix.</a></dt> -<dt><a href="xmlsec-notes-compiling-windows.html">Compiling and linking on Windows.</a></dt> -<dt><a href="xmlsec-notes-compiling-others.html">Compiling and linking on other systems.</a></dt> +<dt><span class="sect1"><a href="xmlsec-notes-templates.html#xmlsec-notes-templates-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-dynamic-signature-templates.html">Creating dynamic signature templates.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-dynamic-encryption-templates.html">Creating dynamic encryption templates.</a></span></dt> </dl></dd> -<dt><a href="xmlsec-notes-init-shutdown.html">Initialization and shutdown.</a></dt> -<dt><a href="xmlsec-notes-sign-encrypt.html">Signing and encrypting documents.</a></dt> +<dt><span class="chapter"><a href="xmlsec-notes-verify-decrypt.html">Verifing and decrypting documents.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-sign-encrypt.html#XMLSEC-NOTES-SIGN-ENCRYPT-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-sign.html">Signing a document.</a></dt> -<dt><a href="xmlsec-notes-encrypt.html">Encrypting data.</a></dt> +<dt><span class="sect1"><a href="xmlsec-notes-verify-decrypt.html#xmlsec-notes-verify-decrypt-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-verify.html">Verifying a signed document</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-decrypt.html">Decrypting an encrypted document</a></span></dt> </dl></dd> -<dt><a href="xmlsec-notes-templates.html">Creating dynamic templates.</a></dt> +<dt><span class="chapter"><a href="xmlsec-notes-keys.html">Keys.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-notes-keysmngr.html">Keys manager.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-templates.html#XMLSEC-NOTES-TEMPLATES-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-dynamic-signature-templates.html">Creating dynamic signature templates.</a></dt> -<dt><a href="xmlsec-notes-dynamic-encryption-templates.html">Creating dynamic encryption templates.</a></dt> +<dt><span class="sect1"><a href="xmlsec-notes-keysmngr.html#xmlsec-notes-keysmngr-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-simple-keys-store.html">Simple keys store.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-keys-manager-sign-enc.html">Using keys manager for signatures/encryption.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-keys-mngr-verify-decrypt.html">Using keys manager for verification/decryption.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-custom-keys-store.html">Implementing a custom keys store.</a></span></dt> </dl></dd> -<dt><a href="xmlsec-notes-verify-decrypt.html">Verifing and decrypting documents.</a></dt> +<dt><span class="chapter"><a href="xmlsec-notes-x509.html">Using X509 Certificates.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-verify-decrypt.html#XMLSEC-NOTES-VERIFY-DECRYPT-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-verify.html">Verifying a signed document</a></dt> -<dt><a href="xmlsec-notes-decrypt.html">Decrypting an encrypted document</a></dt> +<dt><span class="sect1"><a href="xmlsec-notes-x509.html#xmlsec-notes-x509-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-sign-x509.html">Signing data with X509 certificate.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-verify-x509.html">Verifing document signed with X509 certificates.</a></span></dt> </dl></dd> -<dt><a href="xmlsec-notes-keys.html">Keys.</a></dt> -<dt><a href="xmlsec-notes-keysmngr.html">Keys manager.</a></dt> +<dt><span class="chapter"><a href="xmlsec-notes-transforms.html">Transforms and transforms chain.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-notes-contexts.html">Using context objects.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-notes-new-crypto.html">Adding support for new cryptographic library.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-keysmngr.html#XMLSEC-NOTES-KEYSMNGR-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-simple-keys-store.html">Simple keys store.</a></dt> -<dt><a href="xmlsec-notes-keys-manager-sign-enc.html">Using keys manager for signatures/encryption.</a></dt> -<dt><a href="xmlsec-notes-keys-mngr-verify-decrypt.html">Using keys manager for verification/decryption.</a></dt> -<dt><a href="xmlsec-notes-custom-keys-store.html">Implementing a custom keys store.</a></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto.html#xmlsec-notes-new-crypto-overview">Overview.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-skeleton.html">Creating a framework from the skeleton.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-functions.html">xmlSecCryptoApp* functions.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-klasses.html">Klasses and objects.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-transforms.html">Cryptographic transforms.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-keys.html">Keys data and keys data stores.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-simple-keys-mngr.html">Default keys manager.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-notes-new-crypto-sharing-results.html">Sharing the results.</a></span></dt> </dl></dd> -<dt><a href="xmlsec-notes-x509.html">Using X509 Certificates.</a></dt> +<dt><span class="chapter"><a href="xmlsec-examples.html">Examples.</a></span></dt> +<dd><dl> +<dt><span class="sect1"><a href="xmlsec-examples.html#xmlsec-examples-overview">XML Security Library Examples.</a></span></dt> +<dt><span class="sect1"><a href="xmlsec-examples-sign-template-file.html">Signing a template file.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-x509.html#XMLSEC-NOTES-X509-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-sign-x509.html">Signing data with X509 certificate.</a></dt> -<dt><a href="xmlsec-notes-verify-x509.html">Verifing document signed with X509 certificates.</a></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-template-file.html#xmlsec-example-sign1">sign1.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-template-file.html#xmlsec-example-sign1-tmpl">sign1-tmpl.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-template-file.html#xmlsec-example-sign1-res">sign1-res.xml</a></span></dt> </dl></dd> -<dt><a href="xmlsec-notes-transforms.html">Transforms and transforms chain.</a></dt> -<dt><a href="xmlsec-notes-contexts.html">Using context objects.</a></dt> -<dt><a href="xmlsec-notes-new-crypto.html">Adding support for new cryptographic library.</a></dt> +<dt><span class="sect1"><a href="xmlsec-examples-sign-dynamimc-template.html">Signing a dynamicaly created template.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-notes-new-crypto.html#XMLSEC-NOTES-NEW-CRYPTO-OVERVIEW">Overview.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-skeleton.html">Creating a framework from the skeleton.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-functions.html">xmlSecCryptoApp* functions.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-klasses.html">Klasses and objects.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-transforms.html">Cryptographic transforms.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-keys.html">Keys data and keys data stores.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-simple-keys-mngr.html">Default keys manager.</a></dt> -<dt><a href="xmlsec-notes-new-crypto-sharing-results.html">Sharing the results.</a></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-dynamimc-template.html#xmlsec-example-sign2">sign2.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-dynamimc-template.html#xmlsec-example-sign2-doc">sign2-doc.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-dynamimc-template.html#xmlsec-example-sign2-res">sign2-res.xml</a></span></dt> </dl></dd> -<dt><a href="xmlsec-examples.html">Examples.</a></dt> +<dt><span class="sect1"><a href="xmlsec-examples-sign-x509.html">Signing with X509 certificate.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-examples.html#XMLSEC-EXAMPLES-OVERVIEW">XML Security Library Examples.</a></dt> -<dt><a href="xmlsec-examples-sign-template-file.html">Signing a template file.</a></dt> -<dt><a href="xmlsec-examples-sign-dynamimc-template.html">Signing a dynamicaly created template.</a></dt> -<dt><a href="xmlsec-examples-sign-x509.html">Signing with X509 certificate.</a></dt> -<dt><a href="xmlsec-verify-with-key.html">Verifying a signature with a single key.</a></dt> -<dt><a href="xmlsec-verify-with-keys-mngr.html">Verifying a signature with keys manager.</a></dt> -<dt><a href="xmlsec-verify-with-x509.html">Verifying a signature with X509 certificates.</a></dt> -<dt><a href="xmlsec-verify-with-restrictions.html">Verifying a signature with additional restrictions.</a></dt> -<dt><a href="xmlsec-encrypt-template-file.html">Encrypting data with a template file.</a></dt> -<dt><a href="xmlsec-encrypt-dynamic-template.html">Encrypting data with a dynamicaly created template.</a></dt> -<dt><a href="xmlsec-encrypt-with-session-key.html">Encrypting data with a session key.</a></dt> -<dt><a href="xmlsec-decrypt-with-signle-key.html">Decrypting data with a single key.</a></dt> -<dt><a href="xmlsec-decrypt-with-keys-mngr.html">Decrypting data with keys manager.</a></dt> -<dt><a href="xmlsec-custom-keys-manager.html">Writing a custom keys manager.</a></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-x509.html#xmlsec-example-sign3">sign3.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-x509.html#xmlsec-example-sign3-doc">sign3-doc.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-examples-sign-x509.html#xmlsec-example-sign3-res">sign3-res.xml</a></span></dt> </dl></dd> -<dt><a href="xmlsec-signature-klasses.html">APPENDIX A. XML Security Library Signature Klasses.</a></dt> -<dt><a href="xmlsec-encryption-klasses.html">APPENDIX B. XML Security Library Encryption Klasses.</a></dt> +<dt><span class="sect1"><a href="xmlsec-verify-with-key.html">Verifying a signature with a single key.</a></span></dt> +<dd><dl><dt><span class="sect2"><a href="xmlsec-verify-with-key.html#xmlsec-example-verify1">verify1.c</a></span></dt></dl></dd> +<dt><span class="sect1"><a href="xmlsec-verify-with-keys-mngr.html">Verifying a signature with keys manager.</a></span></dt> +<dd><dl><dt><span class="sect2"><a href="xmlsec-verify-with-keys-mngr.html#xmlsec-example-verify2">verify2.c</a></span></dt></dl></dd> +<dt><span class="sect1"><a href="xmlsec-verify-with-x509.html">Verifying a signature with X509 certificates.</a></span></dt> +<dd><dl><dt><span class="sect2"><a href="xmlsec-verify-with-x509.html#xmlsec-example-verify3">verify3.c</a></span></dt></dl></dd> +<dt><span class="sect1"><a href="xmlsec-verify-with-restrictions.html">Verifying a signature with additional restrictions.</a></span></dt> +<dd><dl> +<dt><span class="sect2"><a href="xmlsec-verify-with-restrictions.html#xmlsec-example-verify4">verify4.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-verify-with-restrictions.html#xmlsec-example-verify4-tmpl">verify4-tmpl.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-verify-with-restrictions.html#xmlsec-example-verify4-res">verify4-res.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-verify-with-restrictions.html#xmlsec-example-verify4-bad-tmpl">verify4-bad-tmpl.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-verify-with-restrictions.html#xmlsec-example-verify4-bad-res">verify4-bad-res.xml</a></span></dt> </dl></dd> -<dt>II. <a href="xmlsec-reference.html">XML Security Library API Reference.</a> -</dt> +<dt><span class="sect1"><a href="xmlsec-encrypt-template-file.html">Encrypting data with a template file.</a></span></dt> +<dd><dl> +<dt><span class="sect2"><a href="xmlsec-encrypt-template-file.html#xmlsec-example-encrypt1">encrypt1.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-encrypt-template-file.html#xmlsec-example-encrypt1-tmpl">encrypt1-tmpl.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-encrypt-template-file.html#xmlsec-example-encrypt1-res">encrypt1-res.xml</a></span></dt> +</dl></dd> +<dt><span class="sect1"><a href="xmlsec-encrypt-dynamic-template.html">Encrypting data with a dynamicaly created template.</a></span></dt> +<dd><dl> +<dt><span class="sect2"><a href="xmlsec-encrypt-dynamic-template.html#xmlsec-example-encrypt2">encrypt2.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-encrypt-dynamic-template.html#xmlsec-example-encrypt2-doc">encrypt2-doc.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-encrypt-dynamic-template.html#xmlsec-example-encrypt2-res">encrypt2-res.xml</a></span></dt> +</dl></dd> +<dt><span class="sect1"><a href="xmlsec-encrypt-with-session-key.html">Encrypting data with a session key.</a></span></dt> +<dd><dl> +<dt><span class="sect2"><a href="xmlsec-encrypt-with-session-key.html#xmlsec-example-encrypt3">encrypt3.c</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-encrypt-with-session-key.html#xmlsec-example-encrypt3-doc">encrypt3-doc.xml</a></span></dt> +<dt><span class="sect2"><a href="xmlsec-encrypt-with-session-key.html#xmlsec-example-encrypt3-res">encrypt3-res.xml</a></span></dt> +</dl></dd> +<dt><span class="sect1"><a href="xmlsec-decrypt-with-signle-key.html">Decrypting data with a single key.</a></span></dt> +<dd><dl><dt><span class="sect2"><a href="xmlsec-decrypt-with-signle-key.html#xmlsec-example-decrypt1">decrypt1.c</a></span></dt></dl></dd> +<dt><span class="sect1"><a href="xmlsec-decrypt-with-keys-mngr.html">Decrypting data with keys manager.</a></span></dt> +<dd><dl><dt><span class="sect2"><a href="xmlsec-decrypt-with-keys-mngr.html#xmlsec-example-decrypt2">decrypt2.c</a></span></dt></dl></dd> +<dt><span class="sect1"><a href="xmlsec-custom-keys-manager.html">Writing a custom keys manager.</a></span></dt> +<dd><dl><dt><span class="sect2"><a href="xmlsec-custom-keys-manager.html#xmlsec-example-decrypt3">decrypt3.c</a></span></dt></dl></dd> +</dl></dd> +<dt><span class="chapter"><a href="xmlsec-signature-klasses.html">APPENDIX A. XML Security Library Signature Klasses.</a></span></dt> +<dt><span class="chapter"><a href="xmlsec-encryption-klasses.html">APPENDIX B. XML Security Library Encryption Klasses.</a></span></dt> +</dl></dd> +<dt><span class="part"><a href="xmlsec-reference.html">II. XML Security Library API Reference.</a></span></dt> <dd><dl> -<dt><a href="xmlsec-ref.html">XML Security Core Library API Reference.</a></dt> +<dt><span class="chapter"><a href="xmlsec-ref.html">XML Security Core Library API Reference.</a></span></dt> <dd><dl> <dt> -<a href="xmlsec-app.html">app</a> -- Crypto-engine independent application support function.</dt> +<span class="refentrytitle"><a href="xmlsec-app.html">app</a></span><span class="refpurpose"> — Crypto-engine independent application support functions.</span> +</dt> <dt> -<a href="xmlsec-base64.html">base64</a> -- Base64 encoding/decoding functions.</dt> +<span class="refentrytitle"><a href="xmlsec-base64.html">base64</a></span><span class="refpurpose"> — Base64 encoding/decoding functions and base64 transform implementation.</span> +</dt> <dt> -<a href="xmlsec-bn.html">bn</a> -- Big numbers support functions.</dt> +<span class="refentrytitle"><a href="xmlsec-bn.html">bn</a></span><span class="refpurpose"> — Big numbers support functions.</span> +</dt> <dt> -<a href="xmlsec-buffer.html">buffer</a> -- Binary buffer implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-buffer.html">buffer</a></span><span class="refpurpose"> — Binary memory buffer functions.</span> +</dt> <dt> -<a href="xmlsec-dl.html">dl</a> -- Dynamic crypto-engine library loading support.</dt> +<span class="refentrytitle"><a href="xmlsec-dl.html">dl</a></span><span class="refpurpose"> — Dynamic crypto-engine library loading functions.</span> +</dt> <dt> -<a href="xmlsec-errors.html">errors</a> -- Error/log messages support.</dt> +<span class="refentrytitle"><a href="xmlsec-errors.html">errors</a></span><span class="refpurpose"> — Error reporting and logging functions.</span> +</dt> <dt> -<a href="xmlsec-io.html">io</a> -- Input/output support.</dt> +<span class="refentrytitle"><a href="xmlsec-io.html">io</a></span><span class="refpurpose"> — Input/output functions.</span> +</dt> <dt> -<a href="xmlsec-keyinfo.html">keyinfo</a> -- <a href="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo" target="_top"><dsig:KeyInfo/></a> node parser.</dt> +<span class="refentrytitle"><a href="xmlsec-keyinfo.html">keyinfo</a></span><span class="refpurpose"> — <dsig:KeyInfo/> node parser functions.</span> +</dt> <dt> -<a href="xmlsec-keysdata.html">keysdata</a> -- Crypto key data object definition.</dt> +<span class="refentrytitle"><a href="xmlsec-keysdata.html">keysdata</a></span><span class="refpurpose"> — Crypto key data object functions.</span> +</dt> <dt> -<a href="xmlsec-keys.html">keys</a> -- Crypto key object definition.</dt> +<span class="refentrytitle"><a href="xmlsec-keys.html">keys</a></span><span class="refpurpose"> — Crypto key object functions.</span> +</dt> <dt> -<a href="xmlsec-keysmngr.html">keysmngr</a> -- Keys manager object support.</dt> +<span class="refentrytitle"><a href="xmlsec-keysmngr.html">keysmngr</a></span><span class="refpurpose"> — Keys manager object functions.</span> +</dt> <dt> -<a href="xmlsec-list.html">list</a> -- Generic list structure implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-list.html">list</a></span><span class="refpurpose"> — Generic list structure functions.</span> +</dt> <dt> -<a href="xmlsec-membuf.html">membuf</a> -- Memory buffer transform implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-membuf.html">membuf</a></span><span class="refpurpose"> — Memory buffer transform functions.</span> +</dt> <dt> -<a href="xmlsec-nodeset.html">nodeset</a> -- Nodeset object implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-nodeset.html">nodeset</a></span><span class="refpurpose"> — XML nodes set functions</span> +</dt> <dt> -<a href="xmlsec-parser.html">parser</a> -- Parser transform implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-parser.html">parser</a></span><span class="refpurpose"> — XML parser functions and the XML parser transform implementation.</span> +</dt> <dt> -<a href="xmlsec-templates.html">templates</a> -- Dynamic templates creation functions.</dt> +<span class="refentrytitle"><a href="xmlsec-templates.html">templates</a></span><span class="refpurpose"> — XML signature and encryption template functions.</span> +</dt> <dt> -<a href="xmlsec-transforms.html">transforms</a> -- Transform object definition.</dt> +<span class="refentrytitle"><a href="xmlsec-transforms.html">transforms</a></span><span class="refpurpose"> — Transform object functions.</span> +</dt> <dt> -<a href="xmlsec-version.html">version</a> -- Version macros.</dt> +<span class="refentrytitle"><a href="xmlsec-version.html">version</a></span><span class="refpurpose"> — Version macros.</span> +</dt> <dt> -<a href="xmlsec-xmldsig.html">xmldsig</a> -- XML Digital Signature support.</dt> +<span class="refentrytitle"><a href="xmlsec-xmldsig.html">xmldsig</a></span><span class="refpurpose"> — XML Digital Signature functions.</span> +</dt> <dt> -<a href="xmlsec-xmlenc.html">xmlenc</a> -- XML Encryption support.</dt> +<span class="refentrytitle"><a href="xmlsec-xmlenc.html">xmlenc</a></span><span class="refpurpose"> — XML Encryption support.</span> +</dt> <dt> -<a href="xmlsec-xmlsec.html">xmlsec</a> -- Utility functions.</dt> +<span class="refentrytitle"><a href="xmlsec-xmlsec.html">xmlsec</a></span><span class="refpurpose"> — Utility functions.</span> +</dt> <dt> -<a href="xmlsec-xmltree.html">xmltree</a> -- XML tree operations.</dt> +<span class="refentrytitle"><a href="xmlsec-xmltree.html">xmltree</a></span><span class="refpurpose"> — XML tree functions.</span> +</dt> <dt> -<a href="xmlsec-x509.html">x509</a> -- <a href="http://www.w3.org/TR/xmldsig-core/#sec-X509Certificate" target="_top"><dsig:X509Certificate/></a> node parser.</dt> +<span class="refentrytitle"><a href="xmlsec-x509.html">x509</a></span><span class="refpurpose"> — <dsig:X509Certificate/> node parser functions.</span> +</dt> </dl></dd> -<dt><a href="xmlsec-openssl-ref.html">XML Security Library for OpenSLL API Reference.</a></dt> +<dt><span class="chapter"><a href="xmlsec-openssl-ref.html">XML Security Library for OpenSLL API Reference.</a></span></dt> <dd><dl> <dt> -<a href="xmlsec-openssl-app.html">app</a> -- Application functions implementation for OpenSSL.</dt> +<span class="refentrytitle"><a href="xmlsec-openssl-app.html">app</a></span><span class="refpurpose"> — Application support functions for OpenSSL.</span> +</dt> <dt> -<a href="xmlsec-openssl-bn.html">bn</a> -- Big numbers helper functions.</dt> +<span class="refentrytitle"><a href="xmlsec-openssl-bn.html">bn</a></span><span class="refpurpose"> — Big numbers (BIGNUM) support functions implementation for OpenSSL.</span> +</dt> <dt> -<a href="xmlsec-openssl-crypto.html">crypto</a> -- Crypto transforms implementation for OpenSSL.</dt> +<span class="refentrytitle"><a href="xmlsec-openssl-crypto.html">crypto</a></span><span class="refpurpose"> — Crypto transforms implementation for OpenSSL.</span> +</dt> <dt> -<a href="xmlsec-openssl-evp.html">evp</a> -- EVP keys data implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-openssl-evp.html">evp</a></span><span class="refpurpose"> — Private/public (EVP) keys implementation for OpenSSL.</span> +</dt> <dt> -<a href="xmlsec-openssl-x509.html">x509</a> -- X509 certificates support implementation for OpenSSL.</dt> +<span class="refentrytitle"><a href="xmlsec-openssl-x509.html">x509</a></span><span class="refpurpose"> — X509 certificates implementation for OpenSSL.</span> +</dt> </dl></dd> -<dt><a href="xmlsec-gnutls-ref.html">XML Security Library for GnuTLS API Reference.</a></dt> +<dt><span class="chapter"><a href="xmlsec-gnutls-ref.html">XML Security Library for GnuTLS API Reference.</a></span></dt> <dd><dl> <dt> -<a href="xmlsec-gnutls-app.html">app</a> -- Application functions implementation for GnuTLS.</dt> +<span class="refentrytitle"><a href="xmlsec-gnutls-app.html">app</a></span><span class="refpurpose"> — Application support functions for GnuTLS.</span> +</dt> <dt> -<a href="xmlsec-gnutls-crypto.html">crypto</a> -- Crypto transforms implementation for GnuTLS.</dt> +<span class="refentrytitle"><a href="xmlsec-gnutls-crypto.html">crypto</a></span><span class="refpurpose"> — Crypto transforms implementation for GnuTLS.</span> +</dt> +<dt> +<span class="refentrytitle"><a href="xmlsec-gnutls-x509.html">x509</a></span><span class="refpurpose"> — X509 certificates implementation for GnuTLS.</span> +</dt> </dl></dd> -<dt><a href="xmlsec-gcrypt-ref.html">XML Security Library for GCrypt API Reference.</a></dt> +<dt><span class="chapter"><a href="xmlsec-gcrypt-ref.html">XML Security Library for GCrypt API Reference.</a></span></dt> <dd><dl> <dt> -<a href="xmlsec-gcrypt-app.html">app</a> -- Application functions implementation for GnuTLS.</dt> +<span class="refentrytitle"><a href="xmlsec-gcrypt-app.html">app</a></span><span class="refpurpose"> — Application support functions for GCrypt.</span> +</dt> <dt> -<a href="xmlsec-gcrypt-crypto.html">crypto</a> -- Crypto transforms implementation for GCrypt.</dt> +<span class="refentrytitle"><a href="xmlsec-gcrypt-crypto.html">crypto</a></span><span class="refpurpose"> — Crypto transforms implementation for GCrypt.</span> +</dt> </dl></dd> -<dt><a href="xmlsec-nss-ref.html">XML Security Library for NSS API Reference.</a></dt> +<dt><span class="chapter"><a href="xmlsec-nss-ref.html">XML Security Library for NSS API Reference.</a></span></dt> <dd><dl> <dt> -<a href="xmlsec-nss-app.html">app</a> -- Application functions implementation for NSS.</dt> +<span class="refentrytitle"><a href="xmlsec-nss-app.html">app</a></span><span class="refpurpose"> — Application support functions for NSS.</span> +</dt> +<dt> +<span class="refentrytitle"><a href="xmlsec-nss-bignum.html">bignum</a></span><span class="refpurpose"> — Big numbers support functions implementation for NSS.</span> +</dt> +<dt> +<span class="refentrytitle"><a href="xmlsec-nss-crypto.html">crypto</a></span><span class="refpurpose"> — Crypto transforms implementation for NSS.</span> +</dt> +<dt> +<span class="refentrytitle"><a href="xmlsec-nss-keysstore.html">keysstore</a></span><span class="refpurpose"> — Keys store implementation for NSS.</span> +</dt> +<dt> +<span class="refentrytitle"><a href="xmlsec-nss-pkikeys.html">pkikeys</a></span><span class="refpurpose"> — Private/public keys implementation for NSS.</span> +</dt> +<dt> +<span class="refentrytitle"><a href="xmlsec-nss-x509.html">x509</a></span><span class="refpurpose"> — X509 certificates implementation for NSS.</span> +</dt> +</dl></dd> +<dt><span class="chapter"><a href="xmlsec-mscrypto-ref.html">XML Security Library for Microsoft Crypto API Reference.</a></span></dt> +<dd><dl> <dt> -<a href="xmlsec-nss-bignum.html">bignum</a> -- Big numbers helper functions.</dt> +<span class="refentrytitle"><a href="xmlsec-mscrypto-app.html">app</a></span><span class="refpurpose"> — Application support functions for Microsoft Crypto API.</span> +</dt> <dt> -<a href="xmlsec-nss-crypto.html">crypto</a> -- Crypto transforms implementation for NSS.</dt> +<span class="refentrytitle"><a href="xmlsec-mscrypto-certkeys.html">certkeys</a></span><span class="refpurpose"> — Certificate keys support functions for Microsoft Crypto API.</span> +</dt> <dt> -<a href="xmlsec-nss-keysstore.html">keysstore</a> -- Keys store implementation for NSS.</dt> +<span class="refentrytitle"><a href="xmlsec-mscrypto-crypto.html">crypto</a></span><span class="refpurpose"> — Crypto transforms implementation for Microsoft Crypto API.</span> +</dt> <dt> -<a href="xmlsec-nss-pkikeys.html">pkikeys</a> -- PKI keys data implementation.</dt> +<span class="refentrytitle"><a href="xmlsec-mscrypto-keysstore.html">keysstore</a></span><span class="refpurpose"> — Keys store implementation for Microsoft Crypto API.</span> +</dt> <dt> -<a href="xmlsec-nss-x509.html">x509</a> -- X509 certificates support implementation for NSS.</dt> +<span class="refentrytitle"><a href="xmlsec-mscrypto-x509.html">x509</a></span><span class="refpurpose"> — X509 certificates implementation for Microsoft Crypto API.</span> +</dt> </dl></dd> -<dt><a href="xmlsec-mscrypto-ref.html">XML Security Library for MSCrypto API Reference.</a></dt> +<dt><span class="chapter"><a href="xmlsec-msccng-ref.html">XML Security Library for Microsoft Cryptography API: Next Generation (CNG) Reference.</a></span></dt> <dd><dl> <dt> -<a href="xmlsec-mscrypto-app.html">app</a> -- Application functions implementation for MS Crypto.</dt> +<span class="refentrytitle"><a href="xmlsec-mscng-app.html">app</a></span><span class="refpurpose"> — Application support functions for Microsoft Cryptography API: Next Generation (CNG).</span> +</dt> <dt> -<a href="xmlsec-mscrypto-certkeys.html">certkeys</a> -- MS Crypto certificates helper functions.</dt> +<span class="refentrytitle"><a href="xmlsec-mscng-certkeys.html">certkeys</a></span><span class="refpurpose"> — Certificate keys support functions for Microsoft Cryptography API: Next Generation (CNG).</span> +</dt> <dt> -<a href="xmlsec-mscrypto-crypto.html">crypto</a> -- Crypto transforms implementation for MS Crypto.</dt> +<span class="refentrytitle"><a href="xmlsec-mscng-crypto.html">crypto</a></span><span class="refpurpose"> — Crypto transforms implementation for Microsoft Cryptography API: Next Generation (CNG).</span> +</dt> <dt> -<a href="xmlsec-mscrypto-keysstore.html">keysstore</a> -- Keys store implementation for MS Crypto.</dt> +<span class="refentrytitle"><a href="xmlsec-mscng-keysstore.html">keysstore</a></span><span class="refpurpose"> — Keys store implementation for Microsoft Cryptography API: Next Generation (CNG).</span> +</dt> <dt> -<a href="xmlsec-mscrypto-x509.html">x509</a> -- X509 certificates support implementation for MS Crypto.</dt> +<span class="refentrytitle"><a href="xmlsec-mscng-x509.html">x509</a></span><span class="refpurpose"> — X509 certificates implementation for Microsoft Cryptography API: Next Generation (CNG).</span> +</dt> </dl></dd> -<dt><a href="xmlsec-index.html">XML Security Library Reference Index</a></dt> +<dt><span class="chapter"><a href="xmlsec-index.html">XML Security Library Reference Index</a></span></dt> </dl></dd> </dl></div> </div> -<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="2"><tr valign="middle"> -<td align="left"></td> -<td align="right"><a accesskey="n" href="xmlsec-notes.html"><b>XML Security Library Tutorial >>></b></a></td> -</tr></table> -</td></tr></table></td> -</tr></table></body> +<div class="footer"> +<hr>Generated by GTK-Doc V1.27</div> +</body> </html> diff --git a/docs/api/left-insensitive.png b/docs/api/left-insensitive.png Binary files differnew file mode 100644 index 00000000..903790a0 --- /dev/null +++ b/docs/api/left-insensitive.png diff --git a/docs/api/left.png b/docs/api/left.png Binary files differindex c518641e..21b31e32 100644 --- a/docs/api/left.png +++ b/docs/api/left.png diff --git a/docs/api/right-insensitive.png b/docs/api/right-insensitive.png Binary files differnew file mode 100644 index 00000000..a3696bf9 --- /dev/null +++ b/docs/api/right-insensitive.png diff --git a/docs/api/right.png b/docs/api/right.png Binary files differindex 78f5875a..73d25da4 100644 --- a/docs/api/right.png +++ b/docs/api/right.png diff --git a/docs/api/src/chapters/new-crypto.sgml b/docs/api/src/chapters/new-crypto.sgml index 35cbd145..d0d14c05 100644 --- a/docs/api/src/chapters/new-crypto.sgml +++ b/docs/api/src/chapters/new-crypto.sgml @@ -410,7 +410,7 @@ struct _xmlSecTransform { after transform execution is finished. The <link linkend="xmlSecTransformVerifyMethod">verify</link> method implementation must set the "status" member to <link linkend="xmlSecTransformStatusOk">xmlSecTransformStatusOk</link> - if signature, hmac or digest is successfuly verified or to + if signature, hmac or digest is successfully verified or to <link linkend="xmlSecTransformStatusFail">xmlSecTransformStatusFail</link> otherwise. </para> diff --git a/docs/api/src/chapters/using-x509-certs.sgml b/docs/api/src/chapters/using-x509-certs.sgml index 8ff029d9..ef17d79c 100644 --- a/docs/api/src/chapters/using-x509-certs.sgml +++ b/docs/api/src/chapters/using-x509-certs.sgml @@ -119,7 +119,7 @@ <figure> <title>Certificates chain.</title> <programlisting> -Certificate A (signed with B) <- Certificate B (signed with C) <- ... <- Root Certificate (signed by itself) +Certificate A (signed with B) <- Certificate B (signed with C) <- ... <- Root Certificate (signed by itself) </programlisting> </figure> At the end of the chain there is a "Root Certificate" which diff --git a/docs/api/src/xmlsec.sgml b/docs/api/src/xmlsec.sgml index fdb3ac1f..d418adbd 100644 --- a/docs/api/src/xmlsec.sgml +++ b/docs/api/src/xmlsec.sgml @@ -1,7 +1,9 @@ -<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" " +http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ <!ENTITY chapter-compiling-and-linking SYSTEM "chapters/compiling-and-linking.sgml"> -<!ENTITY chapter-init-and-shutdown SYSTEM "chapters/init-and-shutdown.sgml"> -<!ENTITY chapter-sign-and-encrypt SYSTEM "chapters/sign-and-encrypt.sgml"> +<!ENTITY chapter-init-and-shutdown SYSTEM "chapters/init-and-shutdown.sgml"> +<!ENTITY chapter-sign-and-encrypt SYSTEM "chapters/sign-and-encrypt.sgml"> <!ENTITY chapter-verify-and-decrypt SYSTEM "chapters/verify-and-decrypt.sgml"> <!ENTITY chapter-creating-templates SYSTEM "chapters/creating-templates.sgml"> <!ENTITY chapter-using-keys SYSTEM "chapters/using-keys.sgml"> @@ -14,55 +16,61 @@ <!ENTITY xmlsec-index SYSTEM "xmlsec-index.sgml"> -<!ENTITY xmlsec-app SYSTEM "app.sgml"> -<!ENTITY xmlsec-base64 SYSTEM "base64.sgml"> -<!ENTITY xmlsec-bn SYSTEM "bn.sgml"> -<!ENTITY xmlsec-buffer SYSTEM "buffer.sgml"> -<!ENTITY xmlsec-dl SYSTEM "dl.sgml"> -<!ENTITY xmlsec-errors SYSTEM "errors.sgml"> -<!ENTITY xmlsec-io SYSTEM "io.sgml"> -<!ENTITY xmlsec-keyinfo SYSTEM "keyinfo.sgml"> -<!ENTITY xmlsec-keysdata SYSTEM "keysdata.sgml"> -<!ENTITY xmlsec-keys SYSTEM "keys.sgml"> -<!ENTITY xmlsec-keysmngr SYSTEM "keysmngr.sgml"> -<!ENTITY xmlsec-list SYSTEM "list.sgml"> -<!ENTITY xmlsec-membuf SYSTEM "membuf.sgml"> -<!ENTITY xmlsec-nodeset SYSTEM "nodeset.sgml"> -<!ENTITY xmlsec-parser SYSTEM "parser.sgml"> -<!ENTITY xmlsec-templates SYSTEM "templates.sgml"> -<!ENTITY xmlsec-transforms SYSTEM "transforms.sgml"> -<!ENTITY xmlsec-version SYSTEM "version.sgml"> -<!ENTITY xmlsec-xmldsig SYSTEM "xmldsig.sgml"> -<!ENTITY xmlsec-xmlenc SYSTEM "xmlenc.sgml"> -<!ENTITY xmlsec-xmlsec SYSTEM "xmlsec.sgml"> -<!ENTITY xmlsec-xmltree SYSTEM "xmltree.sgml"> -<!ENTITY xmlsec-x509 SYSTEM "x509.sgml"> - -<!ENTITY xmlsec-openssl-app SYSTEM "openssl/app.sgml"> -<!ENTITY xmlsec-openssl-bn SYSTEM "openssl/bn.sgml"> -<!ENTITY xmlsec-openssl-ciphers SYSTEM "openssl/ciphers.sgml"> -<!ENTITY xmlsec-openssl-crypto SYSTEM "openssl/crypto.sgml"> -<!ENTITY xmlsec-openssl-evp SYSTEM "openssl/evp.sgml"> -<!ENTITY xmlsec-openssl-x509 SYSTEM "openssl/x509.sgml"> - -<!ENTITY xmlsec-gnutls-app SYSTEM "gnutls/app.sgml"> -<!ENTITY xmlsec-gnutls-crypto SYSTEM "gnutls/crypto.sgml"> - -<!ENTITY xmlsec-gcrypt-app SYSTEM "gcrypt/app.sgml"> -<!ENTITY xmlsec-gcrypt-crypto SYSTEM "gcrypt/crypto.sgml"> - -<!ENTITY xmlsec-nss-app SYSTEM "nss/app.sgml"> -<!ENTITY xmlsec-nss-bignum SYSTEM "nss/bignum.sgml"> -<!ENTITY xmlsec-nss-crypto SYSTEM "nss/crypto.sgml"> -<!ENTITY xmlsec-nss-keysstore SYSTEM "nss/keysstore.sgml"> -<!ENTITY xmlsec-nss-pkikeys SYSTEM "nss/pkikeys.sgml"> -<!ENTITY xmlsec-nss-x509 SYSTEM "nss/x509.sgml"> - -<!ENTITY xmlsec-mscrypto-app SYSTEM "mscrypto/app.sgml"> -<!ENTITY xmlsec-mscrypto-certkeys SYSTEM "mscrypto/certkeys.sgml"> -<!ENTITY xmlsec-mscrypto-crypto SYSTEM "mscrypto/crypto.sgml"> -<!ENTITY xmlsec-mscrypto-keysstore SYSTEM "mscrypto/keysstore.sgml"> -<!ENTITY xmlsec-mscrypto-x509 SYSTEM "mscrypto/x509.sgml"> +<!ENTITY xmlsec-app "base/app.xml"> +<!ENTITY xmlsec-base64 "base/base64.xml"> +<!ENTITY xmlsec-bn "base/bn.xml"> +<!ENTITY xmlsec-buffer "base/buffer.xml"> +<!ENTITY xmlsec-dl "base/dl.xml"> +<!ENTITY xmlsec-errors "base/errors.xml"> +<!ENTITY xmlsec-io "base/io.xml"> +<!ENTITY xmlsec-keyinfo "base/keyinfo.xml"> +<!ENTITY xmlsec-keysdata "base/keysdata.xml"> +<!ENTITY xmlsec-keys "base/keys.xml"> +<!ENTITY xmlsec-keysmngr "base/keysmngr.xml"> +<!ENTITY xmlsec-list "base/list.xml"> +<!ENTITY xmlsec-membuf "base/membuf.xml"> +<!ENTITY xmlsec-nodeset "base/nodeset.xml"> +<!ENTITY xmlsec-parser "base/parser.xml"> +<!ENTITY xmlsec-templates "base/templates.xml"> +<!ENTITY xmlsec-transforms "base/transforms.xml"> +<!ENTITY xmlsec-version "base/version.xml"> +<!ENTITY xmlsec-x509 "base/x509.xml"> +<!ENTITY xmlsec-xmldsig "base/xmldsig.xml"> +<!ENTITY xmlsec-xmlenc "base/xmlenc.xml"> +<!ENTITY xmlsec-xmlsec "base/xmlsec.xml"> +<!ENTITY xmlsec-xmltree "base/xmltree.xml"> + +<!ENTITY xmlsec-openssl-app "openssl/app.xml"> +<!ENTITY xmlsec-openssl-bn "openssl/bn.xml"> +<!ENTITY xmlsec-openssl-crypto "openssl/crypto.xml"> +<!ENTITY xmlsec-openssl-evp "openssl/evp.xml"> +<!ENTITY xmlsec-openssl-x509 "openssl/x509.xml"> + +<!ENTITY xmlsec-gnutls-app "gnutls/app.xml"> +<!ENTITY xmlsec-gnutls-crypto "gnutls/crypto.xml"> +<!ENTITY xmlsec-gnutls-x509 "gnutls/x509.xml"> + +<!ENTITY xmlsec-gcrypt-app "gcrypt/app.xml"> +<!ENTITY xmlsec-gcrypt-crypto "gcrypt/crypto.xml"> + +<!ENTITY xmlsec-nss-app "nss/app.xml"> +<!ENTITY xmlsec-nss-bignum "nss/bignum.xml"> +<!ENTITY xmlsec-nss-crypto "nss/crypto.xml"> +<!ENTITY xmlsec-nss-keysstore "nss/keysstore.xml"> +<!ENTITY xmlsec-nss-pkikeys "nss/pkikeys.xml"> +<!ENTITY xmlsec-nss-x509 "nss/x509.xml"> + +<!ENTITY xmlsec-mscrypto-app "mscrypto/app.xml"> +<!ENTITY xmlsec-mscrypto-certkeys "mscrypto/certkeys.xml"> +<!ENTITY xmlsec-mscrypto-crypto "mscrypto/crypto.xml"> +<!ENTITY xmlsec-mscrypto-keysstore "mscrypto/keysstore.xml"> +<!ENTITY xmlsec-mscrypto-x509 "mscrypto/x509.xml"> + +<!ENTITY xmlsec-mscng-app "mscng/app.xml"> +<!ENTITY xmlsec-mscng-certkeys "mscng/certkeys.xml"> +<!ENTITY xmlsec-mscng-crypto "mscng/crypto.xml"> +<!ENTITY xmlsec-mscng-keysstore "mscng/keysstore.xml"> +<!ENTITY xmlsec-mscng-x509 "mscng/x509.xml"> <!ENTITY xmlsec-example-sign1 SYSTEM "examples/sign1.sgml"> <!ENTITY xmlsec-example-sign2 SYSTEM "examples/sign2.sgml"> @@ -99,7 +107,7 @@ <!ENTITY xmlsec-example-encrypt3-doc SYSTEM "examples/encrypt3-doc.sgml"> <!ENTITY xmlsec-example-encrypt3-res SYSTEM "examples/encrypt3-res.sgml"> ]> -<book id="index"> +<book id="index" xmlns:xi="http://www.w3.org/2001/XInclude"> <bookinfo> <title>XML Security Library Reference Manual</title> <authorgroup> @@ -114,7 +122,7 @@ </author> </authorgroup> <copyright> - <year>2002-2003</year> + <year>2002-2017</year> <holder>Aleksey Sanin</holder> </copyright> <legalnotice> @@ -146,14 +154,15 @@ <para>XML Security Library provides support for XML Digital Signature and XML Encryption. It is based on LibXML/LibXSLT and can use practicaly any crypto library (currently there is "out of the box" - support for OpenSSL, MSCrypto, GnuTLS, GCrypt and NSS). + support for OpenSSL, Microsoft Crypto API, Microsoft Cryptography API: + Next Generation (CNG), GnuTLS, GCrypt and NSS). </para> </chapter> <chapter id="xmlsec-notes-structure"> <title>XML Security Library Structure.</title> <para>In order to provide the an ability to use different crypto engines, the XML Security Library is splitted in two parts: core library (xmlsec) - and crypto library (xmlsec-openssl, xmlsec-mscrypt, xmlsec-gnutls, + and crypto library (xmlsec-openssl, xmlsec-mscrypt, xmlsec-mscng, xmlsec-gnutls, xmlsec-gcrypt, xmlsec-nss, ...). <figure> <title>The library structure and dependencies.</title> @@ -210,29 +219,29 @@ the public interfaces are documented here. This reference guide is build by extracting comments from the code sources. </para> - &xmlsec-app; - &xmlsec-base64; - &xmlsec-bn; - &xmlsec-buffer; - &xmlsec-dl; - &xmlsec-errors; - &xmlsec-io; - &xmlsec-keyinfo; - &xmlsec-keysdata; - &xmlsec-keys; - &xmlsec-keysmngr; - &xmlsec-list; - &xmlsec-membuf; - &xmlsec-nodeset; - &xmlsec-parser; - &xmlsec-templates; - &xmlsec-transforms; - &xmlsec-version; - &xmlsec-xmldsig; - &xmlsec-xmlenc; - &xmlsec-xmlsec; - &xmlsec-xmltree; - &xmlsec-x509; + <xi:include href="&xmlsec-app;"/> + <xi:include href="&xmlsec-base64;"/> + <xi:include href="&xmlsec-bn;"/> + <xi:include href="&xmlsec-buffer;"/> + <xi:include href="&xmlsec-dl;"/> + <xi:include href="&xmlsec-errors;"/> + <xi:include href="&xmlsec-io;"/> + <xi:include href="&xmlsec-keyinfo;"/> + <xi:include href="&xmlsec-keysdata;"/> + <xi:include href="&xmlsec-keys;"/> + <xi:include href="&xmlsec-keysmngr;"/> + <xi:include href="&xmlsec-list;"/> + <xi:include href="&xmlsec-membuf;"/> + <xi:include href="&xmlsec-nodeset;"/> + <xi:include href="&xmlsec-parser;"/> + <xi:include href="&xmlsec-templates;"/> + <xi:include href="&xmlsec-transforms;"/> + <xi:include href="&xmlsec-version;"/> + <xi:include href="&xmlsec-xmldsig;"/> + <xi:include href="&xmlsec-xmlenc;"/> + <xi:include href="&xmlsec-xmlsec;"/> + <xi:include href="&xmlsec-xmltree;"/> + <xi:include href="&xmlsec-x509;"/> </chapter> <chapter id="xmlsec-openssl-ref"> @@ -241,11 +250,11 @@ the public interfaces are documented here. This reference guide is build by extracting comments from the code sources. </para> - &xmlsec-openssl-app; - &xmlsec-openssl-bn; - &xmlsec-openssl-crypto; - &xmlsec-openssl-evp; - &xmlsec-openssl-x509; + <xi:include href="&xmlsec-openssl-app;"/> + <xi:include href="&xmlsec-openssl-bn;"/> + <xi:include href="&xmlsec-openssl-crypto;"/> + <xi:include href="&xmlsec-openssl-evp;"/> + <xi:include href="&xmlsec-openssl-x509;"/> </chapter> <chapter id="xmlsec-gnutls-ref"> @@ -254,8 +263,9 @@ the public interfaces are documented here. This reference guide is build by extracting comments from the code sources. </para> - &xmlsec-gnutls-app; - &xmlsec-gnutls-crypto; + <xi:include href="&xmlsec-gnutls-app;"/> + <xi:include href="&xmlsec-gnutls-crypto;"/> + <xi:include href="&xmlsec-gnutls-x509;"/> </chapter> <chapter id="xmlsec-gcrypt-ref"> @@ -264,8 +274,8 @@ the public interfaces are documented here. This reference guide is build by extracting comments from the code sources. </para> - &xmlsec-gcrypt-app; - &xmlsec-gcrypt-crypto; + <xi:include href="&xmlsec-gcrypt-app;"/> + <xi:include href="&xmlsec-gcrypt-crypto;"/> </chapter> <chapter id="xmlsec-nss-ref"> @@ -274,32 +284,49 @@ the public interfaces are documented here. This reference guide is build by extracting comments from the code sources. </para> - &xmlsec-nss-app; - &xmlsec-nss-bignum; - &xmlsec-nss-crypto; - &xmlsec-nss-keysstore; - &xmlsec-nss-pkikeys; - &xmlsec-nss-x509; + <xi:include href="&xmlsec-nss-app;"/> + <xi:include href="&xmlsec-nss-bignum;"/> + <xi:include href="&xmlsec-nss-crypto;"/> + <xi:include href="&xmlsec-nss-keysstore;"/> + <xi:include href="&xmlsec-nss-pkikeys;"/> + <xi:include href="&xmlsec-nss-x509;"/> </chapter> <chapter id="xmlsec-mscrypto-ref"> - <title>XML Security Library for MSCrypto API Reference.</title> - <para>This section contains the API reference for xmlsec-mscrypto. All - the public interfaces are documented here. This reference guide is - build by extracting comments from the code sources. </para> + <title>XML Security Library for Microsoft Crypto API Reference.</title> + <para>This section contains the API reference for xmlsec-mscrypto (based on + Microsoft Crypto API). All the public interfaces are documented here. + This reference guide is build by extracting comments from the code sources. + </para> - &xmlsec-mscrypto-app; - &xmlsec-mscrypto-certkeys; - &xmlsec-mscrypto-crypto; - &xmlsec-mscrypto-keysstore; - &xmlsec-mscrypto-x509; + <xi:include href="&xmlsec-mscrypto-app;"/> + <xi:include href="&xmlsec-mscrypto-certkeys;"/> + <xi:include href="&xmlsec-mscrypto-crypto;"/> + <xi:include href="&xmlsec-mscrypto-keysstore;"/> + <xi:include href="&xmlsec-mscrypto-x509;"/> </chapter> + + <chapter id="xmlsec-msccng-ref"> + <title>XML Security Library for Microsoft Cryptography API: Next Generation (CNG) Reference.</title> + <para>This section contains the API reference for xmlsec-mscng (based on + <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa376210(v=vs.85).aspx">Microsoft + Cryptography API: Next Generation (CNG)</a>). All the public interfaces are + documented here. This reference guide is build by extracting comments from + the code sources. </para> + + <xi:include href="&xmlsec-mscng-app;"/> + <xi:include href="&xmlsec-mscng-certkeys;"/> + <xi:include href="&xmlsec-mscng-crypto;"/> + <xi:include href="&xmlsec-mscng-keysstore;"/> + <xi:include href="&xmlsec-mscng-x509;"/> + </chapter> + <chapter id="xmlsec-index"> <title>XML Security Library Reference Index</title> <para> <itemizedlist> - &xmlsec-index; + &xmlsec-index; </itemizedlist> </para> </chapter> diff --git a/docs/api/style.css b/docs/api/style.css new file mode 100644 index 00000000..36754209 --- /dev/null +++ b/docs/api/style.css @@ -0,0 +1,479 @@ +body +{ + font-family: cantarell, sans-serif; +} +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ + background: #e6f3ff; + border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.informaltable table +{ + border-collapse: separate; + border-spacing: 1em 0.3em; + border: none; +} + +div.informaltable table td, div.informaltable table th +{ + vertical-align: top; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + +td p +{ + margin: 0.25em; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +h4 +{ + color: #555753; + margin-top: 1em; + margin-bottom: 1em; +} + +hr +{ + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; + border: none 0px; + height: 1px; + clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; + font-weight: bold; +} + +dl.toc > dl +{ + padding-bottom: 0.5em; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +/* code listings */ + +.listing_code .programlisting .normal, +.listing_code .programlisting .normal a, +.listing_code .programlisting .number, +.listing_code .programlisting .cbracket, +.listing_code .programlisting .symbol { color: #555753; } +.listing_code .programlisting .comment, +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .function, +.listing_code .programlisting .function a, +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ +.listing_code .programlisting .keyword, +.listing_code .programlisting .usertype, +.listing_code .programlisting .type, +.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + /* these have a <sup> as a first child, but since there are no parent selectors + * we can't use that. */ + a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + diff --git a/docs/api/tmpl/base/app.sgml b/docs/api/tmpl/base/app.sgml deleted file mode 100644 index b725a3b7..00000000 --- a/docs/api/tmpl/base/app.sgml +++ /dev/null @@ -1,1112 +0,0 @@ -<!-- ##### SECTION Title ##### --> -app - -<!-- ##### SECTION Short_Description ##### --> -Crypto-engine independent application support function. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Crypto-engine application support function used by xmlsec command line utility. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### FUNCTION xmlSecCryptoInit ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoShutdown ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoKeysMngrInit ##### --> -<para> - -</para> - -@mngr: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataAesId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataAesGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataDesId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataDesGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataDsaId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataDsaGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataEcdsaId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataEcdsaGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataGost2001Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataGost2001GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataGostR3410_2012_256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataGostR3410_2012_256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataGostR3410_2012_512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataGostR3410_2012_512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataHmacId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataHmacGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataRsaId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataRsaGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataX509Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataX509GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataRawX509CertId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataRawX509CertGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecX509StoreId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecX509StoreGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformAes128CbcId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformAes128CbcGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformAes192CbcId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformAes192CbcGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformAes256CbcId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformAes256CbcGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformKWAes128Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformKWAes128GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformKWAes192Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformKWAes192GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformKWAes256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformKWAes256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformDes3CbcId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformDes3CbcGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformKWDes3Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformKWDes3GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformDsaSha1Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformDsaSha1GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformDsaSha256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformDsaSha256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformEcdsaSha1Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformEcdsaSha1GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformEcdsaSha224Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformEcdsaSha224GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformEcdsaSha256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformEcdsaSha256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformEcdsaSha384Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformEcdsaSha384GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformEcdsaSha512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformEcdsaSha512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformGost2001GostR3411_94Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformGost2001GostR3411_94GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformGostR3410_2012GostR3411_2012_256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformGostR3410_2012GostR3411_2012_256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformGostR3410_2012GostR3411_2012_512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformGostR3410_2012GostR3411_2012_512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacMd5Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacMd5GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacRipemd160Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacRipemd160GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacSha1Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacSha1GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacSha224Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacSha224GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacSha256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacSha256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacSha384Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacSha384GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformHmacSha512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformHmacSha512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformMd5Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformMd5GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRipemd160Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRipemd160GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaMd5Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaMd5GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaRipemd160Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaRipemd160GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaSha1Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaSha1GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaSha224Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaSha224GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaSha256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaSha256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaSha384Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaSha384GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaSha512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaSha512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaPkcs1Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaPkcs1GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformRsaOaepId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformRsaOaepGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformGostR3411_94Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformGostR3411_94GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformGostR3411_2012_256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformGostR3411_2012_256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformGostR3411_2012_512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformGostR3411_2012_512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformSha1Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformSha1GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformSha224Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformSha224GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformSha256Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformSha256GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformSha384Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformSha384GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecTransformSha512Id ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformSha512GetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppInit ##### --> -<para> - -</para> - -@config: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppShutdown ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppDefaultKeysMngrInit ##### --> -<para> - -</para> - -@mngr: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppDefaultKeysMngrAdoptKey ##### --> -<para> - -</para> - -@mngr: -@key: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppDefaultKeysMngrLoad ##### --> -<para> - -</para> - -@mngr: -@uri: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppDefaultKeysMngrSave ##### --> -<para> - -</para> - -@mngr: -@filename: -@type: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppKeysMngrCertLoad ##### --> -<para> - -</para> - -@mngr: -@filename: -@format: -@type: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppKeysMngrCertLoadMemory ##### --> -<para> - -</para> - -@mngr: -@data: -@dataSize: -@format: -@type: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppKeyLoad ##### --> -<para> - -</para> - -@filename: -@format: -@pwd: -@pwdCallback: -@pwdCallbackCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppKeyLoadMemory ##### --> -<para> - -</para> - -@data: -@dataSize: -@format: -@pwd: -@pwdCallback: -@pwdCallbackCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppPkcs12Load ##### --> -<para> - -</para> - -@filename: -@pwd: -@pwdCallback: -@pwdCallbackCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppPkcs12LoadMemory ##### --> -<para> - -</para> - -@data: -@dataSize: -@pwd: -@pwdCallback: -@pwdCallbackCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppKeyCertLoad ##### --> -<para> - -</para> - -@key: -@filename: -@format: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppKeyCertLoadMemory ##### --> -<para> - -</para> - -@key: -@data: -@dataSize: -@format: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoAppGetDefaultPwdCallback ##### --> -<para> - -</para> - -@void: -@Returns: - - diff --git a/docs/api/tmpl/base/base64.sgml b/docs/api/tmpl/base/base64.sgml deleted file mode 100644 index a6d4ebfa..00000000 --- a/docs/api/tmpl/base/base64.sgml +++ /dev/null @@ -1,129 +0,0 @@ -<!-- ##### SECTION Title ##### --> -base64 - -<!-- ##### SECTION Short_Description ##### --> -Base64 encoding/decoding functions. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Base64 encoding/decoding functions. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### MACRO XMLSEC_BASE64_LINESIZE ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecBase64GetDefaultLineSize ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecBase64SetDefaultLineSize ##### --> -<para> - -</para> - -@columns: - - -<!-- ##### FUNCTION xmlSecBase64CtxCreate ##### --> -<para> - -</para> - -@encode: -@columns: -@Returns: - - -<!-- ##### FUNCTION xmlSecBase64CtxDestroy ##### --> -<para> - -</para> - -@ctx: - - -<!-- ##### FUNCTION xmlSecBase64CtxInitialize ##### --> -<para> - -</para> - -@ctx: -@encode: -@columns: -@Returns: - - -<!-- ##### FUNCTION xmlSecBase64CtxFinalize ##### --> -<para> - -</para> - -@ctx: - - -<!-- ##### FUNCTION xmlSecBase64CtxUpdate ##### --> -<para> - -</para> - -@ctx: -@in: -@inSize: -@out: -@outSize: -@Returns: - - -<!-- ##### FUNCTION xmlSecBase64CtxFinal ##### --> -<para> - -</para> - -@ctx: -@out: -@outSize: -@Returns: - - -<!-- ##### FUNCTION xmlSecBase64Encode ##### --> -<para> - -</para> - -@buf: -@len: -@columns: -@Returns: - - -<!-- ##### FUNCTION xmlSecBase64Decode ##### --> -<para> - -</para> - -@str: -@buf: -@len: -@Returns: - - diff --git a/docs/api/tmpl/base/bn.sgml b/docs/api/tmpl/base/bn.sgml deleted file mode 100644 index 8b000f2b..00000000 --- a/docs/api/tmpl/base/bn.sgml +++ /dev/null @@ -1,263 +0,0 @@ -<!-- ##### SECTION Title ##### --> -bn - -<!-- ##### SECTION Short_Description ##### --> -Big numbers support functions. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Big numbers support functions. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### ENUM xmlSecBnFormat ##### --> -<para> - -</para> - -@xmlSecBnBase64: -@xmlSecBnHex: -@xmlSecBnDec: - -<!-- ##### FUNCTION xmlSecBnCreate ##### --> -<para> - -</para> - -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnDestroy ##### --> -<para> - -</para> - -@bn: - - -<!-- ##### FUNCTION xmlSecBnInitialize ##### --> -<para> - -</para> - -@bn: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnFinalize ##### --> -<para> - -</para> - -@bn: - - -<!-- ##### FUNCTION xmlSecBnGetData ##### --> -<para> - -</para> - -@bn: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnSetData ##### --> -<para> - -</para> - -@bn: -@data: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnGetSize ##### --> -<para> - -</para> - -@bn: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnZero ##### --> -<para> - -</para> - -@bn: - - -<!-- ##### FUNCTION xmlSecBnFromString ##### --> -<para> - -</para> - -@bn: -@str: -@base: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnToString ##### --> -<para> - -</para> - -@bn: -@base: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnFromHexString ##### --> -<para> - -</para> - -@bn: -@str: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnToHexString ##### --> -<para> - -</para> - -@bn: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnFromDecString ##### --> -<para> - -</para> - -@bn: -@str: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnToDecString ##### --> -<para> - -</para> - -@bn: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnMul ##### --> -<para> - -</para> - -@bn: -@multiplier: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnDiv ##### --> -<para> - -</para> - -@bn: -@divider: -@mod: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnAdd ##### --> -<para> - -</para> - -@bn: -@delta: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnReverse ##### --> -<para> - -</para> - -@bn: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnCompare ##### --> -<para> - -</para> - -@bn: -@data: -@dataSize: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnCompareReverse ##### --> -<para> - -</para> - -@bn: -@data: -@dataSize: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnGetNodeValue ##### --> -<para> - -</para> - -@bn: -@cur: -@format: -@reverse: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnSetNodeValue ##### --> -<para> - -</para> - -@bn: -@cur: -@format: -@reverse: -@addLineBreaks: -@Returns: - - -<!-- ##### FUNCTION xmlSecBnBlobSetNodeValue ##### --> -<para> - -</para> - -@data: -@dataSize: -@cur: -@format: -@reverse: -@addLineBreaks: -@Returns: - - diff --git a/docs/api/tmpl/base/buffer.sgml b/docs/api/tmpl/base/buffer.sgml deleted file mode 100644 index 33a89bdb..00000000 --- a/docs/api/tmpl/base/buffer.sgml +++ /dev/null @@ -1,232 +0,0 @@ -<!-- ##### SECTION Title ##### --> -buffer - -<!-- ##### SECTION Short_Description ##### --> -Binary buffer implementation. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Binary buffer implementation. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### ENUM xmlSecAllocMode ##### --> -<para> - -</para> - -@xmlSecAllocModeExact: -@xmlSecAllocModeDouble: - -<!-- ##### STRUCT xmlSecBuffer ##### --> -<para> - -</para> - -@data: -@size: -@maxSize: -@allocMode: - -<!-- ##### FUNCTION xmlSecBufferSetDefaultAllocMode ##### --> -<para> - -</para> - -@defAllocMode: -@defInitialSize: - - -<!-- ##### FUNCTION xmlSecBufferCreate ##### --> -<para> - -</para> - -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferDestroy ##### --> -<para> - -</para> - -@buf: - - -<!-- ##### FUNCTION xmlSecBufferInitialize ##### --> -<para> - -</para> - -@buf: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferFinalize ##### --> -<para> - -</para> - -@buf: - - -<!-- ##### FUNCTION xmlSecBufferGetData ##### --> -<para> - -</para> - -@buf: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferSetData ##### --> -<para> - -</para> - -@buf: -@data: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferGetSize ##### --> -<para> - -</para> - -@buf: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferSetSize ##### --> -<para> - -</para> - -@buf: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferGetMaxSize ##### --> -<para> - -</para> - -@buf: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferSetMaxSize ##### --> -<para> - -</para> - -@buf: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferEmpty ##### --> -<para> - -</para> - -@buf: - - -<!-- ##### FUNCTION xmlSecBufferAppend ##### --> -<para> - -</para> - -@buf: -@data: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferPrepend ##### --> -<para> - -</para> - -@buf: -@data: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferRemoveHead ##### --> -<para> - -</para> - -@buf: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferRemoveTail ##### --> -<para> - -</para> - -@buf: -@size: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferReadFile ##### --> -<para> - -</para> - -@buf: -@filename: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferBase64NodeContentRead ##### --> -<para> - -</para> - -@buf: -@node: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferBase64NodeContentWrite ##### --> -<para> - -</para> - -@buf: -@node: -@columns: -@Returns: - - -<!-- ##### FUNCTION xmlSecBufferCreateOutputBuffer ##### --> -<para> - -</para> - -@buf: -@Returns: - - diff --git a/docs/api/tmpl/base/dl.sgml b/docs/api/tmpl/base/dl.sgml deleted file mode 100644 index 88ca8203..00000000 --- a/docs/api/tmpl/base/dl.sgml +++ /dev/null @@ -1,94 +0,0 @@ -<!-- ##### SECTION Title ##### --> -dl - -<!-- ##### SECTION Short_Description ##### --> -Dynamic crypto-engine library loading support. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Dynamic crypto-engine library loading support. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### FUNCTION xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms ##### --> -<para> - -</para> - -@functions: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLInit ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLShutdown ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLLoadLibrary ##### --> -<para> - -</para> - -@crypto: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLGetLibraryFunctions ##### --> -<para> - -</para> - -@crypto: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLUnloadLibrary ##### --> -<para> - -</para> - -@crypto: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLSetFunctions ##### --> -<para> - -</para> - -@functions: -@Returns: - - -<!-- ##### FUNCTION xmlSecCryptoDLGetFunctions ##### --> -<para> - -</para> - -@void: -@Returns: - - diff --git a/docs/api/tmpl/base/errors.sgml b/docs/api/tmpl/base/errors.sgml deleted file mode 100644 index 185ae22a..00000000 --- a/docs/api/tmpl/base/errors.sgml +++ /dev/null @@ -1,490 +0,0 @@ -<!-- ##### SECTION Title ##### --> -errors - -<!-- ##### SECTION Short_Description ##### --> -Error/log messages support. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Error/log messages support. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### MACRO XMLSEC_ERRORS_R_XMLSEC_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_MALLOC_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_STRDUP_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CRYPTO_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_XML_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_XSLT_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_IO_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_DISABLED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_NOT_IMPLEMENTED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_SIZE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_DATA ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_RESULT ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_TYPE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_OPERATION ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_STATUS ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_FORMAT ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_DATA_NOT_MATCH ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_NODE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_NODE_CONTENT ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_MISSING_NODE_ATTRIBUTE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_UNEXPECTED_NODE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_NODE_NOT_FOUND ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_TRANSFORM ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_TRANSFORM_KEY ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_URI_TYPE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_TRANSFORM_SAME_DOCUMENT_REQUIRED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_TRANSFORM_DISABLED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_KEY_DATA ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_KEY_DATA_NOT_FOUND ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_KEY_DATA_ALREADY_EXIST ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_KEY_NOT_FOUND ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_KEYDATA_DISABLED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_MAX_RETRIEVAL_TYPE_MISMATCH ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_MAX_ENCKEY_LEVEL ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CERT_VERIFY_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CERT_NOT_FOUND ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CERT_REVOKED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CERT_ISSUER_FAILED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CERT_NOT_YET_VALID ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_CERT_HAS_EXPIRED ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_DSIG_NO_REFERENCES ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_R_ASSERTION ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_ERRORS_MAX_NUMBER ##### --> -<para> - -</para> - - - -<!-- ##### USER_FUNCTION xmlSecErrorsCallback ##### --> -<para> - -</para> - -@file: -@line: -@func: -@errorObject: -@errorSubject: -@reason: -@msg: - - -<!-- ##### FUNCTION xmlSecErrorsInit ##### --> -<para> - -</para> - -@void: - - -<!-- ##### FUNCTION xmlSecErrorsShutdown ##### --> -<para> - -</para> - -@void: - - -<!-- ##### FUNCTION xmlSecErrorsSetCallback ##### --> -<para> - -</para> - -@callback: - - -<!-- ##### FUNCTION xmlSecErrorsDefaultCallback ##### --> -<para> - -</para> - -@file: -@line: -@func: -@errorObject: -@errorSubject: -@reason: -@msg: - - -<!-- ##### FUNCTION xmlSecErrorsDefaultCallbackEnableOutput ##### --> -<para> - -</para> - -@enabled: - - -<!-- ##### FUNCTION xmlSecErrorsGetCode ##### --> -<para> - -</para> - -@pos: -@Returns: - - -<!-- ##### FUNCTION xmlSecErrorsGetMsg ##### --> -<para> - -</para> - -@pos: -@Returns: - - -<!-- ##### MACRO XMLSEC_ERRORS_HERE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecErrorsSafeString ##### --> -<para> - -</para> - -@str: - - -<!-- ##### MACRO XMLSEC_ERRORS_NO_MESSAGE ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecError ##### --> -<para> - -</para> - -@file: -@line: -@func: -@errorObject: -@errorSubject: -@reason: -@msg: -@...: - - -<!-- ##### MACRO xmlSecAssert ##### --> -<para> - -</para> - -@p: - - -<!-- ##### MACRO xmlSecAssert2 ##### --> -<para> - -</para> - -@p: -@ret: - - diff --git a/docs/api/tmpl/base/exports.sgml b/docs/api/tmpl/base/exports.sgml deleted file mode 100644 index f4d396d5..00000000 --- a/docs/api/tmpl/base/exports.sgml +++ /dev/null @@ -1,29 +0,0 @@ -<!-- ##### SECTION Title ##### --> -exports - -<!-- ##### SECTION Short_Description ##### --> -Black magic to export functions on Windows. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Black magic to export functions on Windows. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### MACRO extern ##### --> -<para> - -</para> - - - diff --git a/docs/api/tmpl/base/io.sgml b/docs/api/tmpl/base/io.sgml deleted file mode 100644 index 494ae00d..00000000 --- a/docs/api/tmpl/base/io.sgml +++ /dev/null @@ -1,103 +0,0 @@ -<!-- ##### SECTION Title ##### --> -io - -<!-- ##### SECTION Short_Description ##### --> -Input/output support. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Input/output support. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### FUNCTION xmlSecIOInit ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecIOShutdown ##### --> -<para> - -</para> - -@void: - - -<!-- ##### FUNCTION xmlSecIOCleanupCallbacks ##### --> -<para> - -</para> - -@void: - - -<!-- ##### FUNCTION xmlSecIORegisterDefaultCallbacks ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecIORegisterCallbacks ##### --> -<para> - -</para> - -@matchFunc: -@openFunc: -@readFunc: -@closeFunc: -@Returns: - - -<!-- ##### MACRO xmlSecTransformInputURIId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecTransformInputURIGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecTransformInputURIOpen ##### --> -<para> - -</para> - -@transform: -@uri: -@Returns: - - -<!-- ##### FUNCTION xmlSecTransformInputURIClose ##### --> -<para> - -</para> - -@transform: -@Returns: - - diff --git a/docs/api/tmpl/base/keyinfo.sgml b/docs/api/tmpl/base/keyinfo.sgml deleted file mode 100644 index e6ea3916..00000000 --- a/docs/api/tmpl/base/keyinfo.sgml +++ /dev/null @@ -1,312 +0,0 @@ -<!-- ##### SECTION Title ##### --> -keyinfo - -<!-- ##### SECTION Short_Description ##### --> -<dsig:KeyInfo/> node parser. - -<!-- ##### SECTION Long_Description ##### --> -<para> -<dsig:KeyInfo/> node parser. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### FUNCTION xmlSecKeyInfoNodeRead ##### --> -<para> - -</para> - -@keyInfoNode: -@key: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyInfoNodeWrite ##### --> -<para> - -</para> - -@keyInfoNode: -@key: -@keyInfoCtx: -@Returns: - - -<!-- ##### ENUM xmlSecKeyInfoMode ##### --> -<para> - -</para> - -@xmlSecKeyInfoModeRead: -@xmlSecKeyInfoModeWrite: - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_DONT_STOP_ON_KEY_FOUND ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_STOP_ON_UNKNOWN_CHILD ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_KEYNAME_STOP_ON_UNKNOWN ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_KEYVALUE_STOP_ON_UNKNOWN_CHILD ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_RETRMETHOD_STOP_ON_UNKNOWN_HREF ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_RETRMETHOD_STOP_ON_MISMATCH_HREF ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_X509DATA_STOP_ON_UNKNOWN_CHILD ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_X509DATA_STOP_ON_UNKNOWN_CERT ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_X509DATA_STOP_ON_INVALID_CERT ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_ENCKEY_DONT_STOP_ON_FAILED_DECRYPTION ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE ##### --> -<para> - -</para> - - - -<!-- ##### MACRO XMLSEC_KEYINFO_FLAGS_X509DATA_SKIP_STRICT_CHECKS ##### --> -<para> - -</para> - - - -<!-- ##### STRUCT xmlSecKeyInfoCtx ##### --> -<para> - -</para> - -@userData: -@flags: -@flags2: -@keysMngr: -@mode: -@enabledKeyData: -@base64LineSize: -@retrievalMethodCtx: -@maxRetrievalMethodLevel: -@encCtx: -@maxEncryptedKeyLevel: -@certsVerificationTime: -@certsVerificationDepth: -@pgpReserved: -@curRetrievalMethodLevel: -@curEncryptedKeyLevel: -@keyReq: -@reserved0: -@reserved1: - -<!-- ##### FUNCTION xmlSecKeyInfoCtxCreate ##### --> -<para> - -</para> - -@keysMngr: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxDestroy ##### --> -<para> - -</para> - -@keyInfoCtx: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxInitialize ##### --> -<para> - -</para> - -@keyInfoCtx: -@keysMngr: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxFinalize ##### --> -<para> - -</para> - -@keyInfoCtx: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxReset ##### --> -<para> - -</para> - -@keyInfoCtx: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxCopyUserPref ##### --> -<para> - -</para> - -@dst: -@src: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxCreateEncCtx ##### --> -<para> - -</para> - -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxDebugDump ##### --> -<para> - -</para> - -@keyInfoCtx: -@output: - - -<!-- ##### FUNCTION xmlSecKeyInfoCtxDebugXmlDump ##### --> -<para> - -</para> - -@keyInfoCtx: -@output: - - -<!-- ##### MACRO xmlSecKeyDataNameId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataNameGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataValueId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataValueGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataRetrievalMethodId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataRetrievalMethodGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataEncryptedKeyId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataEncryptedKeyGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - diff --git a/docs/api/tmpl/base/keys.sgml b/docs/api/tmpl/base/keys.sgml deleted file mode 100644 index 7bd74cfa..00000000 --- a/docs/api/tmpl/base/keys.sgml +++ /dev/null @@ -1,521 +0,0 @@ -<!-- ##### SECTION Title ##### --> -keys - -<!-- ##### SECTION Short_Description ##### --> -Crypto key object definition. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Crypto key object definition. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### TYPEDEF xmlSecKeyUsage ##### --> -<para> - -</para> - - -<!-- ##### MACRO xmlSecKeyUsageSign ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyUsageVerify ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyUsageEncrypt ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyUsageDecrypt ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyUsageKeyExchange ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyUsageAny ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyUseWithInitialize ##### --> -<para> - -</para> - -@keyUseWith: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyUseWithFinalize ##### --> -<para> - -</para> - -@keyUseWith: - - -<!-- ##### FUNCTION xmlSecKeyUseWithReset ##### --> -<para> - -</para> - -@keyUseWith: - - -<!-- ##### FUNCTION xmlSecKeyUseWithCopy ##### --> -<para> - -</para> - -@dst: -@src: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyUseWithCreate ##### --> -<para> - -</para> - -@application: -@identifier: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyUseWithDuplicate ##### --> -<para> - -</para> - -@keyUseWith: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyUseWithDestroy ##### --> -<para> - -</para> - -@keyUseWith: - - -<!-- ##### FUNCTION xmlSecKeyUseWithSet ##### --> -<para> - -</para> - -@keyUseWith: -@application: -@identifier: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyUseWithDebugDump ##### --> -<para> - -</para> - -@keyUseWith: -@output: - - -<!-- ##### FUNCTION xmlSecKeyUseWithDebugXmlDump ##### --> -<para> - -</para> - -@keyUseWith: -@output: - - -<!-- ##### STRUCT xmlSecKeyUseWith ##### --> -<para> - -</para> - -@application: -@identifier: -@reserved1: -@reserved2: - -<!-- ##### MACRO xmlSecKeyUseWithPtrListId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyUseWithPtrListGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### STRUCT xmlSecKeyReq ##### --> -<para> - -</para> - -@keyId: -@keyType: -@keyUsage: -@keyBitsSize: -@keyUseWithList: -@reserved1: -@reserved2: - -<!-- ##### FUNCTION xmlSecKeyReqInitialize ##### --> -<para> - -</para> - -@keyReq: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReqFinalize ##### --> -<para> - -</para> - -@keyReq: - - -<!-- ##### FUNCTION xmlSecKeyReqReset ##### --> -<para> - -</para> - -@keyReq: - - -<!-- ##### FUNCTION xmlSecKeyReqCopy ##### --> -<para> - -</para> - -@dst: -@src: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReqMatchKey ##### --> -<para> - -</para> - -@keyReq: -@key: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReqMatchKeyValue ##### --> -<para> - -</para> - -@keyReq: -@value: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReqDebugDump ##### --> -<para> - -</para> - -@keyReq: -@output: - - -<!-- ##### FUNCTION xmlSecKeyReqDebugXmlDump ##### --> -<para> - -</para> - -@keyReq: -@output: - - -<!-- ##### STRUCT xmlSecKey ##### --> -<para> - -</para> - -@name: -@value: -@dataList: -@usage: -@notValidBefore: -@notValidAfter: - -<!-- ##### FUNCTION xmlSecKeyCreate ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDestroy ##### --> -<para> - -</para> - -@key: - - -<!-- ##### FUNCTION xmlSecKeyEmpty ##### --> -<para> - -</para> - -@key: - - -<!-- ##### FUNCTION xmlSecKeyDuplicate ##### --> -<para> - -</para> - -@key: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyCopy ##### --> -<para> - -</para> - -@keyDst: -@keySrc: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyGetName ##### --> -<para> - -</para> - -@key: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeySetName ##### --> -<para> - -</para> - -@key: -@name: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyGetType ##### --> -<para> - -</para> - -@key: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyGetValue ##### --> -<para> - -</para> - -@key: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeySetValue ##### --> -<para> - -</para> - -@key: -@value: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyGetData ##### --> -<para> - -</para> - -@key: -@dataId: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyEnsureData ##### --> -<para> - -</para> - -@key: -@dataId: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyAdoptData ##### --> -<para> - -</para> - -@key: -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDebugDump ##### --> -<para> - -</para> - -@key: -@output: - - -<!-- ##### FUNCTION xmlSecKeyDebugXmlDump ##### --> -<para> - -</para> - -@key: -@output: - - -<!-- ##### FUNCTION xmlSecKeyGenerate ##### --> -<para> - -</para> - -@dataId: -@sizeBits: -@type: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyGenerateByName ##### --> -<para> - -</para> - -@name: -@sizeBits: -@type: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyMatch ##### --> -<para> - -</para> - -@key: -@name: -@keyReq: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReadBuffer ##### --> -<para> - -</para> - -@dataId: -@buffer: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReadBinaryFile ##### --> -<para> - -</para> - -@dataId: -@filename: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyReadMemory ##### --> -<para> - -</para> - -@dataId: -@data: -@dataSize: -@Returns: - - -<!-- ##### MACRO xmlSecKeyIsValid ##### --> -<para> - -</para> - -@key: - - -<!-- ##### MACRO xmlSecKeyCheckId ##### --> -<para> - -</para> - -@key: -@keyId: - - -<!-- ##### MACRO xmlSecKeyPtrListId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyPtrListGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - diff --git a/docs/api/tmpl/base/keysdata.sgml b/docs/api/tmpl/base/keysdata.sgml deleted file mode 100644 index 32605213..00000000 --- a/docs/api/tmpl/base/keysdata.sgml +++ /dev/null @@ -1,930 +0,0 @@ -<!-- ##### SECTION Title ##### --> -keysdata - -<!-- ##### SECTION Short_Description ##### --> -Crypto key data object definition. - -<!-- ##### SECTION Long_Description ##### --> -<para> -Crypto key data object definition. -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### SECTION Stability_Level ##### --> - - -<!-- ##### SECTION Image ##### --> - - -<!-- ##### TYPEDEF xmlSecKeyDataUsage ##### --> -<para> - -</para> - - -<!-- ##### MACRO xmlSecKeyDataUsageUnknown ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageKeyInfoNodeRead ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageKeyInfoNodeWrite ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageKeyValueNodeRead ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageKeyValueNodeWrite ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageRetrievalMethodNodeXml ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageRetrievalMethodNodeBin ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageAny ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageKeyInfoNode ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageKeyValueNode ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataUsageRetrievalMethodNode ##### --> -<para> - -</para> - - - -<!-- ##### TYPEDEF xmlSecKeyDataType ##### --> -<para> - -</para> - - -<!-- ##### MACRO xmlSecKeyDataTypeUnknown ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypeNone ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypePublic ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypePrivate ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypeSymmetric ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypeSession ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypePermanent ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypeTrusted ##### --> -<para> - -</para> - - - -<!-- ##### MACRO xmlSecKeyDataTypeAny ##### --> -<para> - -</para> - - - -<!-- ##### ENUM xmlSecKeyDataFormat ##### --> -<para> - -</para> - -@xmlSecKeyDataFormatUnknown: -@xmlSecKeyDataFormatBinary: -@xmlSecKeyDataFormatPem: -@xmlSecKeyDataFormatDer: -@xmlSecKeyDataFormatPkcs8Pem: -@xmlSecKeyDataFormatPkcs8Der: -@xmlSecKeyDataFormatPkcs12: -@xmlSecKeyDataFormatCertPem: -@xmlSecKeyDataFormatCertDer: - -<!-- ##### FUNCTION xmlSecKeyDataIdsGet ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdsInit ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdsShutdown ##### --> -<para> - -</para> - -@void: - - -<!-- ##### FUNCTION xmlSecKeyDataIdsRegisterDefault ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdsRegister ##### --> -<para> - -</para> - -@id: -@Returns: - - -<!-- ##### STRUCT xmlSecKeyData ##### --> -<para> - -</para> - -@id: -@reserved0: -@reserved1: - -<!-- ##### FUNCTION xmlSecKeyDataCreate ##### --> -<para> - -</para> - -@id: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataDuplicate ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataDestroy ##### --> -<para> - -</para> - -@data: - - -<!-- ##### FUNCTION xmlSecKeyDataGenerate ##### --> -<para> - -</para> - -@data: -@sizeBits: -@type: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataGetType ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataGetSize ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataGetIdentifier ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataDebugDump ##### --> -<para> - -</para> - -@data: -@output: - - -<!-- ##### FUNCTION xmlSecKeyDataDebugXmlDump ##### --> -<para> - -</para> - -@data: -@output: - - -<!-- ##### FUNCTION xmlSecKeyDataXmlRead ##### --> -<para> - -</para> - -@id: -@key: -@node: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataXmlWrite ##### --> -<para> - -</para> - -@id: -@key: -@node: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinRead ##### --> -<para> - -</para> - -@id: -@key: -@buf: -@bufSize: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinWrite ##### --> -<para> - -</para> - -@id: -@key: -@buf: -@bufSize: -@keyInfoCtx: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataGetName ##### --> -<para> - -</para> - -@data: - - -<!-- ##### MACRO xmlSecKeyDataIsValid ##### --> -<para> - -</para> - -@data: - - -<!-- ##### MACRO xmlSecKeyDataCheckId ##### --> -<para> - -</para> - -@data: -@dataId: - - -<!-- ##### MACRO xmlSecKeyDataCheckUsage ##### --> -<para> - -</para> - -@data: -@usg: - - -<!-- ##### MACRO xmlSecKeyDataCheckSize ##### --> -<para> - -</para> - -@data: -@size: - - -<!-- ##### MACRO xmlSecKeyDataIdUnknown ##### --> -<para> - -</para> - - - -<!-- ##### USER_FUNCTION xmlSecKeyDataInitMethod ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataDuplicateMethod ##### --> -<para> - -</para> - -@dst: -@src: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataFinalizeMethod ##### --> -<para> - -</para> - -@data: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataXmlReadMethod ##### --> -<para> - -</para> - -@id: -@key: -@node: -@keyInfoCtx: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataXmlWriteMethod ##### --> -<para> - -</para> - -@id: -@key: -@node: -@keyInfoCtx: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataBinReadMethod ##### --> -<para> - -</para> - -@id: -@key: -@buf: -@bufSize: -@keyInfoCtx: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataBinWriteMethod ##### --> -<para> - -</para> - -@id: -@key: -@buf: -@bufSize: -@keyInfoCtx: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataGenerateMethod ##### --> -<para> - -</para> - -@data: -@sizeBits: -@type: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataGetTypeMethod ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataGetSizeMethod ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataGetIdentifierMethod ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### USER_FUNCTION xmlSecKeyDataDebugDumpMethod ##### --> -<para> - -</para> - -@data: -@output: - - -<!-- ##### STRUCT xmlSecKeyDataKlass ##### --> -<para> - -</para> - -@klassSize: -@objSize: -@name: -@usage: -@href: -@dataNodeName: -@dataNodeNs: -@initialize: -@duplicate: -@finalize: -@generate: -@getType: -@getSize: -@getIdentifier: -@xmlRead: -@xmlWrite: -@binRead: -@binWrite: -@debugDump: -@debugXmlDump: -@reserved0: -@reserved1: - -<!-- ##### MACRO xmlSecKeyDataKlassGetName ##### --> -<para> - -</para> - -@klass: - - -<!-- ##### MACRO xmlSecKeyDataListId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataListGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### MACRO xmlSecKeyDataIdListId ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataIdListGetKlass ##### --> -<para> - -</para> - -@void: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdListFind ##### --> -<para> - -</para> - -@list: -@dataId: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdListFindByNode ##### --> -<para> - -</para> - -@list: -@nodeName: -@nodeNs: -@usage: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdListFindByHref ##### --> -<para> - -</para> - -@list: -@href: -@usage: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdListFindByName ##### --> -<para> - -</para> - -@list: -@name: -@usage: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataIdListDebugDump ##### --> -<para> - -</para> - -@list: -@output: - - -<!-- ##### FUNCTION xmlSecKeyDataIdListDebugXmlDump ##### --> -<para> - -</para> - -@list: -@output: - - -<!-- ##### MACRO xmlSecKeyDataBinarySize ##### --> -<para> - -</para> - - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueInitialize ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueDuplicate ##### --> -<para> - -</para> - -@dst: -@src: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueFinalize ##### --> -<para> - -</para> - -@data: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueXmlRead ##### --> -<para> - -</para> - -@id: -@key: -@node: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueXmlWrite ##### --> -<para> - -</para> - -@id: -@key: -@node: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueBinRead ##### --> -<para> - -</para> - -@id: -@key: -@buf: -@bufSize: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueBinWrite ##### --> -<para> - -</para> - -@id: -@key: -@buf: -@bufSize: -@keyInfoCtx: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueDebugDump ##### --> -<para> - -</para> - -@data: -@output: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueDebugXmlDump ##### --> -<para> - -</para> - -@data: -@output: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueGetSize ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueGetBuffer ##### --> -<para> - -</para> - -@data: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataBinaryValueSetBuffer ##### --> -<para> - -</para> - -@data: -@buf: -@bufSize: -@Returns: - - -<!-- ##### STRUCT xmlSecKeyDataStore ##### --> -<para> - -</para> - -@id: -@reserved0: -@reserved1: - -<!-- ##### FUNCTION xmlSecKeyDataStoreCreate ##### --> -<para> - -</para> - -@id: -@Returns: - - -<!-- ##### FUNCTION xmlSecKeyDataStoreDestroy #### |