Implemented user connection challenge handshake (#20)

Implemented user connection challenge handshake.
Optimized user challenge message processing.
This commit is contained in:
Ravin Perera
2019-10-11 17:29:45 +05:30
committed by GitHub
parent b2d4c93b9d
commit f64cdc6ad0
18 changed files with 547 additions and 128 deletions

View File

@@ -30,7 +30,9 @@ int base64_encode(const unsigned char *bin, size_t bin_len, string &encoded_stri
return -1;
// Assign the encoded char* onto the provided string reference.
encoded_string = string(base64chars, base64_len);
// "base64_len - 1" because sodium include '\0' in the calculated base64 length.
// Therefore we need to omit it when initializing the std::string.
encoded_string = string(base64chars, base64_len - 1);
return 0;
}