forked from rosebudai/OpenRCT2-Web
Make sure the challenge token is random and handled properly
This change also fixes passworded servers not working properly, as strlen() was getting called on something that was not guaranteed to be null-terminated string when signing the token.
This commit is contained in:
1 parent
66abc31fee
commit
4ffceafdbb
4 files changed
+20
-15
No files matched your search
@@ -333,7 +333,7 @@ std::string NetworkKey::PublicKeyHash()
|
||||
return digest_out;
|
||||
}
|
||||
|
||||
bool NetworkKey::Sign(const char * md, const size_t len, char ** signature, size_t * out_size)
|
||||
bool NetworkKey::Sign(const uint8_t *md, const size_t len, char ** signature, size_t * out_size)
|
||||
{
|
||||
EVP_MD_CTX * mdctx = nullptr;
|
||||
|
||||
@@ -393,7 +393,7 @@ bool NetworkKey::Sign(const char * md, const size_t len, char ** signature, size
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetworkKey::Verify(const char * md, const size_t len, const char * sig, const size_t siglen)
|
||||
bool NetworkKey::Verify(const uint8_t * md, const size_t len, const char * sig, const size_t siglen)
|
||||
{
|
||||
EVP_MD_CTX * mdctx = NULL;
|
||||
|
||||
|
||||
Reference in new issue
Block a user