diff options
author | Staale Smedseng <staale.smedseng@sun.com> | 2009-06-29 16:00:47 +0200 |
---|---|---|
committer | Staale Smedseng <staale.smedseng@sun.com> | 2009-06-29 16:00:47 +0200 |
commit | 300a8721fa0436e0558ab516956a90acd3cda622 (patch) | |
tree | 4e9ce667a1b14bf9610672bb5f604bb5f5becbab /extra/yassl | |
parent | 477ada0aaa515fe95db90fe38b6cfe0030fdf9ae (diff) | |
parent | 67771508836edda4bad393f1a00d89cd419e3814 (diff) | |
download | mariadb-git-300a8721fa0436e0558ab516956a90acd3cda622.tar.gz |
Merge from 5.0
Diffstat (limited to 'extra/yassl')
-rw-r--r-- | extra/yassl/src/handshake.cpp | 6 | ||||
-rw-r--r-- | extra/yassl/src/yassl_imp.cpp | 2 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/modes.hpp | 2 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/asn.cpp | 6 |
4 files changed, 15 insertions, 1 deletions
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index 262b5cb3b8b..b4d9005af15 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -790,15 +790,17 @@ void processReply(SSL& ssl) if (ssl.GetError()) return; if (DoProcessReply(ssl)) + { // didn't complete process if (!ssl.getSocket().IsNonBlocking()) { // keep trying now, blocking ok while (!ssl.GetError()) if (DoProcessReply(ssl) == 0) break; - } + } else // user will have try again later, non blocking ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); + } } @@ -873,10 +875,12 @@ void sendServerKeyExchange(SSL& ssl, BufferOutput buffer) void sendChangeCipher(SSL& ssl, BufferOutput buffer) { if (ssl.getSecurity().get_parms().entity_ == server_end) + { if (ssl.getSecurity().get_resuming()) ssl.verifyState(clientKeyExchangeComplete); else ssl.verifyState(clientFinishedComplete); + } if (ssl.GetError()) return; ChangeCipherSpec ccs; diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index 20dfe50f132..f079df8c7ce 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -1305,6 +1305,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl) ssl.useSecurity().use_connection().sessionID_Set_ = false; 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()); @@ -1319,6 +1320,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl) ssl.useSecurity().set_resuming(false); ssl.useLog().Trace("server denied resumption"); } + } if (ssl.CompressionOn() && !compression_method_) ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp index d1ebce7568b..4575fe1414b 100644 --- a/extra/yassl/taocrypt/include/modes.hpp +++ b/extra/yassl/taocrypt/include/modes.hpp @@ -96,10 +96,12 @@ inline void Mode_BASE::Process(byte* out, const byte* in, word32 sz) if (mode_ == ECB) ECB_Process(out, in, sz); else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) CBC_Encrypt(out, in, sz); else CBC_Decrypt(out, in, sz); + } } diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index 3b1c1c2136a..78200841bda 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -781,10 +781,12 @@ void CertDecoder::GetDate(DateType dt) source_.advance(length); if (!ValidateDate(date, b, dt) && verify_) + { if (dt == BEFORE) source_.SetError(BEFORE_DATE_E); else source_.SetError(AFTER_DATE_E); + } // save for later use if (dt == BEFORE) { @@ -1062,6 +1064,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz) } word32 rLen = GetLength(source); if (rLen != 20) + { if (rLen == 21) { // zero at front, eat source.next(); --rLen; @@ -1074,6 +1077,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz) source.SetError(DSA_SZ_E); return 0; } + } memcpy(decoded, source.get_buffer() + source.get_index(), rLen); source.advance(rLen); @@ -1084,6 +1088,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz) } word32 sLen = GetLength(source); if (sLen != 20) + { if (sLen == 21) { source.next(); // zero at front, eat --sLen; @@ -1096,6 +1101,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz) source.SetError(DSA_SZ_E); return 0; } + } memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen); source.advance(sLen); |