maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #00832
Simple compiler warning fixes for yassl-1.9.6
The attached patch contains a few simple fixes for compiler warnings that I
applied to our copy of YaSSL in the MariaDB source tree
(http://askmonty.org/wiki/index.php/MariaDB).
I am sending you these in case you want to include them in upstream YaSSL.
I did not see instructions for submitting patches at http://www.yassl.com/, so
please let me know if there is some other email address or procedure I should
follow.
Signed-off-by: Kristian Nielsen <knielsen@xxxxxxxxxxxxxxx>
diff -u --recursive yassl-1.9.6.orig/include/yassl_int.hpp yassl-1.9.6.new/include/yassl_int.hpp
--- yassl-1.9.6.orig/include/yassl_int.hpp 2008-08-13 20:42:55.000000000 +0200
+++ yassl-1.9.6.new/include/yassl_int.hpp 2009-08-27 12:14:17.000000000 +0200
@@ -449,7 +449,7 @@
const Ciphers& GetCiphers() const;
const DH_Parms& GetDH_Parms() const;
const Stats& GetStats() const;
- const VerifyCallback getVerifyCallback() const;
+ VerifyCallback getVerifyCallback() const;
pem_password_cb GetPasswordCb() const;
void* GetUserData() const;
bool GetSessionCacheOff() const;
diff -u --recursive yassl-1.9.6.orig/src/handshake.cpp yassl-1.9.6.new/src/handshake.cpp
--- yassl-1.9.6.orig/src/handshake.cpp 2008-11-04 00:58:32.000000000 +0100
+++ yassl-1.9.6.new/src/handshake.cpp 2009-08-27 12:15:09.000000000 +0200
@@ -798,7 +798,7 @@
{
if (ssl.GetError()) return;
- if (DoProcessReply(ssl))
+ if (DoProcessReply(ssl)) {
// didn't complete process
if (!ssl.getSocket().IsNonBlocking()) {
// keep trying now, blocking ok
@@ -808,6 +808,7 @@
else
// user will have try again later, non blocking
ssl.SetError(YasslError(SSL_ERROR_WANT_READ));
+ }
}
@@ -882,11 +883,12 @@
// send change cipher
void sendChangeCipher(SSL& ssl, BufferOutput buffer)
{
- if (ssl.getSecurity().get_parms().entity_ == server_end)
+ 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 -u --recursive yassl-1.9.6.orig/src/yassl_imp.cpp yassl-1.9.6.new/src/yassl_imp.cpp
--- yassl-1.9.6.orig/src/yassl_imp.cpp 2008-11-04 02:44:02.000000000 +0100
+++ yassl-1.9.6.new/src/yassl_imp.cpp 2009-08-27 12:16:28.000000000 +0200
@@ -1311,7 +1311,7 @@
else
ssl.useSecurity().use_connection().sessionID_Set_ = false;
- if (ssl.getSecurity().get_resuming())
+ 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());
@@ -1326,6 +1326,7 @@
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 -u --recursive yassl-1.9.6.orig/src/yassl_int.cpp yassl-1.9.6.new/src/yassl_int.cpp
--- yassl-1.9.6.orig/src/yassl_int.cpp 2008-11-04 02:13:38.000000000 +0100
+++ yassl-1.9.6.new/src/yassl_int.cpp 2009-08-27 12:16:55.000000000 +0200
@@ -1840,7 +1840,7 @@
}
-const VerifyCallback SSL_CTX::getVerifyCallback() const
+VerifyCallback SSL_CTX::getVerifyCallback() const
{
return verifyCallback_;
}
diff -u --recursive yassl-1.9.6.orig/taocrypt/include/modes.hpp yassl-1.9.6.new/taocrypt/include/modes.hpp
--- yassl-1.9.6.orig/taocrypt/include/modes.hpp 2007-03-15 03:15:12.000000000 +0100
+++ yassl-1.9.6.new/taocrypt/include/modes.hpp 2009-08-27 12:17:46.000000000 +0200
@@ -103,11 +103,12 @@
{
if (mode_ == ECB)
ECB_Process(out, in, sz);
- else if (mode_ == CBC)
+ else if (mode_ == CBC) {
if (dir_ == ENCRYPTION)
CBC_Encrypt(out, in, sz);
else
CBC_Decrypt(out, in, sz);
+ }
}
diff -u --recursive yassl-1.9.6.orig/taocrypt/src/asn.cpp yassl-1.9.6.new/taocrypt/src/asn.cpp
--- yassl-1.9.6.orig/taocrypt/src/asn.cpp 2008-05-23 03:29:25.000000000 +0200
+++ yassl-1.9.6.new/taocrypt/src/asn.cpp 2009-08-27 12:18:37.000000000 +0200
@@ -786,11 +786,12 @@
memcpy(date, source_.get_current(), length);
source_.advance(length);
- if (!ValidateDate(date, b, dt) && verify_)
+ 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) {
@@ -1067,7 +1068,7 @@
return 0;
}
word32 rLen = GetLength(source);
- if (rLen != 20)
+ if (rLen != 20) {
if (rLen == 21) { // zero at front, eat
source.next();
--rLen;
@@ -1080,6 +1081,7 @@
source.SetError(DSA_SZ_E);
return 0;
}
+ }
memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
source.advance(rLen);
@@ -1089,7 +1091,7 @@
return 0;
}
word32 sLen = GetLength(source);
- if (sLen != 20)
+ if (sLen != 20) {
if (sLen == 21) {
source.next(); // zero at front, eat
--sLen;
@@ -1102,6 +1104,7 @@
source.SetError(DSA_SZ_E);
return 0;
}
+ }
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
source.advance(sLen);
Follow ups