Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit318df80

Browse files
Disable OpenSSL EVP digest padding in pgcrypto
The PX layer in pgcrypto is handling digest padding on its own uniformlyfor all backend implementations. Starting with OpenSSL 3.0.0, DecryptUpdatedoesn't flush the last block in case padding is enabled so explicitlydisable it as we don't use it.This will be backpatched to all supported version once there is sufficienttesting in the buildfarm of OpenSSL 3.Reviewed-by: Peter Eisentraut, Michael PaquierDiscussion:https://postgr.es/m/FEF81714-D479-4512-839B-C769D2605F8A@yesql.se
1 parent152c2e0 commit318df80

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎contrib/pgcrypto/openssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ gen_ossl_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
379379
{
380380
if (!EVP_DecryptInit_ex(od->evp_ctx,od->evp_ciph,NULL,NULL,NULL))
381381
returnPXE_CIPHER_INIT;
382+
if (!EVP_CIPHER_CTX_set_padding(od->evp_ctx,0))
383+
returnPXE_CIPHER_INIT;
382384
if (!EVP_CIPHER_CTX_set_key_length(od->evp_ctx,od->klen))
383385
returnPXE_CIPHER_INIT;
384386
if (!EVP_DecryptInit_ex(od->evp_ctx,NULL,NULL,od->key,od->iv))
@@ -403,6 +405,8 @@ gen_ossl_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
403405
{
404406
if (!EVP_EncryptInit_ex(od->evp_ctx,od->evp_ciph,NULL,NULL,NULL))
405407
returnPXE_CIPHER_INIT;
408+
if (!EVP_CIPHER_CTX_set_padding(od->evp_ctx,0))
409+
returnPXE_CIPHER_INIT;
406410
if (!EVP_CIPHER_CTX_set_key_length(od->evp_ctx,od->klen))
407411
returnPXE_CIPHER_INIT;
408412
if (!EVP_EncryptInit_ex(od->evp_ctx,NULL,NULL,od->key,od->iv))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp