diff options
author | unknown <msvensson@shellback.(none)> | 2006-04-07 11:35:12 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2006-04-07 11:35:12 +0200 |
commit | 78697215c1245f5ae4d6771fece4cf7d6c363131 (patch) | |
tree | 9cad353f5a7f89b9f7ee3d3d7e2de065f3dadab7 /extra/yassl/src/crypto_wrapper.cpp | |
parent | 9a1d80e90ef7a176da61d7c19f9b463076e8ad0c (diff) | |
download | mariadb-git-78697215c1245f5ae4d6771fece4cf7d6c363131.tar.gz |
Update yassl to 1.2.2
extra/yassl/examples/client/client.cpp:
Import patch yassl.diff
extra/yassl/README:
Import patch yassl.diff
extra/yassl/examples/client/client.dsp:
Import patch yassl.diff
extra/yassl/examples/echoclient/echoclient.cpp:
Import patch yassl.diff
extra/yassl/examples/echoclient/echoclient.dsp:
Import patch yassl.diff
extra/yassl/examples/echoclient/input:
Import patch yassl.diff
extra/yassl/examples/echoclient/quit:
Import patch yassl.diff
extra/yassl/examples/echoserver/echoserver.cpp:
Import patch yassl.diff
extra/yassl/examples/echoserver/echoserver.dsp:
Import patch yassl.diff
extra/yassl/examples/server/server.cpp:
Import patch yassl.diff
extra/yassl/examples/server/server.dsp:
Import patch yassl.diff
extra/yassl/include/cert_wrapper.hpp:
Import patch yassl.diff
extra/yassl/include/crypto_wrapper.hpp:
Import patch yassl.diff
extra/yassl/include/openssl/ssl.h:
Import patch yassl.diff
extra/yassl/include/socket_wrapper.hpp:
Import patch yassl.diff
extra/yassl/include/yassl.hpp:
Import patch yassl.diff
extra/yassl/include/yassl_error.hpp:
Import patch yassl.diff
extra/yassl/include/yassl_imp.hpp:
Import patch yassl.diff
extra/yassl/include/yassl_int.hpp:
Import patch yassl.diff
extra/yassl/include/yassl_types.hpp:
Import patch yassl.diff
extra/yassl/mySTL/helpers.hpp:
Import patch yassl.diff
extra/yassl/mySTL/list.hpp:
Import patch yassl.diff
extra/yassl/mySTL/vector.hpp:
Import patch yassl.diff
extra/yassl/src/buffer.cpp:
Import patch yassl.diff
extra/yassl/src/cert_wrapper.cpp:
Import patch yassl.diff
extra/yassl/src/crypto_wrapper.cpp:
Import patch yassl.diff
extra/yassl/src/handshake.cpp:
Import patch yassl.diff
extra/yassl/src/make.bat:
Import patch yassl.diff
extra/yassl/src/socket_wrapper.cpp:
Import patch yassl.diff
extra/yassl/src/ssl.cpp:
Import patch yassl.diff
extra/yassl/src/yassl.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/benchmark/benchmark.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/benchmark/benchmark.dsp:
Import patch yassl.diff
extra/yassl/taocrypt/benchmark/make.bat:
Import patch yassl.diff
extra/yassl/taocrypt/include/blowfish.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/kernelc.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/pwdbased.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/twofish.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/bftables.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/blowfish.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/make.bat:
Import patch yassl.diff
extra/yassl/taocrypt/src/tftables.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/twofish.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/test.dsp:
Import patch yassl.diff
extra/yassl/taocrypt/test.dsw:
Import patch yassl.diff
extra/yassl/taocrypt/test/make.bat:
Import patch yassl.diff
extra/yassl/taocrypt/test/memory.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/test/test.cpp:
Import patch yassl.diff
extra/yassl/testsuite/input:
Import patch yassl.diff
extra/yassl/src/timer.cpp:
Import patch yassl.diff
extra/yassl/src/yassl_error.cpp:
Import patch yassl.diff
extra/yassl/src/yassl_imp.cpp:
Import patch yassl.diff
extra/yassl/src/yassl_int.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/aes.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/arc4.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/asn.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/block.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/des.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/dh.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/hash.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/hmac.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/md5.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/misc.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/modes.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/ripemd.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/runtime.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/sha.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/include/types.hpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/aes.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/aestables.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/algebra.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/arc4.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/asn.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/coding.cpp:
Import patch yassl.diff
extra/yassl/testsuite/make.bat:
Import patch yassl.diff
extra/yassl/testsuite/quit:
Import patch yassl.diff
extra/yassl/testsuite/test.hpp:
Import patch yassl.diff
extra/yassl/testsuite/testsuite.cpp:
Import patch yassl.diff
extra/yassl/testsuite/testsuite.dsp:
Import patch yassl.diff
extra/yassl/taocrypt/src/des.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/dh.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/hash.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/integer.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/md5.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/misc.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/random.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/ripemd.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/src/sha.cpp:
Import patch yassl.diff
extra/yassl/taocrypt/taocrypt.dsp:
Import patch yassl.diff
extra/yassl/yassl.dsp:
Import patch yassl.diff
extra/yassl/yassl.dsw:
Import patch yassl.diff
Diffstat (limited to 'extra/yassl/src/crypto_wrapper.cpp')
-rw-r--r-- | extra/yassl/src/crypto_wrapper.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp index 80cadd3d722..8859fbdd70f 100644 --- a/extra/yassl/src/crypto_wrapper.cpp +++ b/extra/yassl/src/crypto_wrapper.cpp @@ -58,13 +58,13 @@ struct MD5::MD5Impl { }; -MD5::MD5() : pimpl_(new (ys) MD5Impl) {} +MD5::MD5() : pimpl_(NEW_YS MD5Impl) {} MD5::~MD5() { ysDelete(pimpl_); } -MD5::MD5(const MD5& that) : Digest(), pimpl_(new (ys) +MD5::MD5(const MD5& that) : Digest(), pimpl_(NEW_YS MD5Impl(that.pimpl_->md5_)) {} @@ -116,13 +116,13 @@ struct SHA::SHAImpl { }; -SHA::SHA() : pimpl_(new (ys) SHAImpl) {} +SHA::SHA() : pimpl_(NEW_YS SHAImpl) {} SHA::~SHA() { ysDelete(pimpl_); } -SHA::SHA(const SHA& that) : Digest(), pimpl_(new (ys) SHAImpl(that.pimpl_->sha_)) {} +SHA::SHA(const SHA& that) : Digest(), pimpl_(NEW_YS SHAImpl(that.pimpl_->sha_)) {} SHA& SHA::operator=(const SHA& that) { @@ -173,13 +173,13 @@ struct RMD::RMDImpl { }; -RMD::RMD() : pimpl_(new (ys) RMDImpl) {} +RMD::RMD() : pimpl_(NEW_YS RMDImpl) {} RMD::~RMD() { ysDelete(pimpl_); } -RMD::RMD(const RMD& that) : Digest(), pimpl_(new (ys) RMDImpl(that.pimpl_->rmd_)) {} +RMD::RMD(const RMD& that) : Digest(), pimpl_(NEW_YS RMDImpl(that.pimpl_->rmd_)) {} RMD& RMD::operator=(const RMD& that) { @@ -230,7 +230,7 @@ struct HMAC_MD5::HMAC_MD5Impl { HMAC_MD5::HMAC_MD5(const byte* secret, unsigned int len) - : pimpl_(new (ys) HMAC_MD5Impl) + : pimpl_(NEW_YS HMAC_MD5Impl) { pimpl_->mac_.SetKey(secret, len); } @@ -280,7 +280,7 @@ struct HMAC_SHA::HMAC_SHAImpl { HMAC_SHA::HMAC_SHA(const byte* secret, unsigned int len) - : pimpl_(new (ys) HMAC_SHAImpl) + : pimpl_(NEW_YS HMAC_SHAImpl) { pimpl_->mac_.SetKey(secret, len); } @@ -331,7 +331,7 @@ struct HMAC_RMD::HMAC_RMDImpl { HMAC_RMD::HMAC_RMD(const byte* secret, unsigned int len) - : pimpl_(new (ys) HMAC_RMDImpl) + : pimpl_(NEW_YS HMAC_RMDImpl) { pimpl_->mac_.SetKey(secret, len); } @@ -379,7 +379,7 @@ struct DES::DESImpl { }; -DES::DES() : pimpl_(new (ys) DESImpl) {} +DES::DES() : pimpl_(NEW_YS DESImpl) {} DES::~DES() { ysDelete(pimpl_); } @@ -415,7 +415,7 @@ struct DES_EDE::DES_EDEImpl { }; -DES_EDE::DES_EDE() : pimpl_(new (ys) DES_EDEImpl) {} +DES_EDE::DES_EDE() : pimpl_(NEW_YS DES_EDEImpl) {} DES_EDE::~DES_EDE() { ysDelete(pimpl_); } @@ -453,7 +453,7 @@ struct RC4::RC4Impl { }; -RC4::RC4() : pimpl_(new (ys) RC4Impl) {} +RC4::RC4() : pimpl_(NEW_YS RC4Impl) {} RC4::~RC4() { ysDelete(pimpl_); } @@ -495,7 +495,7 @@ struct AES::AESImpl { }; -AES::AES(unsigned int ks) : pimpl_(new (ys) AESImpl(ks)) {} +AES::AES(unsigned int ks) : pimpl_(NEW_YS AESImpl(ks)) {} AES::~AES() { ysDelete(pimpl_); } @@ -536,7 +536,7 @@ struct RandomPool::RandomImpl { TaoCrypt::RandomNumberGenerator RNG_; }; -RandomPool::RandomPool() : pimpl_(new (ys) RandomImpl) {} +RandomPool::RandomPool() : pimpl_(NEW_YS RandomImpl) {} RandomPool::~RandomPool() { ysDelete(pimpl_); } @@ -580,7 +580,7 @@ void DSS::DSSImpl::SetPrivate(const byte* key, unsigned int sz) // Set public or private key DSS::DSS(const byte* key, unsigned int sz, bool publicKey) - : pimpl_(new (ys) DSSImpl) + : pimpl_(NEW_YS DSSImpl) { if (publicKey) pimpl_->SetPublic(key, sz); @@ -651,7 +651,7 @@ void RSA::RSAImpl::SetPrivate(const byte* key, unsigned int sz) // Set public or private key RSA::RSA(const byte* key, unsigned int sz, bool publicKey) - : pimpl_(new (ys) RSAImpl) + : pimpl_(NEW_YS RSAImpl) { if (publicKey) pimpl_->SetPublic(key, sz); @@ -723,13 +723,13 @@ struct Integer::IntegerImpl { explicit IntegerImpl(const TaoCrypt::Integer& i) : int_(i) {} }; -Integer::Integer() : pimpl_(new (ys) IntegerImpl) {} +Integer::Integer() : pimpl_(NEW_YS IntegerImpl) {} Integer::~Integer() { ysDelete(pimpl_); } -Integer::Integer(const Integer& other) : pimpl_(new (ys) +Integer::Integer(const Integer& other) : pimpl_(NEW_YS IntegerImpl(other.pimpl_->int_)) {} @@ -773,9 +773,9 @@ struct DiffieHellman::DHImpl { void AllocKeys(unsigned int pubSz, unsigned int privSz, unsigned int agrSz) { - publicKey_ = new (ys) byte[pubSz]; - privateKey_ = new (ys) byte[privSz]; - agreedKey_ = new (ys) byte[agrSz]; + publicKey_ = NEW_YS byte[pubSz]; + privateKey_ = NEW_YS byte[privSz]; + agreedKey_ = NEW_YS byte[agrSz]; } }; @@ -784,7 +784,7 @@ struct DiffieHellman::DHImpl { /* // server Side DH, server's view DiffieHellman::DiffieHellman(const char* file, const RandomPool& random) - : pimpl_(new (ys) DHImpl(random.pimpl_->RNG_)) + : pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) { using namespace TaoCrypt; Source source; @@ -808,12 +808,12 @@ DiffieHellman::DiffieHellman(const char* file, const RandomPool& random) DiffieHellman::DiffieHellman(const byte* p, unsigned int pSz, const byte* g, unsigned int gSz, const byte* pub, unsigned int pubSz, const RandomPool& random) - : pimpl_(new (ys) DHImpl(random.pimpl_->RNG_)) + : pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) { using TaoCrypt::Integer; pimpl_->dh_.Initialize(Integer(p, pSz).Ref(), Integer(g, gSz).Ref()); - pimpl_->publicKey_ = new (ys) opaque[pubSz]; + pimpl_->publicKey_ = NEW_YS opaque[pubSz]; memcpy(pimpl_->publicKey_, pub, pubSz); } @@ -821,7 +821,7 @@ DiffieHellman::DiffieHellman(const byte* p, unsigned int pSz, const byte* g, // Server Side DH, server's view DiffieHellman::DiffieHellman(const Integer& p, const Integer& g, const RandomPool& random) -: pimpl_(new (ys) DHImpl(random.pimpl_->RNG_)) +: pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) { using TaoCrypt::Integer; @@ -839,7 +839,7 @@ DiffieHellman::~DiffieHellman() { ysDelete(pimpl_); } // Client side and view, use server that for p and g DiffieHellman::DiffieHellman(const DiffieHellman& that) - : pimpl_(new (ys) DHImpl(*that.pimpl_)) + : pimpl_(NEW_YS DHImpl(*that.pimpl_)) { pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, pimpl_->publicKey_); @@ -855,9 +855,9 @@ DiffieHellman& DiffieHellman::operator=(const DiffieHellman& that) } -void DiffieHellman::makeAgreement(const byte* other) +void DiffieHellman::makeAgreement(const byte* other, unsigned int otherSz) { - pimpl_->dh_.Agree(pimpl_->agreedKey_, pimpl_->privateKey_, other); + pimpl_->dh_.Agree(pimpl_->agreedKey_, pimpl_->privateKey_, other, otherSz); } @@ -960,7 +960,7 @@ x509* PemToDer(const char* fname, CertType type) Base64Decoder b64Dec(der); uint sz = der.size(); - mySTL::auto_ptr<x509> x(new (ys) x509(sz), ysDelete); + mySTL::auto_ptr<x509> x(NEW_YS x509(sz), ysDelete); memcpy(x->use_buffer(), der.get_buffer(), sz); fclose(file); |