diff --git a/.gitignore b/.gitignore index e793fa029..978653ee0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ *.user config* *Debug/ +*Release/ +*.ncb +*.suo stamp-h libtool.m4 aclocal.m4 @@ -45,6 +48,7 @@ sslSniffer/sslSnifferTest/tracefile.txt *.dummy compile NTRU_algorithm/ +NTRU/ build-test/ build/ cyassl.xcodeproj/ diff --git a/README b/README index b2f2de85e..0dbd2aa18 100644 --- a/README +++ b/README @@ -14,6 +14,11 @@ or make test (when using autoconf) +On *nix or Windows the examples and testsuite will check to see if the current +directory is the source directory and if so, attempt to change to the CyaSSL +home directory. This should work in most setup cases, if not, just follow the +beginning of the note and specify the full path. + Note 2) CyaSSL takes a different approach to certificate verification than OpenSSL does. diff --git a/configure.ac b/configure.ac index 7f61e1189..b19678bc7 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # # -AC_INIT([cyassl],[2.0.0rc2],[http://www.yassl.com]) +AC_INIT([cyassl],[2.0.0rc3],[http://www.yassl.com]) AC_CONFIG_AUX_DIR(config) diff --git a/ctaocrypt/benchmark/benchmark.c b/ctaocrypt/benchmark/benchmark.c index 7fc34ab27..c26018a48 100644 --- a/ctaocrypt/benchmark/benchmark.c +++ b/ctaocrypt/benchmark/benchmark.c @@ -43,7 +43,6 @@ #include - #ifdef _MSC_VER /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */ #pragma warning(disable: 4996) diff --git a/ctaocrypt/src/aes.c b/ctaocrypt/src/aes.c index 2014e5b2d..0756d0ca9 100644 --- a/ctaocrypt/src/aes.c +++ b/ctaocrypt/src/aes.c @@ -35,6 +35,12 @@ #endif +#ifdef _MSC_VER + /* 4127 warning constant while(1) */ + #pragma warning(disable: 4127) +#endif + + static const word32 rcon[] = { 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, diff --git a/ctaocrypt/src/hc128.c b/ctaocrypt/src/hc128.c index 21990a249..ca123d3d1 100644 --- a/ctaocrypt/src/hc128.c +++ b/ctaocrypt/src/hc128.c @@ -321,4 +321,13 @@ void Hc128_Process(HC128* ctx, byte* output, const byte* input, word32 msglen) } -#endif /* NO_HC128 */ +#else /* HAVE_HC128 */ + + +#ifdef _MSC_VER + /* 4206 warning for blank file */ + #pragma warning(disable: 4206) +#endif + + +#endif /* HAVE_HC128 */ diff --git a/ctaocrypt/test/test.c b/ctaocrypt/test/test.c index 252abd296..68c674571 100644 --- a/ctaocrypt/test/test.c +++ b/ctaocrypt/test/test.c @@ -19,7 +19,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/cyassl-ntru.vcproj b/cyassl-ntru.vcproj index 85e00db46..2402504bb 100755 --- a/cyassl-ntru.vcproj +++ b/cyassl-ntru.vcproj @@ -41,7 +41,7 @@ - - - - - - @@ -206,6 +194,14 @@ RelativePath=".\ctaocrypt\src\integer.c" > + + + + @@ -222,6 +218,10 @@ RelativePath=".\ctaocrypt\src\md5.c" > + + @@ -272,106 +272,6 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -202,6 +190,14 @@ RelativePath=".\ctaocrypt\src\integer.c" > + + + + @@ -218,6 +214,10 @@ RelativePath=".\ctaocrypt\src\md5.c" > + + @@ -264,50 +264,6 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > - - - - - - - - - - - - - - - - - - - - - - -#ifdef USE_CYASSL_VERSION - #include -#endif - - -#ifdef YASSL_PREFIX - #include "prefix_ssl.h" -#endif - -#ifdef LIBCYASSL_VERSION_STRING - #define CYASSL_VERSION LIBCYASSL_VERSION_STRING -#endif - -#ifdef _WIN32 - /* wincrypt.h clashes */ - #undef X509_NAME - #undef OCSP_REQUEST - #undef OCSP_RESPONSE -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/cyassl/ssl.h b/cyassl/ssl.h index 251da6128..1d2072083 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -31,7 +31,27 @@ #ifndef NO_FILESYSTEM - #include /* ERR_pr fp */ + #include /* ERR_printf */ +#endif + +#ifdef USE_CYASSL_VERSION + #include +#endif + + +#ifdef YASSL_PREFIX + #include "prefix_ssl.h" +#endif + +#ifdef LIBCYASSL_VERSION_STRING + #define CYASSL_VERSION LIBCYASSL_VERSION_STRING +#endif + +#ifdef _WIN32 + /* wincrypt.h clashes */ + #undef X509_NAME + #undef OCSP_REQUEST + #undef OCSP_RESPONSE #endif @@ -175,10 +195,8 @@ typedef int (*pem_password_cb)(char*, int, int, void*); CYASSL_API void CyaSSL_CTX_set_verify(CYASSL_CTX*, int, VerifyCallback verify_callback); - CYASSL_API int CyaSSL_pending(CYASSL*); - CYASSL_API void CyaSSL_load_error_strings(void); CYASSL_API int CyaSSL_library_init(void); CYASSL_API long CyaSSL_CTX_set_session_cache_mode(CYASSL_CTX*, long); diff --git a/cyassl/test.h b/cyassl/test.h index d3ee6ca9a..3a7d93757 100644 --- a/cyassl/test.h +++ b/cyassl/test.h @@ -594,5 +594,77 @@ static INLINE void SetDH(SSL* ssl) CyaSSL_SetTmpDH(ssl, p, sizeof(p), g, sizeof(g)); } +#ifdef USE_WINDOWS_API + +/* do back x number of directories */ +static INLINE void ChangeDirBack(int x) +{ + char path[MAX_PATH]; + + if (x == 1) + strncpy(path, "..\\", MAX_PATH); + else if (x == 2) + strncpy(path, "..\\..\\", MAX_PATH); + else if (x == 3) + strncpy(path, "..\\..\\..\\", MAX_PATH); + else if (x == 4) + strncpy(path, "..\\..\\..\\..\\", MAX_PATH); + else + strncpy(path, ".\\", MAX_PATH); + + SetCurrentDirectoryA(path); +} + +/* does current dir contain str */ +static INLINE int CurrentDir(const char* str) +{ + char path[MAX_PATH]; + + GetCurrentDirectoryA(sizeof(path), path); + if (strstr(path, str)) + return 1; + + return 0; +} + +#else + +#ifndef MAX_PATH + #define MAX_PATH 256 +#endif + +/* do back x number of directories */ +static INLINE void ChangeDirBack(int x) +{ + char path[MAX_PATH]; + + if (x == 1) + strncpy(path, "../", MAX_PATH); + else if (x == 2) + strncpy(path, "../../", MAX_PATH); + else if (x == 3) + strncpy(path, "../../../", MAX_PATH); + else if (x == 4) + strncpy(path, "../../../../", MAX_PATH); + else + strncpy(path, "./", MAX_PATH); + + chdir(path); +} + +/* does current dir contain str */ +static INLINE int CurrentDir(const char* str) +{ + char path[MAX_PATH]; + + getcwd(path, sizeof(path)); + if (strstr(path, str)) + return 1; + + return 0; +} + +#endif /* USE_WINDOWS_API */ + #endif /* CyaSSL_TEST_H */ diff --git a/examples/client/client-ntru.vcproj b/examples/client/client-ntru.vcproj index 2620fc644..c89100393 100755 --- a/examples/client/client-ntru.vcproj +++ b/examples/client/client-ntru.vcproj @@ -41,7 +41,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/echoclient/echoclient-ntru.vcproj b/examples/echoclient/echoclient-ntru.vcproj index fd99ced70..3fa0caf6b 100755 --- a/examples/echoclient/echoclient-ntru.vcproj +++ b/examples/echoclient/echoclient-ntru.vcproj @@ -1,199 +1,199 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 7f9ef8383..756b08d65 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -165,6 +165,8 @@ void echoclient_test(void* args) args.argv = argv; CyaSSL_Init(); + if (CurrentDir("echoclient")) + ChangeDirBack(2); echoclient_test(&args); CyaSSL_Cleanup(); diff --git a/examples/echoclient/echoclient.vcproj b/examples/echoclient/echoclient.vcproj index bd82c03ea..3a2a085a4 100755 --- a/examples/echoclient/echoclient.vcproj +++ b/examples/echoclient/echoclient.vcproj @@ -1,197 +1,197 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/echoserver/echoserver-ntru.vcproj b/examples/echoserver/echoserver-ntru.vcproj index 939f2ddc7..539b2e789 100755 --- a/examples/echoserver/echoserver-ntru.vcproj +++ b/examples/echoserver/echoserver-ntru.vcproj @@ -1,199 +1,199 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 329dc20dc..494846e00 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -247,6 +247,8 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) #ifdef DEBUG_CYASSL CyaSSL_Debugging_ON(); #endif + if (CurrentDir("echoserver")) + ChangeDirBack(2); echoserver_test(&args); CyaSSL_Cleanup(); diff --git a/examples/echoserver/echoserver.vcproj b/examples/echoserver/echoserver.vcproj index 265c7014c..0fc396f06 100755 --- a/examples/echoserver/echoserver.vcproj +++ b/examples/echoserver/echoserver.vcproj @@ -1,197 +1,197 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/server/server-ntru.vcproj b/examples/server/server-ntru.vcproj index cf338fd25..c6e204b7c 100755 --- a/examples/server/server-ntru.vcproj +++ b/examples/server/server-ntru.vcproj @@ -41,7 +41,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sslSniffer/sslSniffer.vcproj b/sslSniffer/sslSniffer.vcproj index e6e33c626..1a4ca9b1d 100755 --- a/sslSniffer/sslSniffer.vcproj +++ b/sslSniffer/sslSniffer.vcproj @@ -1,206 +1,206 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testsuite/testsuite-ntru.vcproj b/testsuite/testsuite-ntru.vcproj index 3dc5cb925..6ed108a22 100755 --- a/testsuite/testsuite-ntru.vcproj +++ b/testsuite/testsuite-ntru.vcproj @@ -41,7 +41,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +