Skip to content

PgBouncer md5 FIPS compatibility changes - #949

Merged
JelteF merged 7 commits into
pgbouncer:masterfrom
ajit-at-edb:master
Sep 26, 2023
Merged

JelteF merged 7 commits into
pgbouncer:masterfrom
ajit-at-edb:master

Conversation

@ajit-at-edb

Copy link
Copy Markdown
Contributor

Root cause:

MD5 encryption functions are internally implemented in libusual (./lib/usual/crypto/md5.c). MD5 Authentication functions can not be used on FIPS compliant host. Due to internal implementation of MD5 algorithm, MD5 authentication is working without error on FIPS enabled host. Ideally it should throw error.

Solution:

Due to internal implementation, we are not using openssl APIs for MD5. In this fix all internal MD5 calls are replaced to openssl APIs after which MD5 authentication throws expected error on FIPS compliant host.

Testing:

Pytest testsuite ran successfully.
MD5 authentication scenario on non-FIPS compliant host runs successfully with and without compiling with “--without-openssl ” flag.
MD5 authentication scenario on FIPS compliant host errors out as expected when compiled with openssl flag.
MD5 authentication scenario on FIPS compliant host runs successfully when compiled with " “--without-openssl ” flag.

Comment thread src/util.c Outdated

@JelteF JelteF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compilation is failing on CI for many targets

@ajit-at-edb
ajit-at-edb requested a review from JelteF September 22, 2023 11:54
@JelteF

JelteF commented Sep 22, 2023

Copy link
Copy Markdown
Member

Compilation of the hba_test binary is failing currently

Comment thread include/util.h Outdated
ajit-at-edb and others added 3 commits September 25, 2023 08:57
Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
@ajit-at-edb
ajit-at-edb requested a review from JelteF September 25, 2023 04:33
Comment thread src/util.c Outdated
Comment thread src/util.c Outdated
Comment thread src/util.c
ajit-at-edb and others added 2 commits September 26, 2023 08:18
Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
@ajit-at-edb
ajit-at-edb requested a review from JelteF September 26, 2023 03:53
@JelteF JelteF changed the title PgBouncer md5 FIPS compatibility changes. PgBouncer md5 FIPS compatibility changes Sep 26, 2023
@JelteF
JelteF merged commit c74d1cd into pgbouncer:master Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants