Brian Aker commits plus some minor changes like AM_CFLAGS getting AC_SUBST and --enable-xxx #ifdef to new header layout

This commit is contained in:
Todd A Ouska 2011-08-24 15:54:58 -07:00
parent e11fd002ce
commit 5d49bf7cb0
146 changed files with 1200 additions and 854 deletions

12
.gitignore vendored
View File

@ -8,8 +8,7 @@
*.user
config*
*Debug/
ctc_config*
stamp*
stamp-h
libtool.m4
aclocal.m4
lt*.m4
@ -21,7 +20,7 @@ missing
libtool
tags
ctaocrypt/benchmark/benchmark
ctaocrypt/test
ctaocrypt/test/testctaocrypt
examples/client/client
examples/echoclient/echoclient
examples/echoserver/echoserver
@ -43,3 +42,10 @@ NTRU_algorithm/
build-test/
build/
cyassl.xcodeproj/
cyassl*rc*
autoscan.log
TAGS
support/libcyassl.pc
cyassl/version.h
cyassl/ctaocrypt/stamp-h1
stamp-h1

View File

@ -1,13 +1,51 @@
EXTRA_DIST = certs/*.pem certs/*.der certs/*.txt certs/*.raw \
lib/dummy *.sln *.vcproj cyassl-iphone.xcodeproj/project.pbxproj \
doc/*.txt swig/README swig/*.i swig/cyassl_adds.c swig/*.sh swig/runme.* \
swig/python_cyassl.vcproj swig/rsasign.py
# includes append to these:
SUFFIXES =
TESTS =
CLEANFILES =
DISTCLEANFILES =
bin_PROGRAMS =
noinst_HEADERS =
lib_LTLIBRARIES =
man_MANS =
noinst_LTLIBRARIES =
noinst_PROGRAMS =
include_HEADERS =
nobase_include_HEADERS =
check_PROGRAMS =
EXTRA_HEADERS =
BUILT_SOURCES=
EXTRA_DIST=
doc_DATA=
ACLOCAL_AMFLAGS = -I m4
exampledir = $(docdir)/@PACKAGE@/example
example_DATA=
EXTRA_DIST+= $(example_DATA)
certsdir = $(sysconfdir)/ssl/certs
certs_DATA=
EXTRA_DIST+= $(certs_DATA)
EXTRA_DIST+= $(doc_DATA)
ACLOCAL_AMFLAGS= -I m4 --install
EXTRA_DIST+= lib/dummy
EXTRA_DIST+= cyassl-ntru.vcproj
EXTRA_DIST+= cyassl.vcproj
EXTRA_DIST+= cyassl-iphone.xcodeproj/project.pbxproj
EXTRA_DIST+= cyassl-ntru.sln
EXTRA_DIST+= cyassl.sln
include cyassl/include.am
include certs/include.am
include doc/include.am
include swig/include.am
include src/include.am
include ctaocrypt/test/include.am
include ctaocrypt/benchmark/include.am
include ctaocrypt/src/include.am
include ctaocrypt/test/include.am
include examples/client/include.am
include examples/server/include.am
include examples/echoclient/include.am
@ -15,44 +53,19 @@ include examples/echoserver/include.am
include testsuite/include.am
include sslSniffer/sslSnifferTest/include.am
TESTS += $(check_PROGRAMS)
test: check
# !!!! first line of rule has to start with a hard (real) tab, not spaces
basic:
$(MAKE) src/libcyassl.la; \
$(MAKE) testsuite/testsuite; \
cd testsuite; \
./testsuite; \
cd ../;
egs:
$(MAKE) examples/client/client; \
$(MAKE) examples/echoclient/echoclient;\
$(MAKE) examples/server/server; \
$(MAKE) examples/echoserver/echoserver;
ctc:
$(MAKE) ctaocrypt/test/test; \
$(MAKE) ctaocrypt/benchmark/benchmark;
openssl-links:
cd lib; ln -s ../src/.libs/libcyassl.a libcrypto.a; \
ln -s ../src/.libs/libcyassl.a libssl.a; \
ln -s ../src/.libs/libcyassl.a libcyassl.a; cd ../
# !!! test -e with a .name like .libs then a * like *dylib fails so just
# look for the .dylib on OS X, and .so otherwise but copy all parts
install:
$(mkinstalldirs) $(DESTDIR)$(includedir)/openssl $(DESTDIR)$(libdir); \
cp -fpR include/openssl/* $(DESTDIR)$(includedir)/openssl; \
cp -fpR ctaocrypt/include/*.h $(DESTDIR)$(includedir); \
rm $(DESTDIR)$(includedir)/ctc_asn.h; \
rm $(DESTDIR)$(includedir)/ctc_coding.h; \
rm $(DESTDIR)$(includedir)/ctc_error.h; \
rm $(DESTDIR)$(includedir)/ctc_misc.h; \
cp -fpR src/libcyassl.la $(DESTDIR)$(libdir); \
if test -e src/.libs/libcyassl.a; then \
cp -fp src/.libs/libcyassl.a $(DESTDIR)$(libdir); fi; \
if test -e src/.libs/libcyassl.so; then \
cp -fpR src/.libs/libcyassl.so* $(DESTDIR)$(libdir); fi; \
if test -e src/.libs/libcyassl.dylib; then \
cp -fpR src/.libs/libcyassl.*dylib $(DESTDIR)$(libdir); fi;
merge-clean:
@find ./ | $(GREP) \.gcda | xargs rm -f
@find ./ | $(GREP) \.gcno | xargs rm -f
@find ./ | $(GREP) \.gz | xargs rm -f
@find ./ | $(GREP) \.orig | xargs rm -f
@find ./ | $(GREP) \.rej | xargs rm -f
@find ./ | $(GREP) \.rpm | xargs rm -f
@find ./ | $(GREP) \.THIS | xargs rm -f
@find ./ | $(GREP) \.OTHER | xargs rm -f
@find ./ | $(GREP) \.BASE | xargs rm -f
@find ./ | $(GREP) \~$$ | xargs rm -f

16
README
View File

@ -1,5 +1,21 @@
*** Note, Please read ***
Note 1)
CyaSSL now needs all examples and tests to be run from the CyaSSL home
directory. This is because it finds certs and keys from ./certs/. Trying to
maintain the ability to run each program from its own directory, the testsuite
directory, the main directory (for make check/test), and for the various
different project layouts (with or without config) was becoming harder and
harder. Now to run testsuite just do:
./testsuite/testsuite
or
make test (when using autoconf)
Note 2)
CyaSSL takes a different approach to certificate verification than OpenSSL does.
The default policy for the client is to verify the server, this means that if
you don't load CAs to verify the server you'll get a connect error, unable to

View File

@ -3,10 +3,4 @@
# Create configure and makefile stuff...
#
set -e
autoreconf -ivf
aclocal -I m4
autoheader
autoconf
automake --add-missing --copy
autoreconf -ivf -Wall

38
certs/include.am Normal file
View File

@ -0,0 +1,38 @@
# vim:ft=automake
# All paths should be given relative to the root
#
certs_DATA+= \
certs/ca-cert.pem \
certs/ca-key.pem \
certs/client-cert.pem \
certs/client-keyEnc.pem \
certs/client-key.pem \
certs/dsa512.pem \
certs/dsa-cert.pem \
certs/ecc-key.pem \
certs/ntru-cert.pem \
certs/server-cert.pem \
certs/server-ecc.pem \
certs/server-keyEnc.pem \
certs/server-key.pem \
certs/server-keyPkcs8Enc12.pem \
certs/server-keyPkcs8Enc2.pem \
certs/server-keyPkcs8Enc.pem \
certs/server-keyPkcs8.pem
certs_DATA+= \
certs/ca-key.der \
certs/client-cert.der \
certs/client-key.der \
certs/dh1024.der \
certs/rsa1024.der \
certs/dsa512.der \
certs/ecc-key.der
EXTRA_DIST+= ${certs_DATA}
doc_DATA+= certs/taoCert.txt
EXTRA_DIST+= certs/ntru-key.raw

View File

@ -6,13 +6,23 @@
#
#
AC_INIT(cyassl,2.0.0rc2,http://www.yassl.com) # !!! also change in ssl.h !!!
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(ctaocrypt/include/ctc_config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AC_INIT([cyassl],[2.0.0rc2],[http://www.yassl.com])
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability foreign tar-ustar subdir-objects)
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_PREREQ([2.61])
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
AM_INIT_AUTOMAKE(subdir-objects)
#shared library versioning
CYASSL_LIBRARY_VERSION=2:1:0
@ -29,31 +39,48 @@ CYASSL_LIBRARY_VERSION=2:1:0
# +- increment if interfaces have been added, removed or changed
AC_SUBST(CYASSL_LIBRARY_VERSION)
LT_INIT([win32-dll])
LT_LANG([C++])
LT_LANG([C])
gl_VISIBILITY
# make sure configure doesn't add to CFLAGS
CFLAGS="$CFLAGS $C_EXTRA_FLAGS"
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CHECK_FUNCS([gethostbyname])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([inet_ntoa])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([socket])
AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([stddef.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS(errno.h)
AC_CHECK_LIB(network,socket)
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_SIZEOF(long, 4)
AC_C_BIGENDIAN
AC_DISABLE_STATIC
AC_DISABLE_STATIC
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_C_O
AM_PROG_AS
AC_PROG_CXX
AC_PROG_INSTALL
AC_LIBTOOL_WIN32_DLL
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PREFIX_DEFAULT(/usr/local/cyassl)
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_LIB(network,socket)
AC_CHECK_LIBM
AC_CHECK_HEADERS(errno.h)
LT_INIT
AC_TYPE_SIZE_T
AC_TYPE_UINT8_T
AM_PROG_AS
AM_PROG_CC_C_O
LT_LIB_M
OPTIMIZE_CFLAGS="-Os -fomit-frame-pointer"
OPTIMIZE_FAST_CFLAGS="-O3 -fomit-frame-pointer"
@ -70,10 +97,10 @@ AC_ARG_ENABLE(debug,
if test "$ENABLED_DEBUG" = "yes"
then
# Full debug. Very slow in some cases
CFLAGS="$DEBUG_CFLAGS $CFLAGS"
AM_CFLAGS="$DEBUG_CFLAGS $AM_CFLAGS"
else
# Optimized version. No debug
CFLAGS="$CFLAGS -DNDEBUG"
AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
fi
@ -89,7 +116,7 @@ then
# if you only want server or client you can define NO_CYASSL_SERVER or
# NO_CYASSL_CLIENT but then some of the examples and testsuite won't build
# note that TLS needs HMAC
CFLAGS="-DNO_TLS -DNO_HMAC -DNO_AES -DNO_DES3 -DNO_SHA256 -DNO_ERROR_STRINGS -DNO_HC128 -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED $CFLAGS"
AM_CFLAGS="-DNO_TLS -DNO_HMAC -DNO_AES -DNO_DES3 -DNO_SHA256 -DNO_ERROR_STRINGS -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED $AM_CFLAGS"
fi
@ -101,7 +128,7 @@ AC_ARG_ENABLE(singleThreaded,
)
if test "$ENABLED_SINGLETHREADED" = "yes"
then
CFLAGS="-DSINGLE_THREADED $CFLAGS"
AM_CFLAGS="-DSINGLE_THREADED $AM_CFLAGS"
fi
@ -113,7 +140,7 @@ AC_ARG_ENABLE(dtls,
)
if test "$ENABLED_DTLS" = "yes"
then
CFLAGS="-DCYASSL_DTLS $CFLAGS"
AM_CFLAGS="-DCYASSL_DTLS $AM_CFLAGS"
fi
@ -125,7 +152,7 @@ AC_ARG_ENABLE(opensslExtra,
)
if test "$ENABLED_OPENSSLEXTRA" = "yes"
then
CFLAGS="-DOPENSSL_EXTRA $CFLAGS"
AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
fi
if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_SMALL" = "yes"
@ -143,7 +170,7 @@ AC_ARG_ENABLE(ipv6,
if test "$ENABLED_IPV6" = "yes"
then
CFLAGS="$CFLAGS -DTEST_IPV6"
AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6"
fi
@ -154,9 +181,9 @@ AC_ARG_ENABLE(fastmath,
[ ENABLED_FASTMATH=no ]
)
if test "$ENABLED_FASTMATH" = "yes"
if test "x$ENABLED_FASTMATH" = "xyes"
then
CFLAGS="$CFLAGS -DUSE_FAST_MATH"
AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
fi
@ -170,7 +197,7 @@ AC_ARG_ENABLE(fasthugemath,
if test "$ENABLED_FASTHUGEMATH" = "yes"
then
ENABLED_FASTMATH="yes"
CFLAGS="$CFLAGS -DUSE_FAST_MATH"
AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
fi
AM_CONDITIONAL([BUILD_FASTMATH], [test "x$ENABLED_FASTMATH" = "xyes"])
@ -185,7 +212,7 @@ AC_ARG_ENABLE(bigcache,
if test "$ENABLED_BIGCACHE" = "yes"
then
CFLAGS="$CFLAGS -DBIG_SESSION_CACHE"
AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
fi
@ -198,7 +225,7 @@ AC_ARG_ENABLE(hugecache,
if test "$ENABLED_HUGECACHE" = "yes"
then
CFLAGS="$CFLAGS -DHUGE_SESSION_CACHE"
AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
fi
@ -211,7 +238,7 @@ AC_ARG_ENABLE(sniffer,
if test "$ENABLED_SNIFFER" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
fi
AM_CONDITIONAL([BUILD_SNIFFER], [test "x$ENABLED_SNIFFER" = "xyes"])
@ -225,11 +252,11 @@ AC_ARG_ENABLE(aesni,
if test "$ENABLED_AESNI" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_AESNI"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_AESNI"
if test "$GCC" = "yes"
then
# GCC needs these flags, icc doesn't
CFLAGS="$CFLAGS -maes -msse4"
AM_CFLAGS="$AM_CFLAGS -maes -msse4"
fi
fi
@ -245,7 +272,7 @@ AC_ARG_ENABLE(ripemd,
if test "$ENABLED_RIPEMD" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_RIPEMD"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_RIPEMD"
fi
AM_CONDITIONAL([BUILD_RIPEMD], [test "x$ENABLED_RIPEMD" = "xyes"])
@ -260,7 +287,7 @@ AC_ARG_ENABLE(sha512,
if test "$ENABLED_SHA512" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_SHA512"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_SHA512"
fi
AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
@ -275,7 +302,7 @@ AC_ARG_ENABLE(sessioncerts,
if test "$ENABLED_SESSIONCERTS" = "yes"
then
CFLAGS="$CFLAGS -DSESSION_CERTS"
AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
fi
@ -288,7 +315,7 @@ AC_ARG_ENABLE(keygen,
if test "$ENABLED_KEYGEN" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_KEY_GEN"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN"
fi
@ -301,23 +328,22 @@ AC_ARG_ENABLE(certgen,
if test "$ENABLED_CERTGEN" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_CERT_GEN"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
fi
# HC128
AC_ARG_ENABLE(hc128,
[ --enable-hc128 Enable HC-128 (default: disabled)],
[ ENABLED_HC128=$enableval ],
[ ENABLED_HC128=no ]
)
if test "$ENABLED_HC128" = "no"
then
CFLAGS="$CFLAGS -DNO_HC128"
fi
AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"])
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])])
# PSK
@ -329,7 +355,7 @@ AC_ARG_ENABLE(psk,
if test "$ENABLED_PSK" = "no"
then
CFLAGS="$CFLAGS -DNO_PSK"
AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
fi
@ -342,7 +368,7 @@ AC_ARG_ENABLE(webServer,
if test "$ENABLED_WEBSERVER" = "yes"
then
CFLAGS="$CFLAGS -DHAVE_WEBSERVER"
AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
fi
@ -355,7 +381,7 @@ AC_ARG_ENABLE(noFilesystem,
if test "$ENABLED_NOFILESYSTEM" = "yes"
then
CFLAGS="$CFLAGS -DNO_FILESYSTEM"
AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
fi
@ -383,7 +409,7 @@ AC_ARG_ENABLE(ecc,
if test "$ENABLED_ECC" = "yes"
then
CFLAGS="$CFLAGS -DHAVE_ECC"
AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC"
fi
AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
@ -407,8 +433,8 @@ AC_ARG_ENABLE(ntru,
if test "$ENABLED_NTRU" = "yes"
then
CFLAGS="$CFLAGS -DHAVE_NTRU -I$ntruInclude"
LDFLAGS="$LDFLAGS -L$ntruLib"
AM_CFLAGS="$AM_CFLAGS -DHAVE_NTRU -I$ntruInclude"
AM_LDFLAGS="$AM_LDFLAGS -L$ntruLib"
LIBS="$LIBS -lntru_encrypt"
fi
@ -429,7 +455,7 @@ AC_ARG_ENABLE(testcert,
if test "$ENABLED_TESTCERT" = "yes"
then
CFLAGS="$CFLAGS -DCYASSL_TEST_CERT"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_TEST_CERT"
fi
@ -442,8 +468,7 @@ AC_ARG_WITH(libz,
CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
LIBS="$LIBS -lz"
AC_TRY_LINK([#include <zlib.h>], [ deflateInit(0, 8); ],
[ libz_linked=yes ], [ libz_linked=no ])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
if test "x$libz_linked" == "xno" ; then
if test "x$withval" != "xno" ; then
@ -453,11 +478,10 @@ AC_ARG_WITH(libz,
trylibzdir="/usr"
fi
LDFLAGS="$LDFLAGS -L$trylibzdir/lib"
AM_LDFLAGS="$AM_LDFLAGS -L$trylibzdir/lib"
CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
AC_TRY_LINK([#include <zlib.h>], [ deflateInit(0, 8); ],
[ libz_linked=yes ], [ libz_linked=no ])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
if test "x$libz_linked" == "xno" ; then
AC_MSG_ERROR([libz isn't found.
@ -475,56 +499,55 @@ AC_ARG_WITH(libz,
# OPTIMIZE FLAGS
if test "$GCC" = "yes"
then
CFLAGS="$CFLAGS -Wall -Wno-unused"
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
if test "$ENABLED_DEBUG" = "no"
then
if test "$ENABLED_FASTMATH" = "yes"
then
CFLAGS="$CFLAGS $OPTIMIZE_FAST_CFLAGS"
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
if test "$ENABLED_FASTHUGEMATH" = "yes"
then
CFLAGS="$CFLAGS $OPTIMIZE_HUGE_CFLAGS"
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
fi
else
CFLAGS="$CFLAGS $OPTIMIZE_CFLAGS"
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
fi
fi
fi
ACX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBM $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AX_PTHREAD([
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
],
[
AC_DEFINE([HAVE_PTHREAD], [0], [Define if you have POSIX threads libraries and header files.])
])
LIB_SOCKET_NSL
dnl Various GCC warnings that should never fire for release quality code
GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment \
-Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls \
-Wnested-externs -Wbad-function-cast -Wswitch-enum -Winit-self \
-Wmissing-field-initializers -Wdeclaration-after-statement \
-Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id \
-Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds \
-Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wshadow \
-Wswitch-default"
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment \
-Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls \
-Wnested-externs -Wbad-function-cast -Wswitch-enum -Winit-self \
-Wmissing-field-initializers -Wdeclaration-after-statement \
-Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id \
-Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds \
-Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wshadow \
-Wswitch-default"
AC_ARG_ENABLE(gcc-lots-o-warnings,
AS_HELP_STRING(--enable-gcc-lots-o-warnings, Enable lots of gcc warnings (default: disabled)),
[if test x$enableval = xyes; then
CFLAGS="$CFLAGS $GCCWARNINGS"
AM_CFLAGS="$AM_CFLAGS $GCCWARNINGS"
fi])
AC_ARG_ENABLE(gcc-hardening,
AS_HELP_STRING(--enable-gcc-hardening, Enable compiler security checks (default: disabled)),
[if test x$enableval = xyes; then
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
CFLAGS="$CFLAGS --param ssp-buffer-size=1"
AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
LDFLAGS="$LDFLAGS -pie"
fi])
@ -536,16 +559,16 @@ AS_HELP_STRING(--enable-linker-hardening, Enable linker security fixups (default
LDFLAGS="$LDFLAGS -z relro -z now"
fi])
PANDORA_VISIBILITY
CFLAGS="$CFLAGS $CFLAG_VISIBILITY"
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
CREATE_HEX_VERSION
AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
# FINAL
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([cyassl/version.h])
AC_CONFIG_FILES([support/libcyassl.pc])
AC_OUTPUT

View File

@ -21,24 +21,25 @@
/* CTaoCrypt benchmark */
#include <config.h>
#include <string.h>
#include <stdio.h>
#include "ctc_des3.h"
#include "ctc_arc4.h"
#include "ctc_hc128.h"
#include "ctc_rabbit.h"
#include "ctc_aes.h"
#include "ctc_md5.h"
#include "ctc_sha.h"
#include "ctc_sha256.h"
#include "ctc_sha512.h"
#include "ctc_rsa.h"
#include "ctc_asn.h"
#include "ctc_ripemd.h"
#include <cyassl/ctaocrypt/ctc_des3.h>
#include <cyassl/ctaocrypt/ctc_arc4.h>
#include <cyassl/ctaocrypt/ctc_hc128.h>
#include <cyassl/ctaocrypt/ctc_rabbit.h>
#include <cyassl/ctaocrypt/ctc_aes.h>
#include <cyassl/ctaocrypt/ctc_md5.h>
#include <cyassl/ctaocrypt/ctc_sha.h>
#include <cyassl/ctaocrypt/ctc_sha256.h>
#include <cyassl/ctaocrypt/ctc_sha512.h>
#include <cyassl/ctaocrypt/ctc_rsa.h>
#include <cyassl/ctaocrypt/ctc_asn.h>
#include <cyassl/ctaocrypt/ctc_ripemd.h>
#include "ctc_dh.h"
#include <cyassl/ctaocrypt/ctc_dh.h>
#ifdef _MSC_VER
@ -73,7 +74,7 @@ int main(int argc, char** argv)
bench_aes(1);
#endif
bench_arc4();
#ifndef NO_HC128
#if HAVE_HC128
bench_hc128();
#endif
#ifndef NO_RABBIT
@ -202,7 +203,7 @@ void bench_arc4()
}
#ifndef NO_HC128
#if HAVE_HC128
void bench_hc128()
{
HC128 enc;
@ -221,7 +222,7 @@ void bench_hc128()
printf("HC128 %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
persec);
}
#endif /* NO_HC128 */
#endif /* HAVE_HC128 */
#ifndef NO_RABBIT
@ -381,10 +382,11 @@ void bench_rsa()
double start, total, each, milliEach;
RsaKey key;
FILE* file = fopen("./rsa1024.der", "rb");
FILE* file = fopen("./certs/rsa1024.der", "rb");
if (!file) {
printf("can't find ./rsa1024.der\n");
printf("can't find ./certs/rsa1024.der, "
"Please run from CyaSSL home dir\n");
return;
}
@ -438,10 +440,11 @@ void bench_dh()
double start, total, each, milliEach;
DhKey key;
FILE* file = fopen("./dh1024.der", "rb");
FILE* file = fopen("./certs/dh1024.der", "rb");
if (!file) {
printf("can't find ./dh1024.der\n");
printf("can't find ./certs/dh1024.der, "
"Please run from CyaSSL home dir\n");
return;
}

Binary file not shown.

View File

@ -1,12 +1,9 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
bin_PROGRAMS += ctaocrypt/benchmark/benchmark
noinst_PROGRAMS += ctaocrypt/benchmark/benchmark
ctaocrypt_benchmark_benchmark_SOURCES = ctaocrypt/benchmark/benchmark.c
ctaocrypt_benchmark_benchmark_LDFLAGS = -Lsrc
ctaocrypt_benchmark_benchmark_LDADD = src/libcyassl.la
ctaocrypt_benchmark_benchmark_DEPENDENCIES = src/libcyassl.la
EXTRA_DIST += ctaocrypt/benchmark/*.der \
ctaocrypt/benchmark/benchmark.sln ctaocrypt/benchmark/benchmark.vcproj
EXTRA_DIST += ctaocrypt/benchmark/benchmark.sln
EXTRA_DIST += ctaocrypt/benchmark/benchmark.vcproj

View File

@ -19,14 +19,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_AES
#include "ctc_aes.h"
#include "ctc_error.h"
#include "cyassl_logging.h"
#include <cyassl/ctaocrypt/ctc_aes.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#include <cyassl/ctaocrypt/cyassl_logging.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -19,8 +19,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#include "ctc_arc4.h"
#include <cyassl/ctaocrypt/ctc_arc4.h>
void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)

View File

@ -19,20 +19,22 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifdef THREADX
#include "os.h" /* dc_rtc_api needs */
#include "dc_rtc_api.h" /* to get current time */
#endif
#include "ctc_asn.h"
#include "ctc_coding.h"
#include "ctc_sha.h"
#include "ctc_md5.h"
#include "ctc_error.h"
#include "ctc_pwdbased.h"
#include "ctc_des3.h"
#include "ctc_sha256.h"
#include "cyassl_logging.h"
#include <cyassl/ctaocrypt/ctc_asn.h>
#include <cyassl/ctaocrypt/ctc_coding.h>
#include <cyassl/ctaocrypt/ctc_sha.h>
#include <cyassl/ctaocrypt/ctc_md5.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#include <cyassl/ctaocrypt/ctc_pwdbased.h>
#include <cyassl/ctaocrypt/ctc_des3.h>
#include <cyassl/ctaocrypt/ctc_sha256.h>
#include <cyassl/ctaocrypt/cyassl_logging.h>
#ifdef HAVE_NTRU
#include "crypto_ntru.h"

View File

@ -19,10 +19,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#include "ctc_coding.h"
#include "ctc_error.h"
#include "cyassl_logging.h"
#include <cyassl/ctaocrypt/ctc_coding.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#include <cyassl/ctaocrypt/cyassl_logging.h>
enum {

View File

@ -19,6 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
/*
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,

View File

@ -19,8 +19,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
/* inlining these functions is a huge speed increase and a small size decrease,
because the functions are smaller than function call setup/cleanup, e.g.,

View File

@ -19,16 +19,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
/* submitted by eof */
#include "ctc_settings.h"
#include <cyassl/ctaocrypt/ctc_settings.h>
#ifdef USE_CYASSL_MEMORY
#include "cyassl_memory.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/cyassl_memory.h>
#include <cyassl/ctaocrypt/ctc_error.h>
/* Set these to default values initially. */

View File

@ -19,12 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_DES3
#include "ctc_des3.h"
#include <cyassl/ctaocrypt/ctc_des3.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -19,11 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_DH
#include "ctc_dh.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/ctc_dh.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#ifndef USER_MATH_LIB
#include <math.h>

View File

@ -19,13 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_DSA
#include "ctc_dsa.h"
#include "ctc_sha.h"
#include "ctc_random.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/ctc_dsa.h>
#include <cyassl/ctaocrypt/ctc_sha.h>
#include <cyassl/ctaocrypt/ctc_random.h>
#include <cyassl/ctaocrypt/ctc_error.h>
enum {

View File

@ -19,14 +19,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_HC128
#if HAVE_HC128
#include "ctc_hc128.h"
#include <cyassl/ctaocrypt/ctc_hc128.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_hc128.h>
#else
#include "ctc_misc.c"
#include "ctaocrypt/src/ctc_misc.c"
#endif

View File

@ -19,11 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_HMAC
#include "ctc_hmac.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/ctc_hmac.h>
#include <cyassl/ctaocrypt/ctc_error.h>
static int InitHmac(Hmac* hmac, int type)

39
ctaocrypt/src/include.am Normal file
View File

@ -0,0 +1,39 @@
# vim:ft=automake
# All paths should be given relative to the root
EXTRA_DIST += ctaocrypt/src/ctc_misc.c
EXTRA_DIST += ctaocrypt/src/ctc_asm.c
EXTRA_DIST += \
ctaocrypt/src/ecc_fp.c \
ctaocrypt/src/fp_mont_small.i \
ctaocrypt/src/fp_mul_comba_12.i \
ctaocrypt/src/fp_mul_comba_17.i \
ctaocrypt/src/fp_mul_comba_20.i \
ctaocrypt/src/fp_mul_comba_24.i \
ctaocrypt/src/fp_mul_comba_28.i \
ctaocrypt/src/fp_mul_comba_32.i \
ctaocrypt/src/fp_mul_comba_3.i \
ctaocrypt/src/fp_mul_comba_48.i \
ctaocrypt/src/fp_mul_comba_4.i \
ctaocrypt/src/fp_mul_comba_64.i \
ctaocrypt/src/fp_mul_comba_6.i \
ctaocrypt/src/fp_mul_comba_7.i \
ctaocrypt/src/fp_mul_comba_8.i \
ctaocrypt/src/fp_mul_comba_9.i \
ctaocrypt/src/fp_mul_comba_small_set.i \
ctaocrypt/src/fp_sqr_comba_12.i \
ctaocrypt/src/fp_sqr_comba_17.i \
ctaocrypt/src/fp_sqr_comba_20.i \
ctaocrypt/src/fp_sqr_comba_24.i \
ctaocrypt/src/fp_sqr_comba_28.i \
ctaocrypt/src/fp_sqr_comba_32.i \
ctaocrypt/src/fp_sqr_comba_3.i \
ctaocrypt/src/fp_sqr_comba_48.i \
ctaocrypt/src/fp_sqr_comba_4.i \
ctaocrypt/src/fp_sqr_comba_64.i \
ctaocrypt/src/fp_sqr_comba_6.i \
ctaocrypt/src/fp_sqr_comba_7.i \
ctaocrypt/src/fp_sqr_comba_8.i \
ctaocrypt/src/fp_sqr_comba_9.i \
ctaocrypt/src/fp_sqr_comba_small_set.i

View File

@ -26,11 +26,13 @@
*/
#include "ctc_settings.h" /* in case user set USE_FAST_MATH there */
#include <config.h>
/* in case user set USE_FAST_MATH there */
#include <cyassl/ctaocrypt/ctc_settings.h>
#ifndef USE_FAST_MATH
#include "ctc_integer.h"
#include <cyassl/ctaocrypt/ctc_integer.h>
/* handle up to 6 inits */

View File

@ -19,12 +19,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
/* submitted by eof */
#include "ctc_settings.h"
#include "cyassl_logging.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/ctc_settings.h>
#include <cyassl/ctaocrypt/cyassl_logging.h>
#include <cyassl/ctaocrypt/ctc_error.h>
CYASSL_API int CyaSSL_Debugging_ON(void);

View File

@ -19,12 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_MD4
#include "ctc_md4.h"
#include <cyassl/ctaocrypt/ctc_md4.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -20,9 +20,12 @@
*/
#include "ctc_md5.h"
#include <config.h>
#include <cyassl/ctaocrypt/ctc_md5.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -19,13 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_PWDBASED
#include "ctc_pwdbased.h"
#include "ctc_hmac.h"
#include "ctc_integer.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/ctc_pwdbased.h>
#include <cyassl/ctaocrypt/ctc_hmac.h>
#include <cyassl/ctaocrypt/ctc_integer.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#ifdef CYASSL_SHA512
#include "ctc_sha512.h"
#endif

View File

@ -19,12 +19,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifndef NO_RABBIT
#include "ctc_rabbit.h"
#include <cyassl/ctaocrypt/ctc_rabbit.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -19,14 +19,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
/* on HPUX 11 you may need to install /dev/random see
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I
*/
#include "ctc_random.h"
#include "ctc_error.h"
#include <cyassl/ctaocrypt/ctc_random.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#if defined(USE_WINDOWS_API)

View File

@ -20,11 +20,13 @@
*/
#include <config.h>
#ifdef CYASSL_RIPEMD
#include "ctc_ripemd.h"
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -20,10 +20,12 @@
*/
#include "ctc_rsa.h"
#include "ctc_random.h"
#include "ctc_error.h"
#include "cyassl_logging.h"
#include <config.h>
#include <cyassl/ctaocrypt/ctc_rsa.h>
#include <cyassl/ctaocrypt/ctc_random.h>
#include <cyassl/ctaocrypt/ctc_error.h>
#include <cyassl/ctaocrypt/cyassl_logging.h>
#ifdef SHOW_GEN
#include <stdio.h>

View File

@ -19,10 +19,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#include "ctc_sha.h"
#include <cyassl/ctaocrypt/ctc_sha.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -22,12 +22,13 @@
/* code submitted by raphael.huck@efixo.com */
#include <config.h>
#ifndef NO_SHA256
#include "ctc_sha256.h"
#include <cyassl/ctaocrypt/ctc_sha256.h>
#ifdef NO_INLINE
#include "ctc_misc.h"
#include <cyassl/ctaocrypt/ctc_misc.h>
#else
#include "ctc_misc.c"
#endif

View File

@ -19,6 +19,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#ifdef CYASSL_SHA512

View File

@ -30,12 +30,15 @@
* to fit CyaSSL's needs.
*/
#include "ctc_settings.h" /* in case user set USE_FAST_MATH there */
#include <config.h>
/* in case user set USE_FAST_MATH there */
#include <cyassl/ctaocrypt/ctc_settings.h>
#ifdef USE_FAST_MATH
#include "ctc_tfm.h"
#include "ctc_asm.c" /* will define asm MACROS or C ones */
#include <cyassl/ctaocrypt/ctc_tfm.h>
#include <ctaocrypt/src/ctc_asm.c> /* will define asm MACROS or C ones */

View File

@ -1,11 +1,9 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
bin_PROGRAMS = ctaocrypt/test/test
ctaocrypt_test_test_SOURCES = ctaocrypt/test/test.c
ctaocrypt_test_test_LDFLAGS = -Lsrc
ctaocrypt_test_test_LDADD = src/libcyassl.la
ctaocrypt_test_test_DEPENDENCIES = src/libcyassl.la
EXTRA_DIST += ctaocrypt/test/test.sln ctaocrypt/test/test.vcproj
noinst_PROGRAMS+= ctaocrypt/test/testctaocrypt
ctaocrypt_test_testctaocrypt_SOURCES = ctaocrypt/test/test.c
ctaocrypt_test_testctaocrypt_LDADD = src/libcyassl.la
ctaocrypt_test_testctaocrypt_DEPENDENCIES = src/libcyassl.la
EXTRA_DIST += ctaocrypt/test/test.sln
EXTRA_DIST += ctaocrypt/test/test.vcproj

View File

@ -19,36 +19,37 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <config.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef CYASSL_TEST_CERT
#include "ctc_asn.h"
#include <cyassl/ctaocrypt/ctc_asn.h>
#else
#include "ctc_asn_public.h"
#include <cyassl/ctaocrypt/ctc_asn_public.h>
#endif
#include "ctc_md5.h"
#include "ctc_md4.h"
#include "ctc_sha.h"
#include "ctc_sha256.h"
#include "ctc_sha512.h"
#include "ctc_arc4.h"
#include "ctc_random.h"
#include "ctc_coding.h"
#include "ctc_rsa.h"
#include "ctc_des3.h"
#include "ctc_aes.h"
#include "ctc_hmac.h"
#include "ctc_dh.h"
#include "ctc_dsa.h"
#include "ctc_hc128.h"
#include "ctc_rabbit.h"
#include "ctc_pwdbased.h"
#include "ctc_ripemd.h"
#include <cyassl/ctaocrypt/ctc_md5.h>
#include <cyassl/ctaocrypt/ctc_md4.h>
#include <cyassl/ctaocrypt/ctc_sha.h>
#include <cyassl/ctaocrypt/ctc_sha256.h>
#include <cyassl/ctaocrypt/ctc_sha512.h>
#include <cyassl/ctaocrypt/ctc_arc4.h>
#include <cyassl/ctaocrypt/ctc_random.h>
#include <cyassl/ctaocrypt/ctc_coding.h>
#include <cyassl/ctaocrypt/ctc_rsa.h>
#include <cyassl/ctaocrypt/ctc_des3.h>
#include <cyassl/ctaocrypt/ctc_aes.h>
#include <cyassl/ctaocrypt/ctc_hmac.h>
#include <cyassl/ctaocrypt/ctc_dh.h>
#include <cyassl/ctaocrypt/ctc_dsa.h>
#include <cyassl/ctaocrypt/ctc_hc128.h>
#include <cyassl/ctaocrypt/ctc_rabbit.h>
#include <cyassl/ctaocrypt/ctc_pwdbased.h>
#include <cyassl/ctaocrypt/ctc_ripemd.h>
#ifdef HAVE_ECC
#include "ctc_ecc.h"
#include <cyassl/ctaocrypt/ctc_ecc.h>
#endif
#ifdef _MSC_VER
@ -57,10 +58,10 @@
#endif
#ifdef OPENSSL_EXTRA
#include "evp.h"
#include "rand.h"
#include "hmac.h"
#include "des.h"
#include <cyassl/openssl/evp.h>
#include <cyassl/openssl/rand.h>
#include <cyassl/openssl/hmac.h>
#include <cyassl/openssl/des.h>
#endif
#ifdef HAVE_NTRU
@ -181,12 +182,17 @@ void ctaocrypt_test(void* args)
else
printf( "ARC4 test passed!\n");
#ifndef NO_HC128
if ( (ret = hc128_test()) )
if (HAVE_HC128)
{
if ( (ret = hc128_test()) )
err_sys("HC-128 test failed!\n", ret);
else
else
printf( "HC-128 test passed!\n");
#endif
}
else
{
printf( "HC-128 test skipped!\n");
}
#ifndef NO_RABBIT
if ( (ret = rabbit_test()) )
@ -744,9 +750,9 @@ int arc4_test()
}
#ifndef NO_HC128
int hc128_test()
{
#if defined(HAVE_HC128) && HAVE_HC128
byte cipher[16];
byte plain[16];
@ -815,9 +821,9 @@ int hc128_test()
return -120 - 5 - i;
}
#endif /* HAVE_HC128 */
return 0;
}
#endif /* NO_HC128 */
#ifndef NO_RABBIT
@ -1044,20 +1050,11 @@ int random_test()
}
#ifndef NO_MAIN_DRIVER
static const char* clientKey = "../../certs/client-key.der";
static const char* clientCert = "../../certs/client-cert.der";
#ifdef CYASSL_CERT_GEN
static const char* caKeyFile = "../../certs/ca-key.der";
static const char* caCertFile = "../../certs/ca-cert.pem";
#endif
#else
static const char* clientKey = "../certs/client-key.der";
static const char* clientCert = "../certs/client-cert.der";
#ifdef CYASSL_CERT_GEN
static const char* caKeyFile = "../certs/ca-key.der";
static const char* caCertFile = "../certs/ca-cert.pem";
#endif
static const char* clientKey = "./certs/client-key.der";
static const char* clientCert = "./certs/client-cert.der";
#ifdef CYASSL_CERT_GEN
static const char* caKeyFile = "./certs/ca-key.der";
static const char* caCertFile = "./certs/ca-cert.pem";
#endif
@ -1112,7 +1109,8 @@ int rsa_test()
FILE* file = fopen(clientKey, "rb"), * file2;
if (!file)
return -40;
err_sys("can't open ./certs/client-key.der, "
"Please run from CyaSSL home dir", -40);
bytes = fread(tmp, 1, sizeof(tmp), file);
@ -1447,11 +1445,7 @@ int rsa_test()
}
#ifndef NO_MAIN_DRIVER
static const char* dhKey = "../../certs/dh1024.der";
#else
static const char* dhKey = "../certs/dh1024.der";
#endif
static const char* dhKey = "./certs/dh1024.der";
#ifndef NO_DH
@ -1515,11 +1509,7 @@ int dh_test()
#endif /* NO_DH */
#ifndef NO_MAIN_DRIVER
static const char* dsaKey = "../../certs/dsa512.der";
#else
static const char* dsaKey = "../certs/dsa512.der";
#endif
static const char* dsaKey = "./certs/dsa512.der";
#ifndef NO_DSA

View File

@ -20,7 +20,7 @@
*/
#ifndef NO_HC128
#if HAVE_HC128
#ifndef CTAO_CRYPT_HC128_H
#define CTAO_CRYPT_HC128_H
@ -53,4 +53,4 @@ CYASSL_API void Hc128_SetKey(HC128*, const byte* key, const byte* iv);
#endif /* CTAO_CRYPT_HC128_H */
#endif /* NO_HC128 */
#endif /* HAVE_HC128 */

View File

@ -51,11 +51,7 @@
/* Uncomment next line if building CyaSSL for a game console */
/* #define CYASSL_GAME_BUILD */
#if defined(USE_CYASSL_CONFIG) || defined(HAVE_CONFIG_H)
#include "ctc_config.h" /* may not want global HAVE_CONFIG_H */
#endif
#include "ctc_visibility.h"
#include <cyassl/ctaocrypt/ctc_visibility.h>
#ifdef IPHONE
#define SIZEOF_LONG_LONG 8

View File

@ -20,10 +20,11 @@
*/
#pragma once
#ifndef CTAO_CRYPT_SHA_H
#define CTAO_CRYPT_SHA_H
#include "ctc_types.h"
#include <cyassl/ctaocrypt/ctc_types.h>
#ifdef __cplusplus
extern "C" {

View File

@ -23,11 +23,7 @@
#ifndef CTAO_CRYPT_TYPES_H
#define CTAO_CRYPT_TYPES_H
#include "ctc_settings.h"
#ifdef HAVE_CONFIG_H
#include "ctc_config.h"
#endif
#include <cyassl/ctaocrypt/ctc_settings.h>
#ifdef __cplusplus
extern "C" {

View File

@ -0,0 +1,36 @@
# vim:ft=automake
# All paths should be given relative to the root
nobase_include_HEADERS+= \
cyassl/ctaocrypt/ctc_aes.h \
cyassl/ctaocrypt/ctc_arc4.h \
cyassl/ctaocrypt/ctc_asn.h \
cyassl/ctaocrypt/ctc_asn_public.h \
cyassl/ctaocrypt/ctc_coding.h \
cyassl/ctaocrypt/ctc_des3.h \
cyassl/ctaocrypt/ctc_dh.h \
cyassl/ctaocrypt/ctc_dsa.h \
cyassl/ctaocrypt/ctc_ecc.h \
cyassl/ctaocrypt/ctc_error.h \
cyassl/ctaocrypt/ctc_hc128.h \
cyassl/ctaocrypt/ctc_hmac.h \
cyassl/ctaocrypt/ctc_integer.h \
cyassl/ctaocrypt/ctc_md4.h \
cyassl/ctaocrypt/ctc_md5.h \
cyassl/ctaocrypt/ctc_misc.h \
cyassl/ctaocrypt/ctc_pwdbased.h \
cyassl/ctaocrypt/ctc_rabbit.h \
cyassl/ctaocrypt/ctc_random.h \
cyassl/ctaocrypt/ctc_ripemd.h \
cyassl/ctaocrypt/ctc_rsa.h \
cyassl/ctaocrypt/ctc_settings.h \
cyassl/ctaocrypt/ctc_sha256.h \
cyassl/ctaocrypt/ctc_sha512.h \
cyassl/ctaocrypt/ctc_sha.h \
cyassl/ctaocrypt/ctc_tfm.h \
cyassl/ctaocrypt/ctc_types.h \
cyassl/ctaocrypt/ctc_visibility.h \
cyassl/ctaocrypt/cyassl_logging.h \
cyassl/ctaocrypt/cyassl_memory.h \
cyassl/ctaocrypt/mpi_class.h \
cyassl/ctaocrypt/mpi_superclass.h

View File

@ -23,7 +23,7 @@
#ifndef CYASSL_ERROR_H
#define CYASSL_ERROR_H
#include "ctc_error.h" /* CTaoCrypt errors */
#include <cyassl/ctaocrypt/ctc_error.h> /* CTaoCrypt errors */
#ifdef __cplusplus
extern "C" {

View File

@ -24,20 +24,20 @@
#define CYASSL_INT_H
#include "ctc_types.h"
#include "ctc_random.h"
#include "ctc_des3.h"
#include "ctc_hc128.h"
#include "ctc_rabbit.h"
#include "ctc_asn.h"
#include "ctc_md5.h"
#include "ctc_aes.h"
#include "cyassl_logging.h"
#include <cyassl/ctaocrypt/ctc_types.h>
#include <cyassl/ctaocrypt/ctc_random.h>
#include <cyassl/ctaocrypt/ctc_des3.h>
#include <cyassl/ctaocrypt/ctc_hc128.h>
#include <cyassl/ctaocrypt/ctc_rabbit.h>
#include <cyassl/ctaocrypt/ctc_asn.h>
#include <cyassl/ctaocrypt/ctc_md5.h>
#include <cyassl/ctaocrypt/ctc_aes.h>
#include <cyassl/ctaocrypt/cyassl_logging.h>
#ifdef HAVE_ECC
#include "ctc_ecc.h"
#include <cyassl/ctaocrypt/ctc_ecc.h>
#endif
#ifndef NO_SHA256
#include "ctc_sha256.h"
#include <cyassl/ctaocrypt/ctc_sha256.h>
#endif
#ifdef CYASSL_CALLBACKS
@ -784,7 +784,7 @@ typedef union {
#ifdef BUILD_AES
Aes aes;
#endif
#ifdef BUILD_HC128
#if HAVE_HC128
HC128 hc128;
#endif
#ifdef BUILD_RABBIT

15
cyassl/include.am Normal file
View File

@ -0,0 +1,15 @@
# vim:ft=automake
# All paths should be given relative to the root
#
include cyassl/ctaocrypt/include.am
include cyassl/openssl/include.am
EXTRA_DIST+= cyassl/sniffer_error.rc
nobase_include_HEADERS+= \
cyassl/cyassl_error.h \
cyassl/cyassl_int.h \
cyassl/sniffer_error.h \
cyassl/sniffer.h \
cyassl/version.h

View File

@ -7,7 +7,7 @@
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include "ctc_types.h"
#include <cyassl/ctaocrypt/ctc_types.h>
#ifdef USE_WINDOWS_API
#include <winsock2.h>
@ -73,14 +73,16 @@
typedef void* THREAD_TYPE;
#define CYASSL_THREAD
#else
#ifndef _POSIX_THREADS
typedef unsigned int THREAD_RETURN;
typedef HANDLE THREAD_TYPE;
#define CYASSL_THREAD __stdcall
#else
#ifdef _POSIX_THREADS
typedef void* THREAD_RETURN;
typedef pthread_t THREAD_TYPE;
#define CYASSL_THREAD
#define INFINITE -1
#define WAIT_OBJECT_0 0L
#else
typedef unsigned int THREAD_RETURN;
typedef HANDLE THREAD_TYPE;
#define CYASSL_THREAD __stdcall
#endif
#endif
@ -94,27 +96,16 @@
#endif
#ifndef NO_MAIN_DRIVER
const char* caCert = "../../certs/ca-cert.pem";
const char* eccCert = "../../certs/server-ecc.pem";
const char* eccKey = "../../certs/ecc-key.pem";
const char* svrCert = "../../certs/server-cert.pem";
const char* svrKey = "../../certs/server-key.pem";
const char* cliCert = "../../certs/client-cert.pem";
const char* cliKey = "../../certs/client-key.pem";
const char* ntruCert = "../../certs/ntru-cert.pem";
const char* ntruKey = "../../certs/ntru-key.raw";
#else
static const char* caCert = "../certs/ca-cert.pem";
static const char* eccCert = "../certs/server-ecc.pem";
static const char* eccKey = "../certs/ecc-key.pem";
static const char* svrCert = "../certs/server-cert.pem";
static const char* svrKey = "../certs/server-key.pem";
static const char* cliCert = "../certs/client-cert.pem";
static const char* cliKey = "../certs/client-key.pem";
static const char* ntruCert = "../certs/ntru-cert.pem";
static const char* ntruKey = "../certs/ntru-key.raw";
#endif
/* all certs relative to CyaSSL home directory now */
static const char* caCert = "./certs/ca-cert.pem";
static const char* eccCert = "./certs/server-ecc.pem";
static const char* eccKey = "./certs/ecc-key.pem";
static const char* svrCert = "./certs/server-cert.pem";
static const char* svrKey = "./certs/server-key.pem";
static const char* cliCert = "./certs/client-cert.pem";
static const char* cliKey = "./certs/client-key.pem";
static const char* ntruCert = "./certs/ntru-cert.pem";
static const char* ntruKey = "./certs/ntru-key.raw";
typedef struct tcp_ready {
int ready; /* predicate */
@ -520,7 +511,8 @@ static INLINE unsigned int my_psk_server_cb(SSL* ssl, const char* identity,
FILE* file = fopen(fname, "rb");
if (!file)
err_sys("can't open file for buffer load");
err_sys("can't open file for buffer load "
"Please run from CyaSSL home directory if not");
fseek(file, 0, SEEK_END);
sz = ftell(file);
rewind(file);

37
cyassl/openssl/include.am Normal file
View File

@ -0,0 +1,37 @@
# vim:ft=automake
# All paths should be given relative to the root
nobase_include_HEADERS+= \
cyassl/openssl/asn1.h \
cyassl/openssl/bio.h \
cyassl/openssl/bn.h \
cyassl/openssl/conf.h \
cyassl/openssl/crypto.h \
cyassl/openssl/cyassl_callbacks.h \
cyassl/openssl/cyassl_test.h \
cyassl/openssl/des.h \
cyassl/openssl/dh.h \
cyassl/openssl/dsa.h \
cyassl/openssl/ecdsa.h \
cyassl/openssl/ec.h \
cyassl/openssl/engine.h \
cyassl/openssl/err.h \
cyassl/openssl/evp.h \
cyassl/openssl/hmac.h \
cyassl/openssl/lhash.h \
cyassl/openssl/md4.h \
cyassl/openssl/md5.h \
cyassl/openssl/ocsp.h \
cyassl/openssl/opensslconf.h \
cyassl/openssl/opensslv.h \
cyassl/openssl/ossl_typ.h \
cyassl/openssl/pem.h \
cyassl/openssl/pkcs12.h \
cyassl/openssl/rand.h \
cyassl/openssl/rsa.h \
cyassl/openssl/sha.h \
cyassl/openssl/ssl.h \
cyassl/openssl/stack.h \
cyassl/openssl/ui.h \
cyassl/openssl/x509.h \
cyassl/openssl/x509v3.h

Some files were not shown because too many files have changed in this diff Show More