Skip to content

Commit f8c0a95

Browse files
committed
Fix: pgcrypto regression test failures on Rocky 8
This commit fixes two issues preventing the `ic-contrib` regression tests from passing on Rocky Linux 8 environments (FIPS enabled). 1. Fixed regex matching for "Some PX error": The previous `init_file` rule missed a space in the error message pattern (`ERROR: Cannot use...`), causing FIPS error masking to fail. Added the missing space to correctly match the output. 2. Masked ephemeral line numbers: Different compilation environments (Rocky 8 vs 9) produce different line number references in error messages (e.g., pgcrypto.c:213 vs 215). Added `matchsubs` rules to mask these line numbers with `(pgcrypto.c:XXX)` and updated `expected/fips_2.out` to match, ensuring consistent test results across platforms. Changes: * Modified src/test/regress/init_file * Updated contrib/pgcrypto/expected/fips_2.out See: #1539
1 parent e3db1c0 commit f8c0a95

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

contrib/pgcrypto/expected/fips_2.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,25 @@ SELECT 'Test gen_salt : EXPECTED FAIL FIPS' as comment;
5555
(1 row)
5656

5757
UPDATE fipstest SET salt = gen_salt('md5');
58-
ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:213)
58+
ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:XXX)
5959
SELECT 'Test crypt : EXPECTED FAIL FIPS' as comment;
6060
comment
6161
---------------------------------
6262
Test crypt : EXPECTED FAIL FIPS
6363
(1 row)
6464

6565
UPDATE fipstest SET res = crypt(data, salt);
66-
ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:266)
66+
ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:XXX)
6767
SELECT res = crypt(data, res) AS "worked" FROM fipstest;
68-
ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:266)
68+
ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:XXX)
6969
SELECT 'Test pgp : EXPECTED PASS' as comment;
7070
comment
7171
--------------------------
7272
Test pgp : EXPECTED PASS
7373
(1 row)
7474

7575
select pgp_sym_decrypt(pgp_sym_encrypt('santa clause', 'mypass', 'cipher-algo=aes256'), 'mypass');
76-
ERROR: requested functionality not allowed in FIPS mode (openssl.c:772)
76+
ERROR: requested functionality not allowed in FIPS mode (openssl.c:XXX)
7777
SELECT 'Test pgp : EXPECTED FAIL FIPS' as comment;
7878
comment
7979
-------------------------------
@@ -89,13 +89,13 @@ SELECT 'Test raw encrypt : EXPECTED PASS' as comment;
8989
(1 row)
9090

9191
SELECT encrypt('santa claus', 'mypass', 'aes') as raw_aes;
92-
ERROR: requested functionality not allowed in FIPS mode (openssl.c:772)
92+
ERROR: requested functionality not allowed in FIPS mode (openssl.c:XXX)
9393
SELECT 'Test raw encrypt : EXPECTED FAIL FIPS' as comment;
9494
comment
9595
---------------------------------------
9696
Test raw encrypt : EXPECTED FAIL FIPS
9797
(1 row)
9898

9999
SELECT encrypt('santa claus', 'mypass', 'bf') as raw_blowfish;
100-
ERROR: requested functionality not allowed in FIPS mode (openssl.c:772)
100+
ERROR: requested functionality not allowed in FIPS mode (openssl.c:XXX)
101101
DROP TABLE fipstest;

src/test/regress/init_file

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,14 @@ s/ERROR: FIPS enabled OpenSSL is required for strict FIPS mode .*/ERROR: FIPS
134134
# Mask out OpenSSL behavior change in different version
135135
m/ERROR: Cannot use "md5": No such hash algorithm/
136136
s/ERROR: Cannot use "md5": No such hash algorithm/ERROR: Cannot use "md5": /
137-
m/ERROR: Cannot use "md5": Some PX error \(not specified\)/
138-
s/ERROR: Cannot use "md5": Some PX error \(not specified\)/ERROR: Cannot use "md5": /
137+
m/ERROR: Cannot use "md5": Some PX error \(not specified\)/
138+
s/ERROR: Cannot use "md5": Some PX error \(not specified\)/ERROR: Cannot use "md5": /
139+
140+
# Mask out FIPS error line numbers
141+
m/ERROR: requested functionality not allowed in FIPS mode \(pgcrypto.c:\d+\)/
142+
s/ERROR: requested functionality not allowed in FIPS mode \(pgcrypto.c:\d+\)/ERROR: requested functionality not allowed in FIPS mode (pgcrypto.c:XXX)/
143+
m/ERROR: requested functionality not allowed in FIPS mode \(openssl.c:\d+\)/
144+
s/ERROR: requested functionality not allowed in FIPS mode \(openssl.c:\d+\)/ERROR: requested functionality not allowed in FIPS mode (openssl.c:XXX)/
139145

140146
# Mask out gp_execution_segment()
141147
m/One-Time Filter: \(gp_execution_segment\(\) = \d+/

0 commit comments

Comments
 (0)