Module: check_mk
Branch: master
Commit: 9ccc047fa6a1a46bf696c443f95b387c085544eb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9ccc047fa6a1a4…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Feb 16 09:31:59 2016 +0100
windows agent: fixed mixed up bits and bytes in buffer size of encryption stream
this has no real negative effects except that the code may be a bit confusing and the
buffer is
larger than necessary
---
agents/windows/OutputProxy.cc | 9 +++++----
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 909824 -> 909824 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 909824 -> 909824 bytes
agents/windows/check_mk_agent.exe | Bin 835584 -> 835584 bytes
agents/windows/check_mk_agent.msi | Bin 2006016 -> 2006016 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 835584 -> 835584 bytes
agents/windows/install_agent-64.exe | Bin 418320 -> 418357 bytes
agents/windows/install_agent.exe | Bin 408685 -> 408679 bytes
9 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/agents/windows/OutputProxy.cc b/agents/windows/OutputProxy.cc
index 44bdd25..60c5b4e 100644
--- a/agents/windows/OutputProxy.cc
+++ b/agents/windows/OutputProxy.cc
@@ -140,7 +140,7 @@ bool BufferedSocketProxy::flushInt() {
EncryptingBufferedSocketProxy::EncryptingBufferedSocketProxy(
SOCKET socket, const std::string &passphrase, size_t buffer_size)
: BufferedSocketProxy(socket, buffer_size), _crypto(passphrase) {
- _blockSize = _crypto.blockSize();
+ _blockSize = _crypto.blockSize() / 8;
_plain.resize(_blockSize * 8);
}
@@ -181,9 +181,10 @@ void EncryptingBufferedSocketProxy::output(const char *format, ...)
{
void EncryptingBufferedSocketProxy::flush() {
// this assumes the plain buffer is large enouph for one measly block
- DWORD required_size = _crypto.encrypt(
- reinterpret_cast<BYTE *>(&(_plain)[0]), _written, _plain.size(),
true);
- writeBinary(&_plain[0], required_size);
+ char *buffer = &_plain[0];
+ DWORD required_size = _crypto.encrypt(reinterpret_cast<BYTE *>(buffer),
+ _written, _plain.size(), true);
+ writeBinary(buffer, required_size);
_written = 0;
diff --git a/agents/windows/build_version b/agents/windows/build_version
index a369ea6..b0077c6 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-1337
+1351
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index f4ac56c..b2c0c4a 100755
Binary files a/agents/windows/check_mk_agent-64.exe and
b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index c894aaf..411cd10 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and
b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index c2e1df2..70e33d6 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi
index 209cb8f..89b8f9d 100755
Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi
differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index c9ce522..f13645f 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and
b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index b98cd9c..6fc9446 100755
Binary files a/agents/windows/install_agent-64.exe and
b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 4e25713..932cdfb 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ