1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Define cipher magic size with sizeof() rather than using a constant.

This commit is contained in:
David Steele
2018-08-14 16:08:58 -04:00
parent 6643afe9a8
commit 9e3273fdf9
3 changed files with 7 additions and 3 deletions

View File

@ -81,12 +81,12 @@ testRun(void)
encryptSize += cipherBlockProcess(
blockEncrypt, (unsigned char *)TEST_PLAINTEXT, strlen(TEST_PLAINTEXT), encryptBuffer + encryptSize);
TEST_RESULT_INT(
encryptSize, CIPHER_BLOCK_HEADER_SIZE + EVP_CIPHER_block_size(blockEncrypt->cipher),
encryptSize, CIPHER_BLOCK_HEADER_SIZE + (size_t)EVP_CIPHER_block_size(blockEncrypt->cipher),
"cipher size increases by one block");
encryptSize += cipherBlockFlush(blockEncrypt, encryptBuffer + encryptSize);
TEST_RESULT_INT(
encryptSize, CIPHER_BLOCK_HEADER_SIZE + (EVP_CIPHER_block_size(blockEncrypt->cipher) * 2),
encryptSize, CIPHER_BLOCK_HEADER_SIZE + (size_t)(EVP_CIPHER_block_size(blockEncrypt->cipher) * 2),
"cipher size increases by one block on flush");
cipherBlockFree(blockEncrypt);