pgcrypto: remove questionmark from error message
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Fri, 6 May 2022 12:41:36 +0000 (14:41 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Fri, 6 May 2022 12:41:36 +0000 (14:41 +0200)
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

contrib/pgcrypto/expected/blowfish_1.out
contrib/pgcrypto/expected/cast5_1.out
contrib/pgcrypto/expected/des_1.out
contrib/pgcrypto/px.c

index 4d5ce1fb6e445b04ef96efd90a3acde3c36ad2f5..e52abf1d2995481c55b35db1ecfe35052fbc4def 100644 (file)
@@ -3,25 +3,25 @@
 --
 -- some standard Blowfish testvalues
 SELECT encrypt('\x0000000000000000', '\x0000000000000000', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 SELECT encrypt('\xffffffffffffffff', '\xffffffffffffffff', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 SELECT encrypt('\x1000000000000001', '\x3000000000000000', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 SELECT encrypt('\x1111111111111111', '\x1111111111111111', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 SELECT encrypt('\x01a1d6d039776742', '\xfedcba9876543210', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 SELECT encrypt('\xffffffffffffffff', '\x0000000000000000', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- setkey
 SELECT encrypt('\xfedcba9876543210', '\xf0e1d2c3b4a5968778695a4b3c2d1e0f', 'bf-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- with padding
 SELECT encrypt('\x01234567890123456789', '\x33443344334433443344334433443344', 'bf-ecb');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- cbc
 -- 28 bytes key
 SELECT encrypt('\x6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5',
@@ -40,23 +40,23 @@ SELECT encrypt('\xfedcba9876543210',
 ERROR:  encrypt error: Key was too big
 -- empty data
 select encrypt('', 'foo', 'bf');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- 10 bytes key
 select encrypt('foo', '0123456789', 'bf');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- 22 bytes key
 select encrypt('foo', '0123456789012345678901', 'bf');
 ERROR:  encrypt error: Key was too big
 -- decrypt
 select encode(decrypt(encrypt('foo', '0123456', 'bf'), '0123456', 'bf'), 'escape');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- iv
 select encrypt_iv('foo', '0123456', 'abcd', 'bf');
-ERROR:  encrypt_iv error: Cipher cannot be initialized ?
+ERROR:  encrypt_iv error: Cipher cannot be initialized
 select encode(decrypt_iv('\x95c7e89322525d59', '0123456', 'abcd', 'bf'), 'escape');
-ERROR:  decrypt_iv error: Cipher cannot be initialized ?
+ERROR:  decrypt_iv error: Cipher cannot be initialized
 -- long message
 select encrypt('Lets try a longer message.', '0123456789', 'bf');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 select encode(decrypt(encrypt('Lets try a longer message.', '0123456789', 'bf'), '0123456789', 'bf'), 'escape');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
index 5acf7e43437508d69dfe0ed1f114d854cd32ee9e..175e0b0366bbeafca97af7dadda8b723edcfe5e5 100644 (file)
@@ -4,30 +4,30 @@
 -- test vectors from RFC2144
 -- 128 bit key
 SELECT encrypt('\x0123456789ABCDEF', '\x0123456712345678234567893456789A', 'cast5-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- 80 bit key
 SELECT encrypt('\x0123456789ABCDEF', '\x01234567123456782345', 'cast5-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- 40 bit key
 SELECT encrypt('\x0123456789ABCDEF', '\x0123456712', 'cast5-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- cbc
 -- empty data
 select encrypt('', 'foo', 'cast5');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- 10 bytes key
 select encrypt('foo', '0123456789', 'cast5');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- decrypt
 select encode(decrypt(encrypt('foo', '0123456', 'cast5'), '0123456', 'cast5'), 'escape');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- iv
 select encrypt_iv('foo', '0123456', 'abcd', 'cast5');
-ERROR:  encrypt_iv error: Cipher cannot be initialized ?
+ERROR:  encrypt_iv error: Cipher cannot be initialized
 select encode(decrypt_iv('\x384a970695ce016a', '0123456', 'abcd', 'cast5'), 'escape');
-ERROR:  decrypt_iv error: Cipher cannot be initialized ?
+ERROR:  decrypt_iv error: Cipher cannot be initialized
 -- long message
 select encrypt('Lets try a longer message.', '0123456789', 'cast5');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 select encode(decrypt(encrypt('Lets try a longer message.', '0123456789', 'cast5'), '0123456789', 'cast5'), 'escape');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
index acacb38aaa61c71031e6770e13b9ee411ee04329..5a76154ee2b66cd90f5c0e18ee0c2a4ec9e08d71 100644 (file)
@@ -4,23 +4,23 @@
 -- no official test vectors atm
 -- from blowfish.sql
 SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'des-ecb/pad:none');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- empty data
 select encrypt('', 'foo', 'des');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- 8 bytes key
 select encrypt('foo', '01234589', 'des');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- decrypt
 select encode(decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des'), 'escape');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 -- iv
 select encrypt_iv('foo', '0123456', 'abcd', 'des');
-ERROR:  encrypt_iv error: Cipher cannot be initialized ?
+ERROR:  encrypt_iv error: Cipher cannot be initialized
 select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', 'des'), 'escape');
-ERROR:  decrypt_iv error: Cipher cannot be initialized ?
+ERROR:  decrypt_iv error: Cipher cannot be initialized
 -- long message
 select encrypt('Lets try a longer message.', '01234567', 'des');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
 select encode(decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'), 'escape');
-ERROR:  encrypt error: Cipher cannot be initialized ?
+ERROR:  encrypt error: Cipher cannot be initialized
index 40b6a04d526492919337f30d1621775cdee6509b..3b098c61514a41e2fb9ef19863e1ed460cf1dd57 100644 (file)
@@ -46,7 +46,7 @@ static const struct error_desc px_err_list[] = {
    {PXE_BAD_OPTION, "Unknown option"},
    {PXE_BAD_FORMAT, "Badly formatted type"},
    {PXE_KEY_TOO_BIG, "Key was too big"},
-   {PXE_CIPHER_INIT, "Cipher cannot be initialized ?"},
+   {PXE_CIPHER_INIT, "Cipher cannot be initialized"},
    {PXE_HASH_UNUSABLE_FOR_HMAC, "This hash algorithm is unusable for HMAC"},
    {PXE_BUG, "pgcrypto bug"},
    {PXE_ARGUMENT_ERROR, "Illegal argument to function"},