Skip to content

Commit

Permalink
compilers...
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax committed Oct 9, 2023
1 parent 98acc48 commit 6f419e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/pbcc_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions core/pbcc_crypto_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string.h>
#include <stdlib.h>

#define LEGACY_IDENTIFIER (char[4]) { 0 }
char LEGACY_IDENTIFIER[4];
#define AES_BLOCK_SIZE 16

static int legacy_encrypt(
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6f419e1

Please sign in to comment.