diff options
author | unknown <monty@mysql.com> | 2006-06-06 14:21:07 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2006-06-06 14:21:07 +0300 |
commit | a68a9cb69356474a958051177cf9fbdeaea1af3a (patch) | |
tree | 10d58a84e96191fe4c020883fcbc2e19b98adbf3 /extra | |
parent | 0b870cc18e552dab5f33174c583b8af01f24ba9d (diff) | |
download | mariadb-git-a68a9cb69356474a958051177cf9fbdeaea1af3a.tar.gz |
Re-apply missing changeset, orignally pushed by elliot
Add define YASSL_PREFIX when compiling yassl
Import patch from yaSSL
- avoid allocating memory for each call to 'EVP_md5' and
'EVP_des_ede3_cbc' which were not released until server was stopped
- Those functions are used from the SQL function 'des_encrypt' and
'des_decrypt'.
Add new define YASSL_PREFIX beforee including ssl.h to activate inclusion of prefix_*.h files
Bug#20022 mysql-test-run can't be run with secure connections turned on for all testcases
- Part 1, fixes rpl- and federated-tests where connection is made to 127.0.0.1
- Include prefix files that renames all public functions in yaSSLs
OpenSSL API to ya<function_name>. They will otherwise conflict
with OpenSSL functions if loaded by an application that uses OpenSSL
as well as libmysqlclient with yaSSL support.
Bug#18235: assertion/crash when windows mysqld is ended with ctrl-c
Two threads both try a shutdown sequence which creates a race to the
de-init/free of certain resources.
This exists in similar form in the client as 17926: "mysql.exe crashes
when ctrl-c is pressed in windows."
Update after merge to 5.0
BUG#18669: Session COM_STATISTICS breaks mysqladmin status.
Changed COM_STATISTICS to display the global status, instead of thead status, for slow queries and table opens.
- In function 'handle_grant_struct' when searching the memory structures for an
entry to modify, convert all entries here host.hostname is NULL to "" and compare that
with the host passed in argument "user_from".
- A user created with hostname "" is stored in "mysql.user" table as host="" but when loaded into
memory it'll be stored as host.hostname NULL. Specifiying "" as hostname means
that "any host" can connect. Thus is's correct to turn on allow_all_hosts
when such a user is found.
- Review and fix other places where host.hostname may be NULL.
BUG#19394 OPT_INNODB_THREAD_CONCURRENCY duplicated
Removed duplication (not a user-visible change)
client/Makefile.am:
Remove $yassl_includes
client/mysqltest.c:
Turn on ssl_verify_server_cert only if host is "localhost"
extra/yassl/include/openssl/crypto.h:
Add prefix file for ssl.h
extra/yassl/include/openssl/ssl.h:
Add include file "prefix_crypto.h" to rename SSL_* functions to yaSSL_*
extra/yassl/include/yassl_int.hpp:
Import patch yassl.diff
extra/yassl/src/Makefile.am:
Add defined YASSL_PREFIX when building yassl/testsuite
extra/yassl/src/ssl.cpp:
Import patch yassl.diff
extra/yassl/src/template_instnt.cpp:
Import patch yassl.diff
extra/yassl/src/yassl_int.cpp:
Import patch yassl.diff
extra/yassl/testsuite/Makefile.am:
Add defined YASSL_PREFIX when building yassl/testsuite
extra/yassl/yassl.vcproj:
Add define YASSL_PREFIX when compiling yassl
include/violite.h:
Add new define YASSL_PREFIX beforee including ssl.h to activate inclusion of prefix_*.h files
libmysql/Makefile.am:
Remove yassl_includes
libmysql_r/Makefile.am:
Remove yassl_includes
libmysqld/Makefile.am:
Remove yassl_includes
libmysqld/examples/Makefile.am:
Remove yassl_includes
mysql-test/r/analyze.result:
Add missing drop table
mysql-test/r/grant.result:
Reorder test result
Add test cases for users with hostname ""
mysql-test/r/ps.result:
Add missing drop table
mysql-test/t/analyze.test:
Add missing drop table
mysql-test/t/grant.test:
Add "use test"
Add test cases for users with hostname ""
- Test create, grant and drop as well as connecting as the user with hostname "".
mysql-test/t/ps.test:
Add missing drop table
server-tools/instance-manager/Makefile.am:
Remove yassl_includes
sql/Makefile.am:
Remove yassl_includes
sql/mysqld.cc:
We have three potential ways of hitting the iceberg:
- unireg_end() has basic de-init
- unireg_abort() has extended de-init
- main() has a de-init sequence similar to unireg_abort()
In the Windows version of the server, Control-C is handled
in a different thread from the one main() is in. The main
loop is told to end, then unireg_abort() is called. Its
de-init and that of main() will then race each other for
mutex- and cond-var-destroys, free(), and finally exit().
This patch introduces a special case for Windows that will eliminate
the race by ending the signal-handler via unireg_end() instead if
SIGINT is signalled. This seems the least intrusive fix that still
fixes user-visible behaviour.
Two of the startup options for mysqld, innodb_commit_concurrency
and innodb_thread_concurrency, were using the same enumeration
value. Changed to give innodb_commit_concurrency it's own value.
sql/sql_acl.cc:
Add check if host is NULL
Add check if grant_name->host.hostname is null
Convert places where host.hostname is NULL to "" before using it.
sql/sql_parse.cc:
Calculate and display the global statistics.
vio/Makefile.am:
Remove yassl_includes
extra/yassl/include/openssl/generate_prefix_files.pl:
New BitKeeper file ``extra/yassl/include/openssl/generate_prefix_files.pl''
extra/yassl/include/openssl/prefix_crypto.h:
New BitKeeper file ``extra/yassl/include/openssl/prefix_crypto.h''
extra/yassl/include/openssl/prefix_ssl.h:
New BitKeeper file ``extra/yassl/include/openssl/prefix_ssl.h''
Diffstat (limited to 'extra')
-rw-r--r-- | extra/yassl/include/openssl/crypto.h | 4 | ||||
-rw-r--r-- | extra/yassl/include/openssl/generate_prefix_files.pl | 45 | ||||
-rw-r--r-- | extra/yassl/include/openssl/prefix_crypto.h | 1 | ||||
-rw-r--r-- | extra/yassl/include/openssl/prefix_ssl.h | 152 | ||||
-rw-r--r-- | extra/yassl/include/openssl/ssl.h | 10 | ||||
-rw-r--r-- | extra/yassl/include/yassl_int.hpp | 19 | ||||
-rw-r--r-- | extra/yassl/src/Makefile.am | 2 | ||||
-rw-r--r-- | extra/yassl/src/ssl.cpp | 33 | ||||
-rw-r--r-- | extra/yassl/src/template_instnt.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/src/yassl_int.cpp | 34 | ||||
-rw-r--r-- | extra/yassl/testsuite/Makefile.am | 2 | ||||
-rwxr-xr-x | extra/yassl/yassl.vcproj | 4 |
12 files changed, 233 insertions, 74 deletions
diff --git a/extra/yassl/include/openssl/crypto.h b/extra/yassl/include/openssl/crypto.h index 4a0c1db0df1..288990e1318 100644 --- a/extra/yassl/include/openssl/crypto.h +++ b/extra/yassl/include/openssl/crypto.h @@ -3,6 +3,10 @@ #ifndef ysSSL_crypto_h__ #define yaSSL_crypto_h__ +#ifdef YASSL_PREFIX +#include "prefix_crypto.h" +#endif + const char* SSLeay_version(int type); #define SSLEAY_VERSION 0x0900L diff --git a/extra/yassl/include/openssl/generate_prefix_files.pl b/extra/yassl/include/openssl/generate_prefix_files.pl new file mode 100644 index 00000000000..b921ee11e9a --- /dev/null +++ b/extra/yassl/include/openssl/generate_prefix_files.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl +# +# This script generates defines for all functions +# in yassl/include/openssl/ so they are renamed to +# ya<old_function_name>. Hopefully that is unique enough. +# +# The script is to be run manually when we import +# a new version of yaSSL +# + + + +# Find all functions in "input" and add macros +# to prefix/rename them into "output +sub generate_prefix($$) +{ + my $input= shift; + my $output= shift; + open(IN, $input) + or die("Can't open input file $input: $!"); + open(OUT, ">", $output) + or mtr_error("Can't open output file $output: $!"); + + while (<IN>) + { + chomp; + + if ( /typedef/ ) + { + next; + } + + if ( /^\s*[a-zA-Z0-9*_ ]+\s+([_a-zA-Z0-9]+)\s*\(/ ) + { + print OUT "#define $1 ya$1\n"; + } + } + + close OUT; + close IN; +} + +generate_prefix("ssl.h", "prefix_ssl.h"); +generate_prefix("crypto.h", "prefix_crypto.h"); + diff --git a/extra/yassl/include/openssl/prefix_crypto.h b/extra/yassl/include/openssl/prefix_crypto.h new file mode 100644 index 00000000000..3fa5f32c627 --- /dev/null +++ b/extra/yassl/include/openssl/prefix_crypto.h @@ -0,0 +1 @@ +#define SSLeay_version yaSSLeay_version diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h new file mode 100644 index 00000000000..7f815156f47 --- /dev/null +++ b/extra/yassl/include/openssl/prefix_ssl.h @@ -0,0 +1,152 @@ +#define Copyright yaCopyright +#define yaSSL_CleanUp yayaSSL_CleanUp +#define DH_new yaDH_new +#define DH_free yaDH_free +#define RSA_free yaRSA_free +#define RSA_generate_key yaRSA_generate_key +#define X509_free yaX509_free +#define X509_STORE_CTX_get_current_cert yaX509_STORE_CTX_get_current_cert +#define X509_STORE_CTX_get_error yaX509_STORE_CTX_get_error +#define X509_STORE_CTX_get_error_depth yaX509_STORE_CTX_get_error_depth +#define X509_NAME_oneline yaX509_NAME_oneline +#define X509_get_issuer_name yaX509_get_issuer_name +#define X509_get_subject_name yaX509_get_subject_name +#define X509_verify_cert_error_string yaX509_verify_cert_error_string +#define X509_LOOKUP_add_dir yaX509_LOOKUP_add_dir +#define X509_LOOKUP_load_file yaX509_LOOKUP_load_file +#define X509_LOOKUP_hash_dir yaX509_LOOKUP_hash_dir +#define X509_LOOKUP_file yaX509_LOOKUP_file +#define X509_STORE_add_lookup yaX509_STORE_add_lookup +#define X509_STORE_new yaX509_STORE_new +#define X509_STORE_get_by_subject yaX509_STORE_get_by_subject +#define ERR_get_error_line_data yaERR_get_error_line_data +#define ERR_print_errors_fp yaERR_print_errors_fp +#define ERR_error_string yaERR_error_string +#define ERR_remove_state yaERR_remove_state +#define ERR_get_error yaERR_get_error +#define ERR_peek_error yaERR_peek_error +#define ERR_GET_REASON yaERR_GET_REASON +#define SSL_CTX_new yaSSL_CTX_new +#define SSL_new yaSSL_new +#define SSL_set_fd yaSSL_set_fd +#define SSL_connect yaSSL_connect +#define SSL_write yaSSL_write +#define SSL_read yaSSL_read +#define SSL_accept yaSSL_accept +#define SSL_CTX_free yaSSL_CTX_free +#define SSL_free yaSSL_free +#define SSL_clear yaSSL_clear +#define SSL_shutdown yaSSL_shutdown +#define SSL_set_connect_state yaSSL_set_connect_state +#define SSL_set_accept_state yaSSL_set_accept_state +#define SSL_do_handshake yaSSL_do_handshake +#define SSL_get_cipher yaSSL_get_cipher +#define SSL_get_cipher_name yaSSL_get_cipher_name +#define SSL_get_shared_ciphers yaSSL_get_shared_ciphers +#define SSL_get_cipher_list yaSSL_get_cipher_list +#define SSL_get_version yaSSL_get_version +#define SSLeay_version yaSSLeay_version +#define SSL_get_error yaSSL_get_error +#define SSL_load_error_strings yaSSL_load_error_strings +#define SSL_set_session yaSSL_set_session +#define SSL_get_session yaSSL_get_session +#define SSL_SESSION_set_timeout yaSSL_SESSION_set_timeout +#define SSL_get_peer_certificate yaSSL_get_peer_certificate +#define SSL_get_verify_result yaSSL_get_verify_result +#define SSL_CTX_set_verify yaSSL_CTX_set_verify +#define SSL_CTX_load_verify_locations yaSSL_CTX_load_verify_locations +#define SSL_CTX_set_default_verify_paths yaSSL_CTX_set_default_verify_paths +#define SSL_CTX_check_private_key yaSSL_CTX_check_private_key +#define SSL_CTX_set_session_id_context yaSSL_CTX_set_session_id_context +#define SSL_CTX_set_tmp_rsa_callback yaSSL_CTX_set_tmp_rsa_callback +#define SSL_CTX_set_options yaSSL_CTX_set_options +#define SSL_CTX_set_session_cache_mode yaSSL_CTX_set_session_cache_mode +#define SSL_CTX_set_timeout yaSSL_CTX_set_timeout +#define SSL_CTX_use_certificate_chain_file yaSSL_CTX_use_certificate_chain_file +#define SSL_CTX_set_default_passwd_cb yaSSL_CTX_set_default_passwd_cb +#define SSL_CTX_use_RSAPrivateKey_file yaSSL_CTX_use_RSAPrivateKey_file +#define SSL_CTX_set_info_callback yaSSL_CTX_set_info_callback +#define SSL_CTX_sess_accept yaSSL_CTX_sess_accept +#define SSL_CTX_sess_connect yaSSL_CTX_sess_connect +#define SSL_CTX_sess_accept_good yaSSL_CTX_sess_accept_good +#define SSL_CTX_sess_connect_good yaSSL_CTX_sess_connect_good +#define SSL_CTX_sess_accept_renegotiate yaSSL_CTX_sess_accept_renegotiate +#define SSL_CTX_sess_connect_renegotiate yaSSL_CTX_sess_connect_renegotiate +#define SSL_CTX_sess_hits yaSSL_CTX_sess_hits +#define SSL_CTX_sess_cb_hits yaSSL_CTX_sess_cb_hits +#define SSL_CTX_sess_cache_full yaSSL_CTX_sess_cache_full +#define SSL_CTX_sess_misses yaSSL_CTX_sess_misses +#define SSL_CTX_sess_timeouts yaSSL_CTX_sess_timeouts +#define SSL_CTX_sess_number yaSSL_CTX_sess_number +#define SSL_CTX_sess_get_cache_size yaSSL_CTX_sess_get_cache_size +#define SSL_CTX_get_verify_mode yaSSL_CTX_get_verify_mode +#define SSL_get_verify_mode yaSSL_get_verify_mode +#define SSL_CTX_get_verify_depth yaSSL_CTX_get_verify_depth +#define SSL_get_verify_depth yaSSL_get_verify_depth +#define SSL_get_default_timeout yaSSL_get_default_timeout +#define SSL_CTX_get_session_cache_mode yaSSL_CTX_get_session_cache_mode +#define SSL_session_reused yaSSL_session_reused +#define SSL_set_rfd yaSSL_set_rfd +#define SSL_set_wfd yaSSL_set_wfd +#define SSL_set_shutdown yaSSL_set_shutdown +#define SSL_want_read yaSSL_want_read +#define SSL_want_write yaSSL_want_write +#define SSL_pending yaSSL_pending +#define SSL_CTX_use_certificate_file yaSSL_CTX_use_certificate_file +#define SSL_CTX_use_PrivateKey_file yaSSL_CTX_use_PrivateKey_file +#define SSL_CTX_set_cipher_list yaSSL_CTX_set_cipher_list +#define SSL_CTX_sess_set_cache_size yaSSL_CTX_sess_set_cache_size +#define SSL_CTX_set_tmp_dh yaSSL_CTX_set_tmp_dh +#define OpenSSL_add_all_algorithms yaOpenSSL_add_all_algorithms +#define SSL_library_init yaSSL_library_init +#define SSLeay_add_ssl_algorithms yaSSLeay_add_ssl_algorithms +#define SSL_get_current_cipher yaSSL_get_current_cipher +#define SSL_CIPHER_description yaSSL_CIPHER_description +#define SSL_alert_type_string_long yaSSL_alert_type_string_long +#define SSL_alert_desc_string_long yaSSL_alert_desc_string_long +#define SSL_state_string_long yaSSL_state_string_long +#define EVP_md5 yaEVP_md5 +#define EVP_des_ede3_cbc yaEVP_des_ede3_cbc +#define EVP_BytesToKey yaEVP_BytesToKey +#define DES_set_key_unchecked yaDES_set_key_unchecked +#define DES_ede3_cbc_encrypt yaDES_ede3_cbc_encrypt +#define RAND_screen yaRAND_screen +#define RAND_file_name yaRAND_file_name +#define RAND_write_file yaRAND_write_file +#define RAND_load_file yaRAND_load_file +#define RAND_status yaRAND_status +#define DES_set_key yaDES_set_key +#define DES_set_odd_parity yaDES_set_odd_parity +#define DES_ecb_encrypt yaDES_ecb_encrypt +#define SSL_CTX_set_default_passwd_cb_userdata yaSSL_CTX_set_default_passwd_cb_userdata +#define SSL_SESSION_free yaSSL_SESSION_free +#define SSL_get_certificate yaSSL_get_certificate +#define SSL_get_privatekey yaSSL_get_privatekey +#define X509_get_pubkey yaX509_get_pubkey +#define EVP_PKEY_copy_parameters yaEVP_PKEY_copy_parameters +#define EVP_PKEY_free yaEVP_PKEY_free +#define ERR_error_string_n yaERR_error_string_n +#define ERR_free_strings yaERR_free_strings +#define EVP_cleanup yaEVP_cleanup +#define X509_get_ext_d2i yaX509_get_ext_d2i +#define GENERAL_NAMES_free yaGENERAL_NAMES_free +#define sk_GENERAL_NAME_num yask_GENERAL_NAME_num +#define sk_GENERAL_NAME_value yask_GENERAL_NAME_value +#define ASN1_STRING_data yaASN1_STRING_data +#define ASN1_STRING_length yaASN1_STRING_length +#define ASN1_STRING_type yaASN1_STRING_type +#define X509_NAME_get_index_by_NID yaX509_NAME_get_index_by_NID +#define X509_NAME_ENTRY_get_data yaX509_NAME_ENTRY_get_data +#define X509_NAME_get_entry yaX509_NAME_get_entry +#define ASN1_STRING_to_UTF8 yaASN1_STRING_to_UTF8 +#define SSLv23_client_method yaSSLv23_client_method +#define SSLv2_client_method yaSSLv2_client_method +#define SSL_get1_session yaSSL_get1_session +#define X509_get_notBefore yaX509_get_notBefore +#define X509_get_notAfter yaX509_get_notAfter +#define MD4_Init yaMD4_Init +#define MD4_Update yaMD4_Update +#define MD4_Final yaMD4_Final +#define MD5_Init yaMD5_Init +#define MD5_Update yaMD5_Update +#define MD5_Final yaMD5_Final diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 23e48d2011f..af801029561 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -28,6 +28,10 @@ #ifndef yaSSL_openssl_h__ #define yaSSL_openssl_h__ +#ifdef YASSL_PREFIX +#include "prefix_ssl.h" +#endif + #include <stdio.h> /* ERR_print fp */ #include "opensslv.h" /* for version number */ #include "rsa.h" @@ -373,11 +377,9 @@ char* SSL_state_string_long(SSL*); /* EVP stuff, des and md5, different file? */ -typedef struct Digest Digest; -typedef Digest EVP_MD; +typedef char EVP_MD; -typedef struct BulkCipher BulkCipher; -typedef BulkCipher EVP_CIPHER; +typedef char EVP_CIPHER; typedef struct EVP_PKEY EVP_PKEY; diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index 97ae468d2f9..633b75d479f 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -127,25 +127,6 @@ private: }; -// hold add crypt references provided to callers -class CryptProvider { - mySTL::list<Digest*> digestList_; - mySTL::list<BulkCipher*> cipherList_; - CryptProvider() {} // only GetCryptProvider creates -public: - ~CryptProvider(); - - Digest* NewMd5(); - BulkCipher* NewDesEde(); - - friend CryptProvider& GetCryptProvider(); -private: - CryptProvider(const CryptProvider&); // hide copy - CryptProvider& operator=(const CryptProvider&); // and assign -}; - -CryptProvider& GetCryptProvider(); - #undef X509_NAME // wincrypt.h clash // openSSL X509 names diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am index a852ca4019b..2b3e1aea5f5 100644 --- a/extra/yassl/src/Makefile.am +++ b/extra/yassl/src/Makefile.am @@ -5,4 +5,4 @@ libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \ handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \ template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h) -AM_CXXFLAGS = -DYASSL_PURE_C +AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 747305730df..07f5e9859b2 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -811,25 +811,34 @@ const char* X509_verify_cert_error_string(long /* error */) const EVP_MD* EVP_md5(void) { - return GetCryptProvider().NewMd5(); + static const char* type = "MD5"; + return type; } const EVP_CIPHER* EVP_des_ede3_cbc(void) { - return GetCryptProvider().NewDesEde(); + static const char* type = "DES_EDE3_CBC"; + return type; } int EVP_BytesToKey(const EVP_CIPHER* type, const EVP_MD* md, const byte* salt, const byte* data, int sz, int count, byte* key, byte* iv) { - EVP_MD* myMD = const_cast<EVP_MD*>(md); - uint digestSz = myMD->get_digestSize(); + // only support MD5 for now + if (strncmp(md, "MD5", 3)) return 0; + + // only support DES_EDE3_CBC for now + if (strncmp(type, "DES_EDE3_CBC", 12)) return 0; + + yaSSL::MD5 myMD; + uint digestSz = myMD.get_digestSize(); byte digest[SHA_LEN]; // max size - int keyLen = type->get_keySize(); - int ivLen = type->get_ivSize(); + yaSSL::DES_EDE cipher; + int keyLen = cipher.get_keySize(); + int ivLen = cipher.get_ivSize(); int keyLeft = keyLen; int ivLeft = ivLen; int keyOutput = 0; @@ -838,17 +847,17 @@ int EVP_BytesToKey(const EVP_CIPHER* type, const EVP_MD* md, const byte* salt, int digestLeft = digestSz; // D_(i - 1) if (keyOutput) // first time D_0 is empty - myMD->update(digest, digestSz); + myMD.update(digest, digestSz); // data - myMD->update(data, sz); + myMD.update(data, sz); // salt if (salt) - myMD->update(salt, EVP_SALT_SZ); - myMD->get_digest(digest); + myMD.update(salt, EVP_SALT_SZ); + myMD.get_digest(digest); // count for (int j = 1; j < count; j++) { - myMD->update(digest, digestSz); - myMD->get_digest(digest); + myMD.update(digest, digestSz); + myMD.get_digest(digest); } if (keyLeft) { diff --git a/extra/yassl/src/template_instnt.cpp b/extra/yassl/src/template_instnt.cpp index 134deb00c75..ce8972c72fe 100644 --- a/extra/yassl/src/template_instnt.cpp +++ b/extra/yassl/src/template_instnt.cpp @@ -86,7 +86,6 @@ template void ysDelete<X509>(X509*); template void ysDelete<Message>(Message*); template void ysDelete<sslFactory>(sslFactory*); template void ysDelete<Sessions>(Sessions*); -template void ysDelete<CryptProvider>(CryptProvider*); template void ysArrayDelete<unsigned char>(unsigned char*); template void ysArrayDelete<char>(char*); } diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 842bcd5fb5d..1ff46903bfd 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -1382,38 +1382,6 @@ sslFactory& GetSSL_Factory() } -static CryptProvider* cryptProviderInstance = 0; - -CryptProvider& GetCryptProvider() -{ - if (!cryptProviderInstance) - cryptProviderInstance = NEW_YS CryptProvider; - return *cryptProviderInstance; -} - - -CryptProvider::~CryptProvider() -{ - mySTL::for_each(digestList_.begin(), digestList_.end(), del_ptr_zero()); - mySTL::for_each(cipherList_.begin(), cipherList_.end(), del_ptr_zero()); -} - - -Digest* CryptProvider::NewMd5() -{ - Digest* ptr = NEW_YS MD5(); - digestList_.push_back(ptr); - return ptr; -} - - -BulkCipher* CryptProvider::NewDesEde() -{ - BulkCipher* ptr = NEW_YS DES_EDE(); - cipherList_.push_back(ptr); - return ptr; -} - typedef Mutex::Lock Lock; @@ -2106,12 +2074,10 @@ ASN1_STRING* StringHolder::GetString() extern "C" void yaSSL_CleanUp() { TaoCrypt::CleanUp(); - yaSSL::ysDelete(yaSSL::cryptProviderInstance); yaSSL::ysDelete(yaSSL::sslFactoryInstance); yaSSL::ysDelete(yaSSL::sessionsInstance); // In case user calls more than once, prevent seg fault - yaSSL::cryptProviderInstance = 0; yaSSL::sslFactoryInstance = 0; yaSSL::sessionsInstance = 0; } diff --git a/extra/yassl/testsuite/Makefile.am b/extra/yassl/testsuite/Makefile.am index d91822f609e..2ae46a1b409 100644 --- a/extra/yassl/testsuite/Makefile.am +++ b/extra/yassl/testsuite/Makefile.am @@ -5,7 +5,7 @@ testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \ ../examples/echoclient/echoclient.cpp \ ../examples/echoserver/echoserver.cpp testsuite_LDFLAGS = -L../src/ -L../taocrypt/src -testsuite_CXXFLAGS = -DYASSL_PURE_C -DNO_MAIN_DRIVER +testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER testsuite_LDADD = -lyassl -ltaocrypt testsuite_DEPENDENCIES = ../src/libyassl.la ../taocrypt/src/libtaocrypt.la EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat diff --git a/extra/yassl/yassl.vcproj b/extra/yassl/yassl.vcproj index e2915e3f575..a7688ac4583 100755 --- a/extra/yassl/yassl.vcproj +++ b/extra/yassl/yassl.vcproj @@ -22,7 +22,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="include,taocrypt\include,mySTL" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;YASSL_PREFIX" ExceptionHandling="FALSE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -76,7 +76,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="include,taocrypt\include,mySTL" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;YASSL_PREFIX" StringPooling="TRUE" ExceptionHandling="FALSE" RuntimeLibrary="0" |