summaryrefslogtreecommitdiff
path: root/src/xmlsec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlsec.c')
-rw-r--r--src/xmlsec.c170
1 files changed, 85 insertions, 85 deletions
diff --git a/src/xmlsec.c b/src/xmlsec.c
index 2f7e7f69..3baa81a0 100644
--- a/src/xmlsec.c
+++ b/src/xmlsec.c
@@ -1,11 +1,11 @@
-/**
+/**
* XML Security Library (http://www.aleksey.com/xmlsec).
*
* General functions.
*
* This is free software; see Copyright file in the source
* distribution for preciese wording.
- *
+ *
* Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
*/
#include "globals.h"
@@ -36,52 +36,52 @@ int
xmlSecInit(void) {
xmlSecErrorsInit();
xmlSecIOInit();
-
+
#ifndef XMLSEC_NO_CRYPTO_DYNAMIC_LOADING
if(xmlSecCryptoDLInit() < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- "xmlSecCryptoDLInit",
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- XMLSEC_ERRORS_NO_MESSAGE);
- return(-1);
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecCryptoDLInit",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
}
#endif /* XMLSEC_NO_CRYPTO_DYNAMIC_LOADING */
-
+
if(xmlSecKeyDataIdsInit() < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- "xmlSecKeyDataIdsInit",
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- XMLSEC_ERRORS_NO_MESSAGE);
- return(-1);
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecKeyDataIdsInit",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
}
-
+
if(xmlSecTransformIdsInit() < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- "xmlSecTransformIdsInit",
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- XMLSEC_ERRORS_NO_MESSAGE);
- return(-1);
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecTransformIdsInit",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
}
-
-#ifndef XMLSEC_NO_XKMS
+
+#ifndef XMLSEC_NO_XKMS
if(xmlSecXkmsRespondWithIdsInit() < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- "xmlSecXkmsRespondWithIdsInit",
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- XMLSEC_ERRORS_NO_MESSAGE);
- return(-1);
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecXkmsRespondWithIdsInit",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
}
if(xmlSecXkmsServerRequestIdsInit() < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- "xmlSecXkmsServerRequestIdsInit",
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- XMLSEC_ERRORS_NO_MESSAGE);
- return(-1);
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecXkmsServerRequestIdsInit",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
}
#endif /* XMLSEC_NO_XKMS */
@@ -99,9 +99,9 @@ xmlSecInit(void) {
*/
int
xmlSecShutdown(void) {
- int res = 0;
+ int res = 0;
-#ifndef XMLSEC_NO_XKMS
+#ifndef XMLSEC_NO_XKMS
xmlSecXkmsServerRequestIdsShutdown();
xmlSecXkmsRespondWithIdsShutdown();
#endif /* XMLSEC_NO_XKMS */
@@ -111,74 +111,74 @@ xmlSecShutdown(void) {
#ifndef XMLSEC_NO_CRYPTO_DYNAMIC_LOADING
if(xmlSecCryptoDLShutdown() < 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- "xmlSecCryptoDLShutdown",
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- XMLSEC_ERRORS_NO_MESSAGE);
- res = -1;
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecCryptoDLShutdown",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ res = -1;
}
#endif /* XMLSEC_NO_CRYPTO_DYNAMIC_LOADING */
xmlSecIOShutdown();
- xmlSecErrorsShutdown();
+ xmlSecErrorsShutdown();
return(res);
}
-/**
+/**
* xmlSecCheckVersionExt:
- * @major: the major version number.
- * @minor: the minor version number.
- * @subminor: the subminor version number.
- * @mode: the version check mode.
+ * @major: the major version number.
+ * @minor: the minor version number.
+ * @subminor: the subminor version number.
+ * @mode: the version check mode.
*
* Checks if the loaded version of xmlsec library could be used.
*
* Returns: 1 if the loaded xmlsec library version is OK to use
* 0 if it is not or a negative value if an error occurs.
*/
-int
+int
xmlSecCheckVersionExt(int major, int minor, int subminor, xmlSecCheckVersionMode mode) {
/* we always want to have a match for major version number */
if(major != XMLSEC_VERSION_MAJOR) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- NULL,
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- "expected major version=%d;real major version=%d",
- XMLSEC_VERSION_MAJOR, major);
- return(0);
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ NULL,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ "expected major version=%d;real major version=%d",
+ XMLSEC_VERSION_MAJOR, major);
+ return(0);
}
-
+
switch(mode) {
case xmlSecCheckVersionExactMatch:
- if((minor != XMLSEC_VERSION_MINOR) || (subminor != XMLSEC_VERSION_SUBMINOR)) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- NULL,
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- "mode=exact;expected minor version=%d;real minor version=%d;expected subminor version=%d;real subminor version=%d",
- XMLSEC_VERSION_MINOR, minor,
- XMLSEC_VERSION_SUBMINOR, subminor);
- return(0);
- }
- break;
+ if((minor != XMLSEC_VERSION_MINOR) || (subminor != XMLSEC_VERSION_SUBMINOR)) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ NULL,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ "mode=exact;expected minor version=%d;real minor version=%d;expected subminor version=%d;real subminor version=%d",
+ XMLSEC_VERSION_MINOR, minor,
+ XMLSEC_VERSION_SUBMINOR, subminor);
+ return(0);
+ }
+ break;
case xmlSecCheckVersionABICompatible:
- if((minor < XMLSEC_VERSION_MINOR) ||
- ((minor == XMLSEC_VERSION_MINOR) &&
- (subminor < XMLSEC_VERSION_SUBMINOR))) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- NULL,
- XMLSEC_ERRORS_R_XMLSEC_FAILED,
- "mode=abi compatible;expected minor version=%d;real minor version=%d;expected subminor version=%d;real subminor version=%d",
- XMLSEC_VERSION_MINOR, minor,
- XMLSEC_VERSION_SUBMINOR, subminor);
- return(0);
- }
- break;
+ if((minor < XMLSEC_VERSION_MINOR) ||
+ ((minor == XMLSEC_VERSION_MINOR) &&
+ (subminor < XMLSEC_VERSION_SUBMINOR))) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ NULL,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ "mode=abi compatible;expected minor version=%d;real minor version=%d;expected subminor version=%d;real subminor version=%d",
+ XMLSEC_VERSION_MINOR, minor,
+ XMLSEC_VERSION_SUBMINOR, subminor);
+ return(0);
+ }
+ break;
}
-
+
return(1);
}