|
32 | 32 |
|
33 | 33 | #define HANDSHAKE_DEBUG(A) |
34 | 34 |
|
35 | | -const unsigned LOGINSIZE = 128u; |
36 | | -const unsigned RANDSIZE = 32u; |
37 | | -const unsigned SALTLEN = 8u; |
| 35 | +constexpr unsigned LOGINSIZE = 128u; |
| 36 | +constexpr unsigned RANDSIZE = 32u; |
| 37 | +constexpr unsigned SALTLEN = 8u; |
38 | 38 |
|
39 | 39 | typedef unsigned int ULong; |
40 | 40 |
|
@@ -138,7 +138,7 @@ class PluginData |
138 | 138 |
|
139 | 139 | PseudoRandom pseudoRand; |
140 | 140 | HashSha256 hash; |
141 | | - rsa_key privateKey; |
| 141 | + rsa_key privateKey{}; |
142 | 142 | int iniLvl; |
143 | 143 | }; |
144 | 144 |
|
@@ -253,7 +253,7 @@ int ExtAuthClient::authenticate(ThrowStatusWrapper* status, IClientBlock* cBlock |
253 | 253 | error(status, "Malformed data from server - missing random block"); |
254 | 254 |
|
255 | 255 | // next append login to random block |
256 | | - unsigned len = strlen(login); |
| 256 | + unsigned len = static_cast<unsigned>(strlen(login)); |
257 | 257 | if (len > LOGINSIZE) |
258 | 258 | len = LOGINSIZE; |
259 | 259 | memcpy(&bytes[RANDSIZE], login, len); |
@@ -340,7 +340,7 @@ class ExtAuthServer : public IServerImpl<ExtAuthServer, ThrowStatusWrapper>, pub |
340 | 340 | } |
341 | 341 |
|
342 | 342 | private: |
343 | | - unsigned char msg[RANDSIZE + LOGINSIZE]; |
| 343 | + unsigned char msg[RANDSIZE + LOGINSIZE]{}; |
344 | 344 | bool sentData; |
345 | 345 | }; |
346 | 346 |
|
@@ -377,7 +377,7 @@ int ExtAuthServer::authenticate(ThrowStatusWrapper* status, IServerBlock* sBlock |
377 | 377 |
|
378 | 378 | // decompose message |
379 | 379 | const char* login = reinterpret_cast<const char*>(data); |
380 | | - unsigned len = strnlen(login, dl); |
| 380 | + unsigned len = static_cast<unsigned>(strnlen(login, dl)); |
381 | 381 | if (len == dl) |
382 | 382 | error(status, "Wrong data from client - no signature in a message"); |
383 | 383 | if (len == 0) |
|
0 commit comments