diff --git a/core/pbcc_crypto.c b/core/pbcc_crypto.c index 84d6f158..d7a2dc53 100644 --- a/core/pbcc_crypto.c +++ b/core/pbcc_crypto.c @@ -32,7 +32,7 @@ int pbcc_cipher_key_hash(const uint8_t* cipher_key, uint8_t* hash) { #define IDENTIFIER_LENGTH 4 #define SENTINEL "PNED" -#define LEGACY_IDENTIFIER (char[IDENTIFIER_LENGTH]){ 0 } +char LEGACY_IDENTIFIER[IDENTIFIER_LENGTH]; struct pubnub_cryptor_header_v1 pbcc_prepare_cryptor_header_v1(uint8_t identifier[4], struct pubnub_byte_mem_block metadata) { struct pubnub_cryptor_header_v1 header; diff --git a/core/pbcc_crypto_legacy.c b/core/pbcc_crypto_legacy.c index eed92377..2550184d 100644 --- a/core/pbcc_crypto_legacy.c +++ b/core/pbcc_crypto_legacy.c @@ -7,7 +7,7 @@ #include #include -#define LEGACY_IDENTIFIER (char[4]) { 0 } +char LEGACY_IDENTIFIER[4]; #define AES_BLOCK_SIZE 16 static int legacy_encrypt( @@ -93,7 +93,7 @@ static int legacy_decrypt( ) { struct legacy_context *ctx = (struct legacy_context *)algo->user_data; - size_t estimated_size = estimated_dec_buffer_size(to_decrypt.data.size); // TODO: WHY!?!?!? + size_t estimated_size = estimated_dec_buffer_size(to_decrypt.data.size) + 500000; // TODO: WHY!?!?!? result->ptr = (uint8_t*)malloc(estimated_size); memset(result->ptr, 0, estimated_size); if (NULL == result->ptr) {