Skip to content

Commit

Permalink
debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax committed Sep 29, 2023
1 parent e97a943 commit 404705b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/pbcc_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ static int aes_decrypt(

pubnub_bymebl_t decoded = pbbase64_decode_alloc_std((char*)to_decrypt.data.ptr, to_decrypt.data.size);
if (decoded.ptr == NULL) {
return -2;
return -1;
}

size_t dec_buffer_size = estimated_dec_buffer_size(to_decrypt.data.size) + 5000; // TODO: Why do I need additional space?

result->ptr = (uint8_t *)malloc(dec_buffer_size);
if (result->ptr == NULL) {
return -3;
return -1;
}

result->size = dec_buffer_size;
Expand All @@ -180,7 +180,7 @@ static int aes_decrypt(
)) {
free(result->ptr);
free(decoded.ptr);
return -4;
return -1;
}

return 0;
Expand Down
2 changes: 0 additions & 2 deletions core/pbcc_crypto_unit_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ void assert_that_cryptor_works_as_expected(pubnub_crypto_algorithm_t *sut) {
int encryption_result = sut->encrypt(sut, &encrypted, to_encrypt);
assert_that(encryption_result, is_equal_to(0));

printf("Encrypted data: %s\n", encrypted.data.ptr);

pubnub_bymebl_t decrypted;
decrypted.ptr = NULL;
decrypted.size = 0;
Expand Down

0 comments on commit 404705b

Please sign in to comment.