aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/CSecurityDH.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/CSecurityDH.cxx')
-rw-r--r--common/rfb/CSecurityDH.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rfb/CSecurityDH.cxx b/common/rfb/CSecurityDH.cxx
index 9e67885c..f6e5ded4 100644
--- a/common/rfb/CSecurityDH.cxx
+++ b/common/rfb/CSecurityDH.cxx
@@ -130,7 +130,7 @@ void CSecurityDH::writeCredentials()
struct aes128_ctx aesCtx;
aes128_set_encrypt_key(&aesCtx, key);
- char buf[128];
+ uint8_t buf[128];
if (!rs.hasData(128))
throw ConnFailedException("failed to generate random padding");
rs.readBytes(buf, 128);
@@ -140,7 +140,7 @@ void CSecurityDH::writeCredentials()
if (password.size() >= 64)
throw AuthFailureException("password is too long");
memcpy(buf + 64, password.c_str(), password.size() + 1);
- aes128_encrypt(&aesCtx, 128, (uint8_t *)buf, (uint8_t *)buf);
+ aes128_encrypt(&aesCtx, 128, buf, buf);
rdr::OutStream* os = cc->getOutStream();
os->writeBytes(buf, 128);