mirror of
https://github.com/esp8266/Arduino.git
synced 2025-10-16 22:27:59 +03:00
Allocation debugging, reduce SSL structure size.
This commit is contained in:
@@ -146,7 +146,7 @@ int RSA_decrypt(const RSA_CTX *ctx, const uint8_t *in_data,
|
||||
const int byte_size = ctx->num_octets;
|
||||
int i, size;
|
||||
bigint *decrypted_bi, *dat_bi;
|
||||
uint8_t *block = (uint8_t *)alloca(byte_size);
|
||||
uint8_t *block = (uint8_t *)malloc(byte_size);
|
||||
|
||||
memset(out_data, 0, byte_size); /* initialise */
|
||||
|
||||
@@ -182,7 +182,7 @@ int RSA_decrypt(const RSA_CTX *ctx, const uint8_t *in_data,
|
||||
/* get only the bit we want */
|
||||
if (size > 0)
|
||||
memcpy(out_data, &block[i], size);
|
||||
|
||||
free(block);
|
||||
return size ? size : -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user