diff options
Diffstat (limited to 'extra/yassl')
-rw-r--r-- | extra/yassl/src/buffer.cpp | 3 | ||||
-rw-r--r-- | extra/yassl/src/crypto_wrapper.cpp | 7 | ||||
-rw-r--r-- | extra/yassl/src/timer.cpp | 2 | ||||
-rw-r--r-- | extra/yassl/src/yassl_error.cpp | 2 | ||||
-rw-r--r-- | extra/yassl/src/yassl_imp.cpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/benchmark/benchmark.cpp | 22 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/block.hpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/file.hpp | 2 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/aes.cpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/algebra.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/blowfish.cpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/file.cpp | 4 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/misc.cpp | 9 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/twofish.cpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/test/test.cpp | 22 |
15 files changed, 39 insertions, 50 deletions
diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp index 86c1bcf3388..a5028e7bb53 100644 --- a/extra/yassl/src/buffer.cpp +++ b/extra/yassl/src/buffer.cpp @@ -22,6 +22,9 @@ * with SSL types and sockets */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <string.h> // memcpy #include "runtime.hpp" diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp index e6168d4d69c..41b03f037a7 100644 --- a/extra/yassl/src/crypto_wrapper.cpp +++ b/extra/yassl/src/crypto_wrapper.cpp @@ -954,8 +954,11 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info) } } // get blank line - if (fgets(line, sizeof(line), file)) - begin = ftell(file); + if (fgets(line,sizeof(line), file) == 0) + { + /* Impossible case */ + } + begin = ftell(file); } } diff --git a/extra/yassl/src/timer.cpp b/extra/yassl/src/timer.cpp index c1286b0724c..945cc8c8b0b 100644 --- a/extra/yassl/src/timer.cpp +++ b/extra/yassl/src/timer.cpp @@ -24,7 +24,7 @@ #include "timer.hpp" #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 #include <windows.h> #else #include <sys/time.h> diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp index e167075b984..9f042ddbcd5 100644 --- a/extra/yassl/src/yassl_error.cpp +++ b/extra/yassl/src/yassl_error.cpp @@ -60,7 +60,7 @@ void SetErrorString(unsigned long error, char* buffer) using namespace TaoCrypt; const int max = MAX_ERROR_SZ; // shorthand - switch (error) { + switch ((int) error) { // yaSSL proper errors case range_error : diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index d981605d35a..48afc86ae20 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -1298,8 +1298,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl) else ssl.useSecurity().use_connection().sessionID_Set_ = false; - if (ssl.getSecurity().get_resuming()) - { + if (ssl.getSecurity().get_resuming()) { if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(), ID_LEN) == 0) { ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret()); diff --git a/extra/yassl/taocrypt/benchmark/benchmark.cpp b/extra/yassl/taocrypt/benchmark/benchmark.cpp index 55e94275b20..1d38b080d0d 100644 --- a/extra/yassl/taocrypt/benchmark/benchmark.cpp +++ b/extra/yassl/taocrypt/benchmark/benchmark.cpp @@ -1,24 +1,10 @@ -/* - Copyright (C) 2006, 2007 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA. -*/ - // benchmark.cpp // TaoCrypt benchmark +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <string.h> #include <stdio.h> diff --git a/extra/yassl/taocrypt/include/block.hpp b/extra/yassl/taocrypt/include/block.hpp index ad3dcf2db59..9885c44d2c9 100644 --- a/extra/yassl/taocrypt/include/block.hpp +++ b/extra/yassl/taocrypt/include/block.hpp @@ -168,7 +168,8 @@ public: void CleanNew(word32 newSize) { New(newSize); - memset(buffer_, 0, sz_ * sizeof(T)); + if (sz_ > 0) + memset(buffer_, 0, sz_ * sizeof(T)); } void New(word32 newSize) diff --git a/extra/yassl/taocrypt/include/file.hpp b/extra/yassl/taocrypt/include/file.hpp index 0f85b46fdb2..e22040f60f0 100644 --- a/extra/yassl/taocrypt/include/file.hpp +++ b/extra/yassl/taocrypt/include/file.hpp @@ -110,7 +110,7 @@ public: word32 size(bool use_current = false); private: - void put(Source&); + size_t put(Source&); FileSink(const FileSink&); // hide FileSink& operator=(const FileSink&); // hide diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp index 21b21dc4856..a3fbd9b7d74 100644 --- a/extra/yassl/taocrypt/src/aes.cpp +++ b/extra/yassl/taocrypt/src/aes.cpp @@ -51,7 +51,8 @@ void AES::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else if (mode_ == CBC) { + else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp index 20a152d1a9d..6da0040c6d9 100644 --- a/extra/yassl/taocrypt/src/algebra.cpp +++ b/extra/yassl/taocrypt/src/algebra.cpp @@ -18,7 +18,6 @@ /* based on Wei Dai's algebra.cpp from CryptoPP */ #undef NDEBUG -#define DEBUG // GCC 4.0 bug if NDEBUG and Optimize > 1 #include "runtime.hpp" #include "algebra.hpp" diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp index 8ee2f3fe569..445de6d8935 100644 --- a/extra/yassl/taocrypt/src/blowfish.cpp +++ b/extra/yassl/taocrypt/src/blowfish.cpp @@ -53,7 +53,8 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else if (mode_ == CBC) { + else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; diff --git a/extra/yassl/taocrypt/src/file.cpp b/extra/yassl/taocrypt/src/file.cpp index 0498038a04b..88ead8e550e 100644 --- a/extra/yassl/taocrypt/src/file.cpp +++ b/extra/yassl/taocrypt/src/file.cpp @@ -98,9 +98,9 @@ FileSink::~FileSink() // fill source from file sink -void FileSink::put(Source& source) +size_t FileSink::put(Source& source) { - fwrite(source.get_buffer(), 1, source.size(), file_); + return fwrite(source.get_buffer(), 1, source.size(), file_); } diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 6045ea3e42b..b0382d0ba69 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -177,6 +177,15 @@ word Crop(word value, unsigned int size) #ifdef TAOCRYPT_X86ASM_AVAILABLE +#ifdef NOT_USED +#ifndef _MSC_VER + static jmp_buf s_env; + static void SigIllHandler(int) + { + longjmp(s_env, 1); + } +#endif +#endif bool HaveCpuId() { diff --git a/extra/yassl/taocrypt/src/twofish.cpp b/extra/yassl/taocrypt/src/twofish.cpp index 272a0def169..c7f2e27d4f3 100644 --- a/extra/yassl/taocrypt/src/twofish.cpp +++ b/extra/yassl/taocrypt/src/twofish.cpp @@ -54,7 +54,8 @@ void Twofish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else if (mode_ == CBC) { + else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp index f8177b31e2f..09836a2ef56 100644 --- a/extra/yassl/taocrypt/test/test.cpp +++ b/extra/yassl/taocrypt/test/test.cpp @@ -1,24 +1,10 @@ -/* - Copyright (C) 2006, 2007 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA. -*/ - // test.cpp // test taocrypt functionality +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <string.h> #include <stdio.h> |