summaryrefslogtreecommitdiff
path: root/extra/yassl/include
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-03-28 01:04:46 +0200
committerSergei Golubchik <sergii@pisem.net>2012-03-28 01:04:46 +0200
commit20e706689df1eb87c696304797e9d6184c0a75bb (patch)
treeff3eab8fa3e060b34687c6e9819cb559ac67d5c5 /extra/yassl/include
parent3d0775e9af2fcf3fe92b7f19e299ea23068eca1e (diff)
parentbfaebe3f5e4b917c4498e234bad7a9d45d07ca62 (diff)
downloadmariadb-git-20e706689df1eb87c696304797e9d6184c0a75bb.tar.gz
mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test: remove autoincrement to avoid rbr being used for insert ... select mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test: remove autoincrement to avoid rbr being used for insert ... select mysys/my_addr_resolve.c: a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack mysys/stacktrace.c: my_vsnprintf() is ok here, in 5.5
Diffstat (limited to 'extra/yassl/include')
-rw-r--r--extra/yassl/include/buffer.hpp10
-rw-r--r--extra/yassl/include/openssl/ssl.h51
-rw-r--r--extra/yassl/include/socket_wrapper.hpp4
-rw-r--r--extra/yassl/include/yassl_int.hpp62
-rw-r--r--extra/yassl/include/yassl_types.hpp30
5 files changed, 81 insertions, 76 deletions
diff --git a/extra/yassl/include/buffer.hpp b/extra/yassl/include/buffer.hpp
index a51bca9a630..2d7817a7ca2 100644
--- a/extra/yassl/include/buffer.hpp
+++ b/extra/yassl/include/buffer.hpp
@@ -46,12 +46,6 @@ typedef unsigned int uint;
const uint AUTO = 0xFEEDBEEF;
-// Checking Policy should implement a check function that tests whether the
-// index is within the size limit of the array
-struct Check {
- void check(uint i, uint limit);
-};
-
struct NoCheck {
void check(uint, uint);
@@ -66,7 +60,7 @@ struct NoCheck {
* write to the buffer bulk wise and have the correct size
*/
-class input_buffer : public Check {
+class input_buffer : public NoCheck {
uint size_; // number of elements in buffer
uint current_; // current offset position in buffer
byte* buffer_; // storage for buffer
@@ -132,7 +126,7 @@ private:
* Not using vector because need checked []access and the ability to
* write to the buffer bulk wise and retain correct size
*/
-class output_buffer : public Check {
+class output_buffer : public NoCheck {
uint current_; // current offset and elements in buffer
byte* buffer_; // storage for buffer
byte* end_; // end of storage marker
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index ba5fa51f34c..0d99888da88 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
@@ -30,12 +30,12 @@
#include "prefix_ssl.h"
#endif
-#include <stdio.h> /* ERR_print fp */
+#include <stdio.h> /* ERR_print fp */
#include "opensslv.h" /* for version number */
#include "rsa.h"
-#define YASSL_VERSION "1.7.2"
+#define YASSL_VERSION "2.2.0"
#if defined(__cplusplus)
@@ -43,9 +43,9 @@ extern "C" {
#endif
void yaSSL_CleanUp(); /* call once at end of application use to
- free static singleton memory holders,
- not a leak per se, but helpful when
- looking for them */
+ free static singleton memory holders,
+ not a leak per se, but helpful when
+ looking for them */
#if defined(__cplusplus)
} // extern
@@ -70,11 +70,11 @@ extern "C" {
class X509;
class X509_NAME;
#else
- typedef struct SSL SSL;
+ typedef struct SSL SSL;
typedef struct SSL_SESSION SSL_SESSION;
- typedef struct SSL_METHOD SSL_METHOD;
- typedef struct SSL_CTX SSL_CTX;
- typedef struct SSL_CIPHER SSL_CIPHER;
+ typedef struct SSL_METHOD SSL_METHOD;
+ typedef struct SSL_CTX SSL_CTX;
+ typedef struct SSL_CIPHER SSL_CIPHER;
typedef struct RSA RSA;
@@ -107,6 +107,15 @@ RSA* RSA_generate_key(int, unsigned long, void(*)(int, int, void*), void*);
/* X509 stuff, different file? */
+/* because mySQL dereferences to use error and current_cert, even after calling
+ * get functions for local references */
+typedef struct X509_STORE_CTX {
+ int error;
+ int error_depth;
+ X509* current_cert;
+} X509_STORE_CTX;
+
+
typedef struct X509_STORE X509_STORE;
typedef struct X509_LOOKUP X509_LOOKUP;
typedef struct X509_OBJECT { char c; } X509_OBJECT;
@@ -125,16 +134,6 @@ typedef struct BIO BIO;
-/* because mySQL dereferences to use error and current_cert, even after calling
- * get functions for local references */
-typedef struct X509_STORE_CTX {
- int error;
- int error_depth;
- X509* current_cert;
-} X509_STORE_CTX;
-
-
-
X509* X509_STORE_CTX_get_current_cert(X509_STORE_CTX*);
int X509_STORE_CTX_get_error(X509_STORE_CTX*);
int X509_STORE_CTX_get_error_depth(X509_STORE_CTX*);
@@ -205,7 +204,7 @@ SSL* SSL_new(SSL_CTX*);
int SSL_set_fd (SSL*, YASSL_SOCKET_T);
YASSL_SOCKET_T SSL_get_fd(const SSL*);
int SSL_connect(SSL*); /* if you get an error from connect
- see note at top of REAMDE */
+ see note at top of README */
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
int SSL_accept(SSL*);
@@ -351,11 +350,11 @@ enum { /* ssl Constants */
SSL_ERROR_ZERO_RETURN = 84,
SSL_ERROR_SSL = 85,
- SSL_SENT_SHUTDOWN = 90,
- SSL_RECEIVED_SHUTDOWN = 91,
+ SSL_ST_CONNECT = 90,
+ SSL_ST_ACCEPT = 91,
SSL_CB_LOOP = 92,
- SSL_ST_CONNECT = 93,
- SSL_ST_ACCEPT = 94,
+ SSL_SENT_SHUTDOWN = 93,
+ SSL_RECEIVED_SHUTDOWN = 94,
SSL_CB_ALERT = 95,
SSL_CB_READ = 96,
SSL_CB_HANDSHAKE_DONE = 97
@@ -366,7 +365,7 @@ enum { /* ssl Constants */
SSL_METHOD *SSLv3_method(void);
SSL_METHOD *SSLv3_server_method(void);
SSL_METHOD *SSLv3_client_method(void);
-SSL_METHOD *TLSv1_server_method(void);
+SSL_METHOD *TLSv1_server_method(void);
SSL_METHOD *TLSv1_client_method(void);
SSL_METHOD *TLSv1_1_server_method(void);
SSL_METHOD *TLSv1_1_client_method(void);
diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp
index 308704c2af0..2372e64e56c 100644
--- a/extra/yassl/include/socket_wrapper.hpp
+++ b/extra/yassl/include/socket_wrapper.hpp
@@ -26,7 +26,6 @@
#ifndef yaSSL_SOCKET_WRAPPER_HPP
#define yaSSL_SOCKET_WRAPPER_HPP
-#include <assert.h>
#ifdef _WIN32
#include <winsock2.h>
@@ -73,7 +72,8 @@ public:
uint get_ready() const;
socket_t get_fd() const;
- uint send(const byte* buf, unsigned int len, int flags = 0) const;
+ uint send(const byte* buf, unsigned int len, unsigned int& sent,
+ int flags = 0);
uint receive(byte* buf, unsigned int len, int flags = 0);
bool wait();
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index 433649c545b..e5ee00bc21c 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -168,7 +168,7 @@ private:
// openSSL X509 names
class X509_NAME {
- char* name_;
+ char* name_;
size_t sz_;
ASN1_STRING entry_;
public:
@@ -246,11 +246,11 @@ public:
SSL_SESSION(const SSL&, RandomPool&);
~SSL_SESSION();
- const opaque* GetID() const;
- const opaque* GetSecret() const;
- const Cipher* GetSuite() const;
- uint GetBornOn() const;
- uint GetTimeOut() const;
+ const opaque* GetID() const;
+ const opaque* GetSecret() const;
+ const Cipher* GetSuite() const;
+ uint GetBornOn() const;
+ uint GetTimeOut() const;
X509* GetPeerX509() const;
void SetTimeOut(uint);
@@ -417,33 +417,33 @@ class SSL_CTX {
public:
typedef STL::list<x509*> CertList;
private:
- SSL_METHOD* method_;
- x509* certificate_;
- x509* privateKey_;
- CertList caList_;
- Ciphers ciphers_;
- DH_Parms dhParms_;
+ SSL_METHOD* method_;
+ x509* certificate_;
+ x509* privateKey_;
+ CertList caList_;
+ Ciphers ciphers_;
+ DH_Parms dhParms_;
pem_password_cb passwordCb_;
void* userData_;
bool sessionCacheOff_;
bool sessionCacheFlushOff_;
- Stats stats_;
- Mutex mutex_; // for Stats
+ Stats stats_;
+ Mutex mutex_; // for Stats
VerifyCallback verifyCallback_;
public:
explicit SSL_CTX(SSL_METHOD* meth);
~SSL_CTX();
- const x509* getCert() const;
- const x509* getKey() const;
- const SSL_METHOD* getMethod() const;
- const Ciphers& GetCiphers() const;
- const DH_Parms& GetDH_Parms() const;
- const Stats& GetStats() const;
- VerifyCallback getVerifyCallback() const;
+ const x509* getCert() const;
+ const x509* getKey() const;
+ const SSL_METHOD* getMethod() const;
+ const Ciphers& GetCiphers() const;
+ const DH_Parms& GetDH_Parms() const;
+ const Stats& GetStats() const;
+ VerifyCallback getVerifyCallback() const;
pem_password_cb GetPasswordCb() const;
void* GetUserData() const;
- bool GetSessionCacheOff() const;
+ bool GetSessionCacheOff() const;
bool GetSessionCacheFlushOff() const;
void setVerifyPeer();
@@ -532,10 +532,13 @@ class Buffers {
public:
typedef STL::list<input_buffer*> inputList;
typedef STL::list<output_buffer*> outputList;
+ int prevSent; // previous plain text bytes sent when got WANT_WRITE
+ int plainSz; // plain text bytes in buffer to send when got WANT_WRITE
private:
- inputList dataList_; // list of users app data / handshake
- outputList handShakeList_; // buffered handshake msgs
- input_buffer* rawInput_; // buffered raw input yet to process
+ inputList dataList_; // list of users app data / handshake
+ outputList handShakeList_; // buffered handshake msgs
+ input_buffer* rawInput_; // buffered raw input yet to process
+ output_buffer* output_; // WANT_WRITE buffered output
public:
Buffers();
~Buffers();
@@ -546,11 +549,13 @@ public:
inputList& useData();
outputList& useHandShake();
- void SetRawInput(input_buffer*); // takes ownership
- input_buffer* TakeRawInput(); // takes ownership
+ void SetRawInput(input_buffer*); // takes ownership
+ input_buffer* TakeRawInput(); // takes ownership
+ void SetOutput(output_buffer*); // takes ownership
+ output_buffer* TakeOutput(); // takes ownership
private:
Buffers(const Buffers&); // hide copy
- Buffers& operator=(const Buffers&); // and assign
+ Buffers& operator=(const Buffers&); // and assign
};
@@ -652,6 +657,7 @@ public:
void deriveKeys();
void deriveTLSKeys();
void Send(const byte*, uint);
+ void SendWriteBuffered();
uint bufferedData();
uint get_SEQIncrement(bool);
diff --git a/extra/yassl/include/yassl_types.hpp b/extra/yassl/include/yassl_types.hpp
index c73a54a7c15..a9e22833eb1 100644
--- a/extra/yassl/include/yassl_types.hpp
+++ b/extra/yassl/include/yassl_types.hpp
@@ -26,7 +26,6 @@
#define yaSSL_TYPES_HPP
#include <stddef.h>
-#include <assert.h>
#include "type_traits.hpp"
@@ -37,6 +36,13 @@
#endif
+#ifdef _MSC_VER
+ // disable conversion warning
+ // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy
+ #pragma warning(disable:4244 4996)
+#endif
+
+
namespace yaSSL {
#define YASSL_LIB
@@ -63,29 +69,29 @@ namespace yaSSL {
template<typename T>
void ysDelete(T* ptr)
{
- if (ptr) ptr->~T();
- ::operator delete(ptr, yaSSL::ys);
+ if (ptr) ptr->~T();
+ ::operator delete(ptr, yaSSL::ys);
}
template<typename T>
void ysArrayDelete(T* ptr)
{
- // can't do array placement destruction since not tracking size in
- // allocation, only allow builtins to use array placement since they
- // don't need destructors called
- typedef char builtin[TaoCrypt::IsFundamentalType<T>::Yes ? 1 : -1];
- (void)sizeof(builtin);
+ // can't do array placement destruction since not tracking size in
+ // allocation, only allow builtins to use array placement since they
+ // don't need destructors called
+ typedef char builtin[TaoCrypt::IsFundamentalType<T>::Yes ? 1 : -1];
+ (void)sizeof(builtin);
- ::operator delete[](ptr, yaSSL::ys);
+ ::operator delete[](ptr, yaSSL::ys);
}
#define NEW_YS new (yaSSL::ys)
// to resolve compiler generated operator delete on base classes with
- // virtual destructors (when on stack), make sure doesn't get called
+ // virtual destructors (when on stack)
class virtual_base {
public:
- static void operator delete(void*) { assert(0); }
+ static void operator delete(void*) { }
};
@@ -124,7 +130,7 @@ typedef opaque byte;
typedef unsigned int uint;
-
+
#ifdef USE_SYS_STL
// use system STL
#define STL_VECTOR_FILE <vector>