summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Sanin <aleksey@src.gnome.org>2003-04-11 20:04:26 +0000
committerAleksey Sanin <aleksey@src.gnome.org>2003-04-11 20:04:26 +0000
commitf534c63314aca880c63066de0893f7bbcc3f6943 (patch)
tree5c25005b20f75eecfe013e211274dda08c8f8595
parenta66b61421d3251f7b36472ac5fa0d5ec6050962c (diff)
downloadxmlsec1-f534c63314aca880c63066de0893f7bbcc3f6943.tar.gz
xmlsec1-f534c63314aca880c63066de0893f7bbcc3f6943.tar.bz2
xmlsec1-f534c63314aca880c63066de0893f7bbcc3f6943.zip
added XMLSEC_NO_TMPL_TESTS
-rw-r--r--apps/xmlsec.c24
-rw-r--r--configure.in12
2 files changed, 33 insertions, 3 deletions
diff --git a/apps/xmlsec.c b/apps/xmlsec.c
index 044cd03a..1a905a0f 100644
--- a/apps/xmlsec.c
+++ b/apps/xmlsec.c
@@ -63,7 +63,9 @@ static const char helpCommands2[] =
#ifndef XMLSEC_NO_XMLDSIG
" --sign " "\tsign data and output XML document\n"
" --verify " "\tverify signed document\n"
+#ifndef XMLSEC_NO_TMPL_TEST
" --sign-tmpl " "\tcreate and sign dynamicaly generated signature template\n"
+#endif /* XMLSEC_NO_TMPL_TEST */
#endif /* XMLSEC_NO_XMLDSIG */
#ifndef XMLSEC_NO_XMLENC
" --encrypt " "\tencrypt data and output XML document\n"
@@ -700,7 +702,9 @@ static int xmlSecAppPrepareKeyInfoReadCtx (xmlSecKeyInfoCtxPtr ctx);
#ifndef XMLSEC_NO_XMLDSIG
static int xmlSecAppSignFile (const char* filename);
static int xmlSecAppVerifyFile (const char* filename);
+#ifndef XMLSEC_NO_TMPL_TEST
static int xmlSecAppSignTmpl (void);
+#endif /* XMLSEC_NO_TMPL_TEST */
static int xmlSecAppPrepareDSigCtx (xmlSecDSigCtxPtr dsigCtx);
static void xmlSecAppPrintDSigCtx (xmlSecDSigCtxPtr dsigCtx);
#endif /* XMLSEC_NO_XMLDSIG */
@@ -708,7 +712,9 @@ static void xmlSecAppPrintDSigCtx (xmlSecDSigCtxPtr dsigCtx);
#ifndef XMLSEC_NO_XMLENC
static int xmlSecAppEncryptFile (const char* filename);
static int xmlSecAppDecryptFile (const char* filename);
+#ifndef XMLSEC_NO_TMPL_TEST
static int xmlSecAppEncryptTmpl (void);
+#endif /* XMLSEC_NO_TMPL_TEST */
static int xmlSecAppPrepareEncCtx (xmlSecEncCtxPtr encCtx);
static void xmlSecAppPrintEncCtx (xmlSecEncCtxPtr encCtx);
#endif /* XMLSEC_NO_XMLENC */
@@ -840,12 +846,14 @@ int main(int argc, const char **argv) {
}
}
break;
+#ifndef XMLSEC_NO_TMPL_TEST
case xmlSecAppCommandSignTmpl:
if(xmlSecAppSignTmpl() < 0) {
fprintf(stderr, "Error: failed to create and sign template\n");
goto fail;
}
break;
+#endif /* XMLSEC_NO_TMPL_TEST */
#endif /* XMLSEC_NO_XMLDSIG */
#ifndef XMLSEC_NO_XMLENC
@@ -865,12 +873,14 @@ int main(int argc, const char **argv) {
}
}
break;
+#ifndef XMLSEC_NO_TMPL_TEST
case xmlSecAppCommandEncryptTmpl:
if(xmlSecAppEncryptTmpl() < 0) {
fprintf(stderr, "Error: failed to create and encrypt template\n");
goto fail;
}
break;
+#endif /* XMLSEC_NO_TMPL_TEST */
#endif /* XMLSEC_NO_XMLENC */
default:
fprintf(stderr, "Error: invalid command %d\n", command);
@@ -1067,6 +1077,7 @@ done:
return(res);
}
+#ifndef XMLSEC_NO_TMPL_TEST
static int
xmlSecAppSignTmpl(void) {
xmlDocPtr doc = NULL;
@@ -1182,6 +1193,7 @@ done:
}
return(res);
}
+#endif /* XMLSEC_NO_TMPL_TEST */
static int
xmlSecAppPrepareDSigCtx(xmlSecDSigCtxPtr dsigCtx) {
@@ -1414,6 +1426,7 @@ done:
return(res);
}
+#ifndef XMLSEC_NO_TMPL_TEST
static int
xmlSecAppEncryptTmpl(void) {
const char* data = "Hello, World!";
@@ -1497,6 +1510,7 @@ done:
}
return(res);
}
+#endif /* XMLSEC_NO_TMPL_TEST */
static int
xmlSecAppPrepareEncCtx(xmlSecEncCtxPtr encCtx) {
@@ -2097,6 +2111,7 @@ xmlSecAppParseCommand(const char* cmd, xmlSecAppCmdLineParamTopic* cmdLineTopics
xmlSecAppCmdLineTopicX509Certs;
return(xmlSecAppCommandVerify);
} else
+#ifndef XMLSEC_NO_TMPL_TEST
if((strcmp(cmd, "sign-tmpl") == 0) || (strcmp(cmd, "--sign-tmpl") == 0)) {
(*cmdLineTopics) = xmlSecAppCmdLineTopicGeneral |
xmlSecAppCmdLineTopicDSigCommon |
@@ -2105,6 +2120,7 @@ xmlSecAppParseCommand(const char* cmd, xmlSecAppCmdLineParamTopic* cmdLineTopics
xmlSecAppCmdLineTopicX509Certs;
return(xmlSecAppCommandSignTmpl);
} else
+#endif /* XMLSEC_NO_TMPL_TEST */
#endif /* XMLSEC_NO_XMLDSIG */
@@ -2127,6 +2143,7 @@ xmlSecAppParseCommand(const char* cmd, xmlSecAppCmdLineParamTopic* cmdLineTopics
return(xmlSecAppCommandDecrypt);
} else
+#ifndef XMLSEC_NO_TMPL_TEST
if((strcmp(cmd, "encrypt-tmpl") == 0) || (strcmp(cmd, "--encrypt-tmpl") == 0)) {
(*cmdLineTopics) = xmlSecAppCmdLineTopicGeneral |
xmlSecAppCmdLineTopicEncCommon |
@@ -2135,6 +2152,7 @@ xmlSecAppParseCommand(const char* cmd, xmlSecAppCmdLineParamTopic* cmdLineTopics
xmlSecAppCmdLineTopicX509Certs;
return(xmlSecAppCommandEncryptTmpl);
} else
+#endif /* XMLSEC_NO_TMPL_TEST */
#endif /* XMLSEC_NO_XMLENC */
if(1) {
@@ -2168,15 +2186,15 @@ xmlSecAppPrintHelp(xmlSecAppCommand command, xmlSecAppCmdLineParamTopic topics)
case xmlSecAppCommandVerify:
fprintf(stdout, "%s\n", helpVerify);
break;
- case xmlSecAppCommandSignTmpl:
- fprintf(stdout, "%s\n", helpSignTmpl);
- break;
case xmlSecAppCommandEncrypt:
fprintf(stdout, "%s\n", helpEncrypt);
break;
case xmlSecAppCommandDecrypt:
fprintf(stdout, "%s\n", helpDecrypt);
break;
+ case xmlSecAppCommandSignTmpl:
+ fprintf(stdout, "%s\n", helpSignTmpl);
+ break;
case xmlSecAppCommandEncryptTmpl:
fprintf(stdout, "%s\n", helpEncryptTmpl);
break;
diff --git a/configure.in b/configure.in
index 2bd593ae..a3758576 100644
--- a/configure.in
+++ b/configure.in
@@ -638,6 +638,18 @@ else
fi
dnl ==========================================================================
+dnl See do we need templates tests
+dnl ==========================================================================
+AC_MSG_CHECKING(for templates testing)
+AC_ARG_ENABLE(skm, [ --enable-tmpl-tests enable templates testing in xmlsec utility (yes)])
+if test "$enable_tmpl_tests" = "no" ; then
+ XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_TMPL_TEST=1"
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+fi
+
+dnl ==========================================================================
dnl Profiling
dnl ==========================================================================
AC_MSG_CHECKING(for profiling)