Skip to content

Commit ee97d46

Browse files
pgcrypto: remove questionmark from error message
The PXE_CIPHER_INIT error is used to report initialization errors, so appending a questionmark to the error isn't entirely accurate (using a space before the questionmark doubly so). Discussion: https://postgr.es/m/C89D932C-501E-4473-9750-638CFCD9095E@yesql.se
1 parent 0250a16 commit ee97d46

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

contrib/pgcrypto/expected/blowfish_1.out

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
--
44
-- some standard Blowfish testvalues
55
SELECT encrypt('\x0000000000000000', '\x0000000000000000', 'bf-ecb/pad:none');
6-
ERROR: encrypt error: Cipher cannot be initialized ?
6+
ERROR: encrypt error: Cipher cannot be initialized
77
SELECT encrypt('\xffffffffffffffff', '\xffffffffffffffff', 'bf-ecb/pad:none');
8-
ERROR: encrypt error: Cipher cannot be initialized ?
8+
ERROR: encrypt error: Cipher cannot be initialized
99
SELECT encrypt('\x1000000000000001', '\x3000000000000000', 'bf-ecb/pad:none');
10-
ERROR: encrypt error: Cipher cannot be initialized ?
10+
ERROR: encrypt error: Cipher cannot be initialized
1111
SELECT encrypt('\x1111111111111111', '\x1111111111111111', 'bf-ecb/pad:none');
12-
ERROR: encrypt error: Cipher cannot be initialized ?
12+
ERROR: encrypt error: Cipher cannot be initialized
1313
SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'bf-ecb/pad:none');
14-
ERROR: encrypt error: Cipher cannot be initialized ?
14+
ERROR: encrypt error: Cipher cannot be initialized
1515
SELECT encrypt('\x01a1d6d039776742', '\xfedcba9876543210', 'bf-ecb/pad:none');
16-
ERROR: encrypt error: Cipher cannot be initialized ?
16+
ERROR: encrypt error: Cipher cannot be initialized
1717
SELECT encrypt('\xffffffffffffffff', '\x0000000000000000', 'bf-ecb/pad:none');
18-
ERROR: encrypt error: Cipher cannot be initialized ?
18+
ERROR: encrypt error: Cipher cannot be initialized
1919
-- setkey
2020
SELECT encrypt('\xfedcba9876543210', '\xf0e1d2c3b4a5968778695a4b3c2d1e0f', 'bf-ecb/pad:none');
21-
ERROR: encrypt error: Cipher cannot be initialized ?
21+
ERROR: encrypt error: Cipher cannot be initialized
2222
-- with padding
2323
SELECT encrypt('\x01234567890123456789', '\x33443344334433443344334433443344', 'bf-ecb');
24-
ERROR: encrypt error: Cipher cannot be initialized ?
24+
ERROR: encrypt error: Cipher cannot be initialized
2525
-- cbc
2626
-- 28 bytes key
2727
SELECT encrypt('\x6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5',
@@ -40,23 +40,23 @@ SELECT encrypt('\xfedcba9876543210',
4040
ERROR: encrypt error: Key was too big
4141
-- empty data
4242
select encrypt('', 'foo', 'bf');
43-
ERROR: encrypt error: Cipher cannot be initialized ?
43+
ERROR: encrypt error: Cipher cannot be initialized
4444
-- 10 bytes key
4545
select encrypt('foo', '0123456789', 'bf');
46-
ERROR: encrypt error: Cipher cannot be initialized ?
46+
ERROR: encrypt error: Cipher cannot be initialized
4747
-- 22 bytes key
4848
select encrypt('foo', '0123456789012345678901', 'bf');
4949
ERROR: encrypt error: Key was too big
5050
-- decrypt
5151
select encode(decrypt(encrypt('foo', '0123456', 'bf'), '0123456', 'bf'), 'escape');
52-
ERROR: encrypt error: Cipher cannot be initialized ?
52+
ERROR: encrypt error: Cipher cannot be initialized
5353
-- iv
5454
select encrypt_iv('foo', '0123456', 'abcd', 'bf');
55-
ERROR: encrypt_iv error: Cipher cannot be initialized ?
55+
ERROR: encrypt_iv error: Cipher cannot be initialized
5656
select encode(decrypt_iv('\x95c7e89322525d59', '0123456', 'abcd', 'bf'), 'escape');
57-
ERROR: decrypt_iv error: Cipher cannot be initialized ?
57+
ERROR: decrypt_iv error: Cipher cannot be initialized
5858
-- long message
5959
select encrypt('Lets try a longer message.', '0123456789', 'bf');
60-
ERROR: encrypt error: Cipher cannot be initialized ?
60+
ERROR: encrypt error: Cipher cannot be initialized
6161
select encode(decrypt(encrypt('Lets try a longer message.', '0123456789', 'bf'), '0123456789', 'bf'), 'escape');
62-
ERROR: encrypt error: Cipher cannot be initialized ?
62+
ERROR: encrypt error: Cipher cannot be initialized

contrib/pgcrypto/expected/cast5_1.out

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
-- test vectors from RFC2144
55
-- 128 bit key
66
SELECT encrypt('\x0123456789ABCDEF', '\x0123456712345678234567893456789A', 'cast5-ecb/pad:none');
7-
ERROR: encrypt error: Cipher cannot be initialized ?
7+
ERROR: encrypt error: Cipher cannot be initialized
88
-- 80 bit key
99
SELECT encrypt('\x0123456789ABCDEF', '\x01234567123456782345', 'cast5-ecb/pad:none');
10-
ERROR: encrypt error: Cipher cannot be initialized ?
10+
ERROR: encrypt error: Cipher cannot be initialized
1111
-- 40 bit key
1212
SELECT encrypt('\x0123456789ABCDEF', '\x0123456712', 'cast5-ecb/pad:none');
13-
ERROR: encrypt error: Cipher cannot be initialized ?
13+
ERROR: encrypt error: Cipher cannot be initialized
1414
-- cbc
1515
-- empty data
1616
select encrypt('', 'foo', 'cast5');
17-
ERROR: encrypt error: Cipher cannot be initialized ?
17+
ERROR: encrypt error: Cipher cannot be initialized
1818
-- 10 bytes key
1919
select encrypt('foo', '0123456789', 'cast5');
20-
ERROR: encrypt error: Cipher cannot be initialized ?
20+
ERROR: encrypt error: Cipher cannot be initialized
2121
-- decrypt
2222
select encode(decrypt(encrypt('foo', '0123456', 'cast5'), '0123456', 'cast5'), 'escape');
23-
ERROR: encrypt error: Cipher cannot be initialized ?
23+
ERROR: encrypt error: Cipher cannot be initialized
2424
-- iv
2525
select encrypt_iv('foo', '0123456', 'abcd', 'cast5');
26-
ERROR: encrypt_iv error: Cipher cannot be initialized ?
26+
ERROR: encrypt_iv error: Cipher cannot be initialized
2727
select encode(decrypt_iv('\x384a970695ce016a', '0123456', 'abcd', 'cast5'), 'escape');
28-
ERROR: decrypt_iv error: Cipher cannot be initialized ?
28+
ERROR: decrypt_iv error: Cipher cannot be initialized
2929
-- long message
3030
select encrypt('Lets try a longer message.', '0123456789', 'cast5');
31-
ERROR: encrypt error: Cipher cannot be initialized ?
31+
ERROR: encrypt error: Cipher cannot be initialized
3232
select encode(decrypt(encrypt('Lets try a longer message.', '0123456789', 'cast5'), '0123456789', 'cast5'), 'escape');
33-
ERROR: encrypt error: Cipher cannot be initialized ?
33+
ERROR: encrypt error: Cipher cannot be initialized

contrib/pgcrypto/expected/des_1.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
-- no official test vectors atm
55
-- from blowfish.sql
66
SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'des-ecb/pad:none');
7-
ERROR: encrypt error: Cipher cannot be initialized ?
7+
ERROR: encrypt error: Cipher cannot be initialized
88
-- empty data
99
select encrypt('', 'foo', 'des');
10-
ERROR: encrypt error: Cipher cannot be initialized ?
10+
ERROR: encrypt error: Cipher cannot be initialized
1111
-- 8 bytes key
1212
select encrypt('foo', '01234589', 'des');
13-
ERROR: encrypt error: Cipher cannot be initialized ?
13+
ERROR: encrypt error: Cipher cannot be initialized
1414
-- decrypt
1515
select encode(decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des'), 'escape');
16-
ERROR: encrypt error: Cipher cannot be initialized ?
16+
ERROR: encrypt error: Cipher cannot be initialized
1717
-- iv
1818
select encrypt_iv('foo', '0123456', 'abcd', 'des');
19-
ERROR: encrypt_iv error: Cipher cannot be initialized ?
19+
ERROR: encrypt_iv error: Cipher cannot be initialized
2020
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', 'des'), 'escape');
21-
ERROR: decrypt_iv error: Cipher cannot be initialized ?
21+
ERROR: decrypt_iv error: Cipher cannot be initialized
2222
-- long message
2323
select encrypt('Lets try a longer message.', '01234567', 'des');
24-
ERROR: encrypt error: Cipher cannot be initialized ?
24+
ERROR: encrypt error: Cipher cannot be initialized
2525
select encode(decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'), 'escape');
26-
ERROR: encrypt error: Cipher cannot be initialized ?
26+
ERROR: encrypt error: Cipher cannot be initialized

contrib/pgcrypto/px.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static const struct error_desc px_err_list[] = {
4646
{PXE_BAD_OPTION, "Unknown option"},
4747
{PXE_BAD_FORMAT, "Badly formatted type"},
4848
{PXE_KEY_TOO_BIG, "Key was too big"},
49-
{PXE_CIPHER_INIT, "Cipher cannot be initialized ?"},
49+
{PXE_CIPHER_INIT, "Cipher cannot be initialized"},
5050
{PXE_HASH_UNUSABLE_FOR_HMAC, "This hash algorithm is unusable for HMAC"},
5151
{PXE_BUG, "pgcrypto bug"},
5252
{PXE_ARGUMENT_ERROR, "Illegal argument to function"},

0 commit comments

Comments
 (0)