summaryrefslogtreecommitdiff
path: root/extra/yassl
diff options
context:
space:
mode:
authormalff/marcsql@weblab.(none) <>2007-02-28 18:14:56 -0700
committermalff/marcsql@weblab.(none) <>2007-02-28 18:14:56 -0700
commitdc98aa82abeb14a491f05e583bd86110d319a10c (patch)
tree5d5413ca065b58fc27c6a73c2eaf337f527295be /extra/yassl
parent8b07431927ccbdc0e0202396fbdd173933a9bf1d (diff)
parent2baf35b4fab1cd1c185b7b98645eb76ed88d9f73 (diff)
downloadmariadb-git-dc98aa82abeb14a491f05e583bd86110d319a10c.tar.gz
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
Diffstat (limited to 'extra/yassl')
-rw-r--r--extra/yassl/include/lock.hpp2
-rw-r--r--extra/yassl/include/openssl/ssl.h10
-rw-r--r--extra/yassl/include/socket_wrapper.hpp10
-rw-r--r--extra/yassl/include/yassl.hpp2
-rw-r--r--extra/yassl/src/ssl.cpp8
-rw-r--r--extra/yassl/taocrypt/mySTL/algorithm.hpp2
-rw-r--r--extra/yassl/taocrypt/src/integer.cpp2
-rw-r--r--extra/yassl/testsuite/testsuite.cpp4
8 files changed, 23 insertions, 17 deletions
diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp
index 0525943e45d..b961ec3e478 100644
--- a/extra/yassl/include/lock.hpp
+++ b/extra/yassl/include/lock.hpp
@@ -28,7 +28,7 @@ namespace yaSSL {
#ifdef MULTI_THREADED
- #ifdef _WIN32
+ #if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
class Mutex {
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 16110c52f43..14384f632e1 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -33,9 +33,14 @@
#include "opensslv.h" /* for version number */
#include "rsa.h"
-
#define YASSL_VERSION "1.5.8"
+#if defined(_WIN32) || defined(_WIN64)
+ #include <winsock2.h>
+ typedef SOCKET socket_t;
+#else
+ typedef int socket_t;
+#endif
#if defined(__cplusplus)
extern "C" {
@@ -191,10 +196,9 @@ enum { /* ERR Constants */
};
-
SSL_CTX* SSL_CTX_new(SSL_METHOD*);
SSL* SSL_new(SSL_CTX*);
-int SSL_set_fd (SSL*, int);
+int SSL_set_fd (SSL*, socket_t);
int SSL_connect(SSL*);
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp
index 308704c2af0..60c00d5e6c3 100644
--- a/extra/yassl/include/socket_wrapper.hpp
+++ b/extra/yassl/include/socket_wrapper.hpp
@@ -28,9 +28,8 @@
#include <assert.h>
-#ifdef _WIN32
- #include <winsock2.h>
-#else
+#include "openssl/ssl.h" /* for socket_t */
+#if !defined(_WIN32) && !defined(_WIN64)
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -44,10 +43,7 @@ namespace yaSSL {
typedef unsigned int uint;
-#ifdef _WIN32
- typedef SOCKET socket_t;
-#else
- typedef int socket_t;
+#if !defined( _WIN32) && !defined(_WIN64)
const socket_t INVALID_SOCKET = -1;
const int SD_RECEIVE = 0;
const int SD_SEND = 1;
diff --git a/extra/yassl/include/yassl.hpp b/extra/yassl/include/yassl.hpp
index 29e0a5d94ec..b8190c484f7 100644
--- a/extra/yassl/include/yassl.hpp
+++ b/extra/yassl/include/yassl.hpp
@@ -28,7 +28,7 @@
namespace yaSSL {
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_WIN64)
typedef unsigned int SOCKET_T;
#else
typedef int SOCKET_T;
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 70198af79b4..c1d9ac81919 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -39,6 +39,7 @@
#include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack
#include <stdio.h>
+#include <assert.h>
#ifdef _WIN32
#include <windows.h> // FindFirstFile etc..
@@ -58,6 +59,9 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)
return SSL_BAD_FILETYPE;
+ if (file == NULL || !file[0])
+ return SSL_BAD_FILE;
+
FILE* input = fopen(file, "rb");
if (!input)
return SSL_BAD_FILE;
@@ -229,7 +233,7 @@ void SSL_free(SSL* ssl)
}
-int SSL_set_fd(SSL* ssl, int fd)
+int SSL_set_fd(SSL* ssl, socket_t fd)
{
ssl->useSocket().set_fd(fd);
return SSL_SUCCESS;
@@ -950,7 +954,7 @@ void ERR_print_errors_fp(FILE* /*fp*/)
char* ERR_error_string(unsigned long errNumber, char* buffer)
{
- static char* msg = "Please supply a buffer for error string";
+ static char* msg = (char*) "Please supply a buffer for error string";
if (buffer) {
SetErrorString(YasslError(errNumber), buffer);
diff --git a/extra/yassl/taocrypt/mySTL/algorithm.hpp b/extra/yassl/taocrypt/mySTL/algorithm.hpp
index d8bc29a0bb9..f6a29cf4bdb 100644
--- a/extra/yassl/taocrypt/mySTL/algorithm.hpp
+++ b/extra/yassl/taocrypt/mySTL/algorithm.hpp
@@ -27,6 +27,8 @@
namespace mySTL {
+#undef max
+#undef min
template<typename T>
inline const T& max(const T& a, const T&b)
diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp
index 419783403ea..84255aa8544 100644
--- a/extra/yassl/taocrypt/src/integer.cpp
+++ b/extra/yassl/taocrypt/src/integer.cpp
@@ -3390,7 +3390,7 @@ void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a,
CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount);
SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount);
if (n % WORD_BITS != 0)
- r.reg_[wordCount-1] %= (1 << (n % WORD_BITS));
+ r.reg_[wordCount-1] %= ((word) 1 << (n % WORD_BITS));
}
else
{
diff --git a/extra/yassl/testsuite/testsuite.cpp b/extra/yassl/testsuite/testsuite.cpp
index 93b9b3d7026..06e75153341 100644
--- a/extra/yassl/testsuite/testsuite.cpp
+++ b/extra/yassl/testsuite/testsuite.cpp
@@ -86,8 +86,8 @@ int main(int argc, char** argv)
// input output compare
byte input[TaoCrypt::MD5::DIGEST_SIZE];
byte output[TaoCrypt::MD5::DIGEST_SIZE];
- file_test("input", input);
- file_test("output", output);
+ file_test((char*) "input", input);
+ file_test((char*) "output", output);
assert(memcmp(input, output, sizeof(input)) == 0);
printf("\nAll tests passed!\n");