From 5876f4acf203a0a753a8dadfc9495236f748a8cb Mon Sep 17 00:00:00 2001 From: Todd A Ouska Date: Wed, 24 Aug 2011 17:39:23 -0700 Subject: [PATCH] fix sniffer and hc128 builds --- .gitignore | 4 ++++ configure.ac | 25 +++++++++++++------------ ctaocrypt/test/test.c | 13 ++++--------- cyassl/ctaocrypt/ctc_hc128.h | 4 ++-- cyassl/sniffer.h | 2 +- src/sniffer.c | 10 +++++----- sslSniffer/sslSnifferTest/snifftest.c | 2 +- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index ab634e7b8..892fcfe75 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,10 @@ testsuite/testsuite testsuite/*.der testsuite/*.pem testsuite/*.raw +cert.der +cert.pem +othercert.der +othercert.pem diff sslSniffer/sslSnifferTest/tracefile.txt *.gz diff --git a/configure.ac b/configure.ac index 48a87d2de..9d942c201 100644 --- a/configure.ac +++ b/configure.ac @@ -335,18 +335,19 @@ then fi -# HC128 -AC_ARG_ENABLE([hc128], - [ --enable-hc128 Enable HC-128 (default: disabled)], - [case "${enableval}" in - yes) BUILD_HC128=true ;; - no) BUILD_HC128=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-hc128]) ;; - esac],[BUILD_HC128=false]) -AM_CONDITIONAL([BUILD_HC128], [test x$BUILD_HC128 = xtrue]) -AS_IF([test "x$BUILD_HC128" = "xyes"], - [ AC_DEFINE([HAVE_HC128], [1], [Have hc128])], - [ AC_DEFINE([HAVE_HC128], [0], [Have hc128])]) +# HC128 +AC_ARG_ENABLE(hc128, + [ --enable-certgen Enable HC-128 (default: disabled)], + [ ENABLED_HC128=$enableval ], + [ ENABLED_HC128=no ] + ) + +if test "$ENABLED_HC128" = "no" +then + AM_CFLAGS="$AM_CFLAGS -DNO_HC128" +fi + +AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"]) # PSK diff --git a/ctaocrypt/test/test.c b/ctaocrypt/test/test.c index 4177bb0a9..9150cf98e 100644 --- a/ctaocrypt/test/test.c +++ b/ctaocrypt/test/test.c @@ -182,17 +182,12 @@ void ctaocrypt_test(void* args) else printf( "ARC4 test passed!\n"); - if (HAVE_HC128) - { - if ( (ret = hc128_test()) ) +#ifndef NO_HC128 + if ( (ret = hc128_test()) ) err_sys("HC-128 test failed!\n", ret); - else - printf( "HC-128 test passed!\n"); - } else - { - printf( "HC-128 test skipped!\n"); - } + printf( "HC-128 test passed!\n"); +#endif #ifndef NO_RABBIT if ( (ret = rabbit_test()) ) diff --git a/cyassl/ctaocrypt/ctc_hc128.h b/cyassl/ctaocrypt/ctc_hc128.h index ea2e35f95..578d192b7 100644 --- a/cyassl/ctaocrypt/ctc_hc128.h +++ b/cyassl/ctaocrypt/ctc_hc128.h @@ -20,12 +20,12 @@ */ -#if HAVE_HC128 +#ifndef NO_HC128 #ifndef CTAO_CRYPT_HC128_H #define CTAO_CRYPT_HC128_H -#include "ctc_types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/cyassl/sniffer.h b/cyassl/sniffer.h index 1b5820e9a..270bf9d41 100644 --- a/cyassl/sniffer.h +++ b/cyassl/sniffer.h @@ -23,7 +23,7 @@ #ifndef CYASSL_SNIFFER_H #define CYASSL_SNIFFER_H -#include "ctc_settings.h" +#include #ifdef _WIN32 #ifdef SSL_SNIFFER_EXPORTS diff --git a/src/sniffer.c b/src/sniffer.c index c99decf1a..7a5c5c54f 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -38,11 +38,11 @@ #ifdef CYASSL_SNIFFER -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Misc constants */ enum { diff --git a/sslSniffer/sslSnifferTest/snifftest.c b/sslSniffer/sslSnifferTest/snifftest.c index ab5e340e1..b74e5fbaf 100755 --- a/sslSniffer/sslSnifferTest/snifftest.c +++ b/sslSniffer/sslSnifferTest/snifftest.c @@ -51,7 +51,7 @@ int main() #include /* EXIT_SUCCESS */ #include /* signal */ -#include "sniffer.h" +#include #ifndef _WIN32