mirror of https://github.com/OpenRCT2/OpenRCT2.git
Replace OPENSSL_{malloc,free} with the standard C versions
This commit is contained in:
parent
9bfc9a91e3
commit
176fe0d036
|
@ -385,7 +385,7 @@ bool NetworkKey::Sign(const uint8 * md, const size_t len, char ** signature, siz
|
||||||
|
|
||||||
uint8 * sig;
|
uint8 * sig;
|
||||||
/* Allocate memory for the signature based on size in slen */
|
/* Allocate memory for the signature based on size in slen */
|
||||||
if ((sig = (unsigned char*)OPENSSL_malloc((sint32)(sizeof(unsigned char) * (*out_size)))) == NULL)
|
if ((sig = (unsigned char*)malloc((sint32)(sizeof(unsigned char) * (*out_size)))) == NULL)
|
||||||
{
|
{
|
||||||
log_error("Failed to crypto-allocate space for signature");
|
log_error("Failed to crypto-allocate space for signature");
|
||||||
EVP_MD_CTX_destroy(mdctx);
|
EVP_MD_CTX_destroy(mdctx);
|
||||||
|
@ -395,12 +395,12 @@ bool NetworkKey::Sign(const uint8 * md, const size_t len, char ** signature, siz
|
||||||
if (1 != EVP_DigestSignFinal(mdctx, sig, out_size)) {
|
if (1 != EVP_DigestSignFinal(mdctx, sig, out_size)) {
|
||||||
log_error("Failed to finalise signature");
|
log_error("Failed to finalise signature");
|
||||||
EVP_MD_CTX_destroy(mdctx);
|
EVP_MD_CTX_destroy(mdctx);
|
||||||
OPENSSL_free(sig);
|
free(sig);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*signature = new char[*out_size];
|
*signature = new char[*out_size];
|
||||||
memcpy(*signature, sig, *out_size);
|
memcpy(*signature, sig, *out_size);
|
||||||
OPENSSL_free(sig);
|
free(sig);
|
||||||
EVP_MD_CTX_destroy(mdctx);
|
EVP_MD_CTX_destroy(mdctx);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue