1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Allocation debugging, reduce SSL structure size.

This commit is contained in:
Ivan Grokhotkov
2015-09-01 15:59:34 +03:00
parent 6c91aa10fc
commit 6095fde37e
10 changed files with 82 additions and 116 deletions

View File

@ -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;
}