git.stg.codes
/
stg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fe67eb7
)
Fixed encryption in srvconf.lib
author
Maxim Mamontov
<faust@stg.dp.ua>
Thu, 26 Jun 2014 13:38:36 +0000
(16:38 +0300)
committer
Maxim Mamontov
<faust@stg.dp.ua>
Thu, 26 Jun 2014 13:38:36 +0000
(16:38 +0300)
stglibs/srvconf.lib/netunit.cpp
patch
|
blob
|
history
diff --git
a/stglibs/srvconf.lib/netunit.cpp
b/stglibs/srvconf.lib/netunit.cpp
index 3461fb47dcd58c833278641b4ec25ef1e8f22fdf..f6fcf500c71b1e738ada80ed43ebfbbb19e73541 100644
(file)
--- a/
stglibs/srvconf.lib/netunit.cpp
+++ b/
stglibs/srvconf.lib/netunit.cpp
@@
-316,7
+316,7
@@
char loginZ[ADM_LOGIN_LEN];
memset(loginZ, 0, ADM_LOGIN_LEN);
BLOWFISH_CTX ctx;
InitContext(password.c_str(), PASSWD_LEN, &ctx);
memset(loginZ, 0, ADM_LOGIN_LEN);
BLOWFISH_CTX ctx;
InitContext(password.c_str(), PASSWD_LEN, &ctx);
-EncryptString(loginZ, login.c_str(), std::min(login.length(), ADM_LOGIN_LEN), &ctx);
+EncryptString(loginZ, login.c_str(), std::min(login.length()
+ 1
, ADM_LOGIN_LEN), &ctx);
if (send(outerSocket, loginZ, ADM_LOGIN_LEN, 0) <= 0)
{
errorMsg = SEND_LOGIN_ERROR;
if (send(outerSocket, loginZ, ADM_LOGIN_LEN, 0) <= 0)
{
errorMsg = SEND_LOGIN_ERROR;
@@
-359,9
+359,9
@@
int NETTRANSACT::TxData(const std::string & text)
{
BLOWFISH_CTX ctx;
InitContext(password.c_str(), PASSWD_LEN, &ctx);
{
BLOWFISH_CTX ctx;
InitContext(password.c_str(), PASSWD_LEN, &ctx);
-char buffer[text.length()];
-EncryptString(buffer, text.c_str(), text.length(), &ctx);
-if (send(outerSocket, buffer,
text.length(
), 0) <= 0)
+char buffer[text.length()
+ 9
];
+EncryptString(buffer, text.c_str(), text.length()
+ 1
, &ctx);
+if (send(outerSocket, buffer,
sizeof(buffer
), 0) <= 0)
{
errorMsg = SEND_DATA_ERROR;
return st_send_fail;
{
errorMsg = SEND_DATA_ERROR;
return st_send_fail;