postgresql/contrib/pgcrypto/expected/3des_1.out
Peter Eisentraut 795592865c pgcrypto: Allow tests to pass in OpenSSL FIPS mode
This adds several alternative expected files for when MD5 and 3DES are
not available.  This is similar to the alternative expected files for
when the legacy provider is disabled.  In fact, running the pgcrypto
tests in FIPS mode makes use of some of these existing alternative
expected files as well (e.g., for blowfish).

These new expected files currently cover the FIPS mode provided by
OpenSSL 3.x as well as the modified OpenSSL 3.x from Red Hat (e.g.,
Fedora 38), but not the modified OpenSSL 1.x from Red Hat (e.g.,
Fedora 35).  (The latter will have some error message wording
differences.)

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/dbbd927f-ef1f-c9a1-4ec6-c759778ac852%40enterprisedb.com
2023-11-17 14:55:51 +01:00

30 lines
1.3 KiB
Plaintext

--
-- 3DES cipher
--
-- test vector from somewhere
SELECT encrypt('\x8000000000000000',
'\x010101010101010101010101010101010101010101010101',
'3des-ecb/pad:none');
ERROR: encrypt error: Cipher cannot be initialized
select encrypt('', 'foo', '3des');
ERROR: encrypt error: Cipher cannot be initialized
-- 10 bytes key
select encrypt('foo', '0123456789', '3des');
ERROR: encrypt error: Cipher cannot be initialized
-- 22 bytes key
select encrypt('foo', '0123456789012345678901', '3des');
ERROR: encrypt error: Cipher cannot be initialized
-- decrypt
select encode(decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des'), 'escape');
ERROR: encrypt error: Cipher cannot be initialized
-- iv
select encrypt_iv('foo', '0123456', 'abcd', '3des');
ERROR: encrypt_iv error: Cipher cannot be initialized
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', '3des'), 'escape');
ERROR: decrypt_iv error: Cipher cannot be initialized
-- long message
select encrypt('Lets try a longer message.', '0123456789012345678901', '3des');
ERROR: encrypt error: Cipher cannot be initialized
select encode(decrypt(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), '0123456789012345678901', '3des'), 'escape');
ERROR: encrypt error: Cipher cannot be initialized