From 48eb937e098ddba4eb799c9f3ffe95115d4a081d Mon Sep 17 00:00:00 2001 From: mrdrivingduck Date: Sat, 9 Mar 2024 22:31:40 +0800 Subject: [PATCH 1/8] feat: apdat to openssl-devel --- src/backend/storage/encryption/enc_cipher.c | 6 ++++++ src/backend/storage/encryption/enc_openssl.c | 2 ++ src/backend/utils/misc/guc.c | 2 ++ src/bin/initdb/initdb.c | 4 ++++ src/include/storage/enc_common.h | 2 ++ 5 files changed, 16 insertions(+) diff --git a/src/backend/storage/encryption/enc_cipher.c b/src/backend/storage/encryption/enc_cipher.c index c7a41c75406..76b0a0eee45 100644 --- a/src/backend/storage/encryption/enc_cipher.c +++ b/src/backend/storage/encryption/enc_cipher.c @@ -107,9 +107,11 @@ EncryptionCipherValue(const char *name) return TDE_ENCRYPTION_AES_128; else if (strcmp(name, "aes-256") == 0) return TDE_ENCRYPTION_AES_256; +#if OPENSSL_VERSION_NUMBER >= 0x10101000L #ifndef OPENSSL_NO_SM4 else if(strcmp(name, "sm4") == 0) return TDE_ENCRYPTION_SM4; +#endif #endif else /*no cover line*/ @@ -128,9 +130,11 @@ EncryptionCipherString(int value) return "aes-128"; case TDE_ENCRYPTION_AES_256: return "aes-256"; +#if OPENSSL_VERSION_NUMBER >= 0x10101000L #ifndef OPENSSL_NO_SM4 case TDE_ENCRYPTION_SM4: return "sm4"; +#endif #endif /*no cover begin*/ default: @@ -149,8 +153,10 @@ assign_data_encryption_cipher(int new_encryption_cipher, void *extra) EncryptionKeySize = 0; break; case TDE_ENCRYPTION_AES_128: +#if OPENSSL_VERSION_NUMBER >= 0x10101000L #ifndef OPENSSL_NO_SM4 case TDE_ENCRYPTION_SM4: +#endif #endif EncryptionKeySize = 16; break; diff --git a/src/backend/storage/encryption/enc_openssl.c b/src/backend/storage/encryption/enc_openssl.c index 3bcdc757226..3232ceb8912 100644 --- a/src/backend/storage/encryption/enc_openssl.c +++ b/src/backend/storage/encryption/enc_openssl.c @@ -43,9 +43,11 @@ ossl_EVP_cipher_func cipher_func_table[] = { EVP_aes_128_ctr, /* TDE_ENCRYPTION_AES_128 */ EVP_aes_256_ctr, /* TDE_ENCRYPTION_AES_256 */ +#if OPENSSL_VERSION_NUMBER >= 0x10101000L #ifndef OPENSSL_NO_SM4 EVP_sm4_ctr /*polar support sm4 TDE_ENCRYPTION_SM4*/ #endif +#endif }; typedef struct CipherCtx diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 779b864200f..786fe61002a 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -612,8 +612,10 @@ const struct config_enum_entry data_encryption_cipher_options[] = { {"off", TDE_ENCRYPTION_OFF, false}, {"aes-128", TDE_ENCRYPTION_AES_128, false}, {"aes-256", TDE_ENCRYPTION_AES_256, false}, +#if OPENSSL_VERSION_NUMBER >= 0x10101000L #ifndef OPENSSL_NO_SM4 {"sm4", TDE_ENCRYPTION_SM4, false}, +#endif #endif {NULL, 0, false} }; diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 66a3e220df7..0cd0d95f39b 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -117,7 +117,11 @@ static const char *const encryption_ciphers[] = { "none", "aes-128", "aes-256", +#if OPENSSL_VERSION_NUMBER >= 0x10101000L +#ifndef OPENSSL_NO_SM4 "sm4", +#endif +#endif NULL }; diff --git a/src/include/storage/enc_common.h b/src/include/storage/enc_common.h index 5a207b1043f..8449305e70a 100644 --- a/src/include/storage/enc_common.h +++ b/src/include/storage/enc_common.h @@ -18,9 +18,11 @@ enum database_encryption_cipher_kind TDE_ENCRYPTION_OFF = 0, TDE_ENCRYPTION_AES_128, TDE_ENCRYPTION_AES_256, +#if OPENSSL_VERSION_NUMBER >= 0x10101000L #ifndef OPENSSL_NO_SM4 TDE_ENCRYPTION_SM4 #endif +#endif }; /* GUC parameter */ From db0ccf27fae0b5c22c85fa357b33f433eac98f71 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Sat, 25 Sep 2021 11:25:48 +0200 Subject: [PATCH 2/8] pgcrypto: Check for error return of px_cipher_decrypt() This has previously not been a problem (that anyone ever reported), but in future OpenSSL versions (3.0.0), where legacy ciphers are/can be disabled, this is the place where this is reported. So we need to catch the error here, otherwise the higher-level functions would return garbage. The nearby encryption code already handled errors similarly. Author: Peter Eisentraut Reviewed-by: Daniel Gustafsson Discussion: https://www.postgresql.org/message-id/9e9c431c-0adc-7a6d-9b1a-915de1ba3fe7@enterprisedb.com Backpatch-through: 9.6 --- contrib/pgcrypto/px.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/pgcrypto/px.c b/contrib/pgcrypto/px.c index aea8e863af0..f26683aa11b 100644 --- a/contrib/pgcrypto/px.c +++ b/contrib/pgcrypto/px.c @@ -300,6 +300,7 @@ static int combo_decrypt(PX_Combo *cx, const uint8 *data, unsigned dlen, uint8 *res, unsigned *rlen) { + int err = 0; unsigned bs, i, pad; @@ -325,7 +326,9 @@ combo_decrypt(PX_Combo *cx, const uint8 *data, unsigned dlen, /* decrypt */ *rlen = dlen; - px_cipher_decrypt(c, data, dlen, res); + err = px_cipher_decrypt(c, data, dlen, res); + if (err) + return err; /* unpad */ if (bs > 1 && cx->padding) From c5c068996d541ba01b44d8b4f72b81a9659c3d92 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Sat, 25 Sep 2021 11:27:20 +0200 Subject: [PATCH 3/8] Disable OpenSSL EVP digest padding in pgcrypto The PX layer in pgcrypto is handling digest padding on its own uniformly for all backend implementations. Starting with OpenSSL 3.0.0, DecryptUpdate doesn't flush the last block in case padding is enabled so explicitly disable it as we don't use it. This will be backpatched to all supported version once there is sufficient testing in the buildfarm of OpenSSL 3. Reviewed-by: Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/FEF81714-D479-4512-839B-C769D2605F8A@yesql.se Backpatch-through: 9.6 --- contrib/pgcrypto/openssl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index 7d686f39402..e0b37352e63 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -368,6 +368,8 @@ gen_ossl_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, { if (!EVP_DecryptInit_ex(od->evp_ctx, od->evp_ciph, NULL, NULL, NULL)) return PXE_CIPHER_INIT; + if (!EVP_CIPHER_CTX_set_padding(od->evp_ctx, 0)) + return PXE_CIPHER_INIT; if (!EVP_CIPHER_CTX_set_key_length(od->evp_ctx, od->klen)) return PXE_CIPHER_INIT; if (!EVP_DecryptInit_ex(od->evp_ctx, NULL, NULL, od->key, od->iv)) @@ -392,6 +394,8 @@ gen_ossl_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, { if (!EVP_EncryptInit_ex(od->evp_ctx, od->evp_ciph, NULL, NULL, NULL)) return PXE_CIPHER_INIT; + if (!EVP_CIPHER_CTX_set_padding(od->evp_ctx, 0)) + return PXE_CIPHER_INIT; if (!EVP_CIPHER_CTX_set_key_length(od->evp_ctx, od->klen)) return PXE_CIPHER_INIT; if (!EVP_EncryptInit_ex(od->evp_ctx, NULL, NULL, od->key, od->iv)) From 96153fc858c684f791cdc48b74c926067fd7da41 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Sat, 25 Sep 2021 11:27:28 +0200 Subject: [PATCH 4/8] Add alternative output for OpenSSL 3 without legacy loaded OpenSSL 3 introduced the concept of providers to support modularization, and moved the outdated ciphers to the new legacy provider. In case it's not loaded in the users openssl.cnf file there will be a lot of regress test failures, so add alternative outputs covering those. Also document the need to load the legacy provider in order to use older ciphers with OpenSSL-enabled pgcrypto. This will be backpatched to all supported version once there is sufficient testing in the buildfarm of OpenSSL 3. Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/FEF81714-D479-4512-839B-C769D2605F8A@yesql.se Backpatch-through: 9.6 --- contrib/pgcrypto/expected/blowfish_1.out | 95 +++ contrib/pgcrypto/expected/cast5_1.out | 48 ++ contrib/pgcrypto/expected/des_1.out | 31 + contrib/pgcrypto/expected/pgp-decrypt_2.out | 421 +++++++++++ .../expected/pgp-pubkey-decrypt_1.out | 652 ++++++++++++++++++ doc/src/sgml/pgcrypto.sgml | 7 + 6 files changed, 1254 insertions(+) create mode 100644 contrib/pgcrypto/expected/blowfish_1.out create mode 100644 contrib/pgcrypto/expected/cast5_1.out create mode 100644 contrib/pgcrypto/expected/des_1.out create mode 100644 contrib/pgcrypto/expected/pgp-decrypt_2.out create mode 100644 contrib/pgcrypto/expected/pgp-pubkey-decrypt_1.out diff --git a/contrib/pgcrypto/expected/blowfish_1.out b/contrib/pgcrypto/expected/blowfish_1.out new file mode 100644 index 00000000000..565a0853cb0 --- /dev/null +++ b/contrib/pgcrypto/expected/blowfish_1.out @@ -0,0 +1,95 @@ +-- +-- Blowfish cipher +-- +-- ensure consistent test output regardless of the default bytea format +SET bytea_output TO escape; +-- some standard Blowfish testvalues +SELECT encode(encrypt( +decode('0000000000000000', 'hex'), +decode('0000000000000000', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +SELECT encode(encrypt( +decode('ffffffffffffffff', 'hex'), +decode('ffffffffffffffff', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +SELECT encode(encrypt( +decode('1000000000000001', 'hex'), +decode('3000000000000000', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +SELECT encode(encrypt( +decode('1111111111111111', 'hex'), +decode('1111111111111111', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +SELECT encode(encrypt( +decode('0123456789abcdef', 'hex'), +decode('fedcba9876543210', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +SELECT encode(encrypt( +decode('01a1d6d039776742', 'hex'), +decode('fedcba9876543210', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +SELECT encode(encrypt( +decode('ffffffffffffffff', 'hex'), +decode('0000000000000000', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- setkey +SELECT encode(encrypt( +decode('fedcba9876543210', 'hex'), +decode('f0e1d2c3b4a5968778695a4b3c2d1e0f', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- with padding +SELECT encode(encrypt( +decode('01234567890123456789', 'hex'), +decode('33443344334433443344334433443344', 'hex'), +'bf-ecb'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- cbc +-- 28 bytes key +SELECT encode(encrypt( +decode('6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5', 'hex'), +decode('37363534333231204e6f77206973207468652074696d6520666f7220', 'hex'), +'bf-cbc'), 'hex'); +ERROR: encrypt error: Key was too big +-- 29 bytes key +SELECT encode(encrypt( +decode('6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc', 'hex'), +decode('37363534333231204e6f77206973207468652074696d6520666f722000', 'hex'), +'bf-cbc'), 'hex'); +ERROR: encrypt error: Key was too big +-- blowfish-448 +SELECT encode(encrypt( +decode('fedcba9876543210', 'hex'), +decode('f0e1d2c3b4a5968778695a4b3c2d1e0f001122334455667704689104c2fd3b2f584023641aba61761f1f1f1f0e0e0e0effffffffffffffff', 'hex'), +'bf-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Key was too big +-- result: c04504012e4e1f53 +-- empty data +select encode(encrypt('', 'foo', 'bf'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- 10 bytes key +select encode(encrypt('foo', '0123456789', 'bf'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- 22 bytes key +select encode(encrypt('foo', '0123456789012345678901', 'bf'), 'hex'); +ERROR: encrypt error: Key was too big +-- decrypt +select decrypt(encrypt('foo', '0123456', 'bf'), '0123456', 'bf'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- iv +select encode(encrypt_iv('foo', '0123456', 'abcd', 'bf'), 'hex'); +ERROR: encrypt_iv error: Cipher cannot be initialized ? +select decrypt_iv(decode('95c7e89322525d59', 'hex'), '0123456', 'abcd', 'bf'); +ERROR: decrypt_iv error: Cipher cannot be initialized ? +-- long message +select encode(encrypt('Lets try a longer message.', '0123456789', 'bf'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +select decrypt(encrypt('Lets try a longer message.', '0123456789', 'bf'), '0123456789', 'bf'); +ERROR: encrypt error: Cipher cannot be initialized ? diff --git a/contrib/pgcrypto/expected/cast5_1.out b/contrib/pgcrypto/expected/cast5_1.out new file mode 100644 index 00000000000..e3b38dbce2f --- /dev/null +++ b/contrib/pgcrypto/expected/cast5_1.out @@ -0,0 +1,48 @@ +-- +-- Cast5 cipher +-- +-- ensure consistent test output regardless of the default bytea format +SET bytea_output TO escape; +-- test vectors from RFC2144 +-- 128 bit key +SELECT encode(encrypt( +decode('01 23 45 67 89 AB CD EF', 'hex'), +decode('01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A', 'hex'), +'cast5-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- result: 23 8B 4F E5 84 7E 44 B2 +-- 80 bit key +SELECT encode(encrypt( +decode('01 23 45 67 89 AB CD EF', 'hex'), +decode('01 23 45 67 12 34 56 78 23 45', 'hex'), +'cast5-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- result: EB 6A 71 1A 2C 02 27 1B +-- 40 bit key +SELECT encode(encrypt( +decode('01 23 45 67 89 AB CD EF', 'hex'), +decode('01 23 45 67 12', 'hex'), +'cast5-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- result: 7A C8 16 D1 6E 9B 30 2E +-- cbc +-- empty data +select encode( encrypt('', 'foo', 'cast5'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- 10 bytes key +select encode( encrypt('foo', '0123456789', 'cast5'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- decrypt +select decrypt(encrypt('foo', '0123456', 'cast5'), '0123456', 'cast5'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- iv +select encode(encrypt_iv('foo', '0123456', 'abcd', 'cast5'), 'hex'); +ERROR: encrypt_iv error: Cipher cannot be initialized ? +select decrypt_iv(decode('384a970695ce016a', 'hex'), + '0123456', 'abcd', 'cast5'); +ERROR: decrypt_iv error: Cipher cannot be initialized ? +-- long message +select encode(encrypt('Lets try a longer message.', '0123456789', 'cast5'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +select decrypt(encrypt('Lets try a longer message.', '0123456789', 'cast5'), '0123456789', 'cast5'); +ERROR: encrypt error: Cipher cannot be initialized ? diff --git a/contrib/pgcrypto/expected/des_1.out b/contrib/pgcrypto/expected/des_1.out new file mode 100644 index 00000000000..e8cca0505fe --- /dev/null +++ b/contrib/pgcrypto/expected/des_1.out @@ -0,0 +1,31 @@ +-- +-- DES cipher +-- +-- ensure consistent test output regardless of the default bytea format +SET bytea_output TO escape; +-- no official test vectors atm +-- from blowfish.sql +SELECT encode(encrypt( +decode('0123456789abcdef', 'hex'), +decode('fedcba9876543210', 'hex'), +'des-ecb/pad:none'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- empty data +select encode( encrypt('', 'foo', 'des'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- 8 bytes key +select encode( encrypt('foo', '01234589', 'des'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- decrypt +select decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des'); +ERROR: encrypt error: Cipher cannot be initialized ? +-- iv +select encode(encrypt_iv('foo', '0123456', 'abcd', 'des'), 'hex'); +ERROR: encrypt_iv error: Cipher cannot be initialized ? +select decrypt_iv(decode('50735067b073bb93', 'hex'), '0123456', 'abcd', 'des'); +ERROR: decrypt_iv error: Cipher cannot be initialized ? +-- long message +select encode(encrypt('Lets try a longer message.', '01234567', 'des'), 'hex'); +ERROR: encrypt error: Cipher cannot be initialized ? +select decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'); +ERROR: encrypt error: Cipher cannot be initialized ? diff --git a/contrib/pgcrypto/expected/pgp-decrypt_2.out b/contrib/pgcrypto/expected/pgp-decrypt_2.out new file mode 100644 index 00000000000..c1195a8e697 --- /dev/null +++ b/contrib/pgcrypto/expected/pgp-decrypt_2.out @@ -0,0 +1,421 @@ +-- +-- pgp_descrypt tests +-- +-- Checking ciphers +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.blowfish.sha1.mdc.s2k3.z0 + +jA0EBAMCfFNwxnvodX9g0jwB4n4s26/g5VmKzVab1bX1SmwY7gvgvlWdF3jKisvS +yA6Ce1QTMK3KdL2MPfamsTUSAML8huCJMwYQFfE= +=JcP+ +-----END PGP MESSAGE----- +'), 'foobar'); +ERROR: Wrong key or corrupt data +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCci97v0Q6Z0Zg0kQBsVf5Oe3iC+FBzUmuMV9KxmAyOMyjCc/5i8f1Eest +UTAsG35A1vYs02VARKzGz6xI2UHwFUirP+brPBg3Ee7muOx8pA== +=XtrP +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes192.sha1.mdc.s2k3.z0 + +jA0ECAMCI7YQpWqp3D1g0kQBCjB7GlX7+SQeXNleXeXQ78ZAPNliquGDq9u378zI +5FPTqAhIB2/2fjY8QEIs1ai00qphjX2NitxV/3Wn+6dufB4Q4g== +=rCZt +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes256.sha1.mdc.s2k3.z0 + +jA0ECQMC4f/5djqCC1Rg0kQBTHEPsD+Sw7biBsM2er3vKyGPAQkuTBGKC5ie7hT/ +lceMfQdbAg6oTFyJpk/wH18GzRDphCofg0X8uLgkAKMrpcmgog== +=fB6S +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +-- Checking MDC modes +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.nomdc.s2k3.z0 + +jA0EBwMCnv07rlXqWctgyS2Dm2JfOKCRL4sLSLJUC8RS2cH7cIhKSuLitOtyquB+ +u9YkgfJfsuRJmgQ9tmo= +=60ui +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCEeP3idNjQ1Bg0kQBf4G0wX+2QNzLh2YNwYkQgQkfYhn/hLXjV4nK9nsE +8Ex1Dsdt5UPvOz8W8VKQRS6loOfOe+yyXil8W3IYFwUpdDUi+Q== +=moGf +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +-- Checking hashes +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.md5.mdc.s2k3.z0 + +jA0EBwMClrXXtOXetohg0kQBn0Kl1ymevQZRHkdoYRHgzCwSQEiss7zYff2UNzgO +KyRrHf7zEBuZiZ2AG34jNVMOLToj1jJUg5zTSdecUzQVCykWTA== +=NyLk +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCApbdlrURoWJg0kQBzHM/E0o7djY82bNuspjxjAcPFrrtp0uvDdMQ4z2m +/PM8jhgI5vxFYfNQjLl8y3fHYIomk9YflN9K/Q13iq8A8sjeTw== +=FxbQ +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +-- Checking S2K modes +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k0.z0 + +jAQEBwAC0kQBKTaLAKE3xzps+QIZowqRNb2eAdzBw2LxEW2YD5PgNlbhJdGg+dvw +Ah9GXjGS1TVALzTImJbz1uHUZRfhJlFbc5yGQw== +=YvkV +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k1.z0 + +jAwEBwEC/QTByBLI3b/SRAHPxKzI6SZBo5lAEOD+EsvKQWO4adL9tDY+++Iqy1xK +4IaWXVKEj9R2Lr2xntWWMGZtcKtjD2lFFRXXd9dZp1ZThNDz +=dbXm +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCEq4Su3ZqNEJg0kQB4QG5jBTKF0i04xtH+avzmLhstBNRxvV3nsmB3cwl +z+9ZaA/XdSx5ZiFnMym8P6r8uY9rLjjNptvvRHlxIReF+p9MNg== +=VJKg +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes192.sha1.mdc.s2k0.z0 + +jAQECAAC0kQBBDnQWkgsx9YFaqDfWmpsiyAJ6y2xG/sBvap1dySYEMuZ+wJTXQ9E +Cr3i2M7TgVZ0M4jp4QL0adG1lpN5iK7aQeOwMw== +=cg+i +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes192.sha1.mdc.s2k1.z0 + +jAwECAECruOfyNDFiTnSRAEVoGXm4A9UZKkWljdzjEO/iaE7mIraltIpQMkiqCh9 +7h8uZ2u9uRBOv222fZodGvc6bvq/4R4hAa/6qSHtm8mdmvGt +=aHmC +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes192.sha1.mdc.s2k3.z0 + +jA0ECAMCjFn6SRi3SONg0kQBqtSHPaD0m7rXfDAhCWU/ypAsI93GuHGRyM99cvMv +q6eF6859ZVnli3BFSDSk3a4e/pXhglxmDYCfjAXkozKNYLo6yw== +=K0LS +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes256.sha1.mdc.s2k0.z0 + +jAQECQAC0kQB4L1eMbani07XF2ZYiXNK9LW3v8w41oUPl7dStmrJPQFwsdxmrDHu +rQr3WbdKdY9ufjOE5+mXI+EFkSPrF9rL9NCq6w== +=RGts +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes256.sha1.mdc.s2k1.z0 + +jAwECQECKHhrou7ZOIXSRAHWIVP+xjVQcjAVBTt+qh9SNzYe248xFTwozkwev3mO ++KVJW0qhk0An+Y2KF99/bYFl9cL5D3Tl43fC8fXGl3x3m7pR +=SUrU +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes256.sha1.mdc.s2k3.z0 + +jA0ECQMCjc8lwZu8Fz1g0kQBkEzjImi21liep5jj+3dAJ2aZFfUkohi8b3n9z+7+ +4+NRzL7cMW2RLAFnJbiqXDlRHMwleeuLN1up2WIxsxtYYuaBjA== +=XZrG +-----END PGP MESSAGE----- +'), 'foobar'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +-- Checking longer passwords +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCx6dBiuqrYNRg0kQBEo63AvA1SCslxP7ayanLf1H0/hlk2nONVhTwVEWi +tTGup1mMz6Cfh1uDRErUuXpx9A0gdMu7zX0o5XjrL7WGDAZdSw== +=XKKG +-----END PGP MESSAGE----- +'), '0123456789abcdefghij'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCBDvYuS990iFg0kQBW31UK5OiCjWf5x6KJ8qNNT2HZWQCjCBZMU0XsOC6 +CMxFKadf144H/vpoV9GA0f22keQgCl0EsTE4V4lweVOPTKCMJg== +=gWDh +-----END PGP MESSAGE----- +'), '0123456789abcdefghij2jk4h5g2j54khg23h54g2kh54g2khj54g23hj54'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCqXbFafC+ofVg0kQBejyiPqH0QMERVGfmPOjtAxvyG5KDIJPYojTgVSDt +FwsDabdQUz5O7bgNSnxfmyw1OifGF+W2bIn/8W+0rDf8u3+O+Q== +=OxOF +-----END PGP MESSAGE----- +'), 'x'); + pgp_sym_decrypt +----------------- + Secret message. +(1 row) + +-- Checking various data +select encode(digest(pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat1.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCGJ+SpuOysINg0kQBJfSjzsW0x4OVcAyr17O7FBvMTwIGeGcJd99oTQU8 +Xtx3kDqnhUq9Z1fS3qPbi5iNP2A9NxOBxPWz2JzxhydANlgbxg== +=W/ik +-----END PGP MESSAGE----- +'), '0123456789abcdefghij'), 'sha1'), 'hex'); + encode +------------------------------------------ + 0225e3ede6f2587b076d021a189ff60aad67e066 +(1 row) + +-- expected: 0225e3ede6f2587b076d021a189ff60aad67e066 +select encode(digest(pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat2.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCvdpDvidNzMxg0jUBvj8eS2+1t/9/zgemxvhtc0fvdKGGbjH7dleaTJRB +SaV9L04ky1qECNDx3XjnoKLC+H7IOQ== +=Fxen +-----END PGP MESSAGE----- +'), '0123456789abcdefghij'), 'sha1'), 'hex'); + encode +------------------------------------------ + da39a3ee5e6b4b0d3255bfef95601890afd80709 +(1 row) + +-- expected: da39a3ee5e6b4b0d3255bfef95601890afd80709 +select encode(digest(pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: dat3.aes.sha1.mdc.s2k3.z0 + +jA0EBwMCxQvxJZ3G/HRg0lgBeYmTa7/uDAjPyFwSX4CYBgpZWVn/JS8JzILrcWF8 +gFnkUKIE0PSaYFp+Yi1VlRfUtRQ/X/LYNGa7tWZS+4VQajz2Xtz4vUeAEiYFYPXk +73Hb8m1yRhQK +=ivrD +-----END PGP MESSAGE----- +'), '0123456789abcdefghij'), 'sha1'), 'hex'); + encode +------------------------------------------ + 5e5c135efc0dd00633efc6dfd6e731ea408a5b4c +(1 row) + +-- expected: 5e5c135efc0dd00633efc6dfd6e731ea408a5b4c +-- Checking CRLF +select encode(digest(pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: crlf mess + +ww0ECQMCt7VAtby6l4Bi0lgB5KMIZiiF/b3CfMfUyY0eDncsGXtkbu1X+l9brjpMP8eJnY79Amms +a3nsOzKTXUfS9VyaXo8IrncM6n7fdaXpwba/3tNsAhJG4lDv1k4g9v8Ix2dfv6Rs +=mBP9 +-----END PGP MESSAGE----- +'), 'key', 'convert-crlf=0'), 'sha1'), 'hex'); + encode +------------------------------------------ + 9353062be7720f1446d30b9e75573a4833886784 +(1 row) + +-- expected: 9353062be7720f1446d30b9e75573a4833886784 +select encode(digest(pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- +Comment: crlf mess + +ww0ECQMCt7VAtby6l4Bi0lgB5KMIZiiF/b3CfMfUyY0eDncsGXtkbu1X+l9brjpMP8eJnY79Amms +a3nsOzKTXUfS9VyaXo8IrncM6n7fdaXpwba/3tNsAhJG4lDv1k4g9v8Ix2dfv6Rs +=mBP9 +-----END PGP MESSAGE----- +'), 'key', 'convert-crlf=1'), 'sha1'), 'hex'); + encode +------------------------------------------ + 7efefcab38467f7484d6fa43dc86cf5281bd78e2 +(1 row) + +-- expected: 7efefcab38467f7484d6fa43dc86cf5281bd78e2 +-- check BUG #11905, problem with messages 6 less than a power of 2. +select pgp_sym_decrypt(pgp_sym_encrypt(repeat('x',65530),'1'),'1') = repeat('x',65530); + ?column? +---------- + t +(1 row) + +-- expected: true +-- Negative tests +-- Decryption with a certain incorrect key yields an apparent Literal Data +-- packet reporting its content to be binary data. Ciphertext source: +-- iterative pgp_sym_encrypt('secret', 'key') until the random prefix gave +-- rise to that property. +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- + +ww0EBwMCxf8PTrQBmJdl0jcB6y2joE7GSLKRv7trbNsF5Z8ou5NISLUg31llVH/S0B2wl4bvzZjV +VsxxqLSPzNLAeIspJk5G +=mSd/ +-----END PGP MESSAGE----- +'), 'wrong-key', 'debug=1'); +NOTICE: dbg: prefix_init: corrupt prefix +NOTICE: dbg: parse_literal_data: data type=b +NOTICE: dbg: mdcbuf_finish: bad MDC pkt hdr +ERROR: Wrong key or corrupt data +-- Routine text/binary mismatch. +select pgp_sym_decrypt(pgp_sym_encrypt_bytea('P', 'key'), 'key', 'debug=1'); +NOTICE: dbg: parse_literal_data: data type=b +ERROR: Not text data +-- Decryption with a certain incorrect key yields an apparent BZip2-compressed +-- plaintext. Ciphertext source: iterative pgp_sym_encrypt('secret', 'key') +-- until the random prefix gave rise to that property. +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- + +ww0EBwMC9rK/dMkF5Zlt0jcBlzAQ1mQY2qYbKYbw8h3EZ5Jk0K2IiY92R82TRhWzBIF/8cmXDPtP +GXsd65oYJZp3Khz0qfyn +=Nmpq +-----END PGP MESSAGE----- +'), 'wrong-key', 'debug=1'); +NOTICE: dbg: prefix_init: corrupt prefix +NOTICE: dbg: parse_compressed_data: bzip2 unsupported +NOTICE: dbg: mdcbuf_finish: bad MDC pkt hdr +ERROR: Wrong key or corrupt data +-- Routine use of BZip2 compression. Ciphertext source: +-- echo x | gpg --homedir /nonexistent --personal-compress-preferences bzip2 \ +-- --personal-cipher-preferences aes --no-emit-version --batch \ +-- --symmetric --passphrase key --armor +select pgp_sym_decrypt(dearmor(' +-----BEGIN PGP MESSAGE----- + +jA0EBwMCRhFrAKNcLVJg0mMBLJG1cCASNk/x/3dt1zJ+2eo7jHfjgg3N6wpB3XIe +QCwkWJwlBG5pzbO5gu7xuPQN+TbPJ7aQ2sLx3bAHhtYb0i3vV9RO10Gw++yUyd4R +UCAAw2JRIISttRHMfDpDuZJpvYo= +=AZ9M +-----END PGP MESSAGE----- +'), 'key', 'debug=1'); +NOTICE: dbg: parse_compressed_data: bzip2 unsupported +ERROR: Unsupported compression algorithm diff --git a/contrib/pgcrypto/expected/pgp-pubkey-decrypt_1.out b/contrib/pgcrypto/expected/pgp-pubkey-decrypt_1.out new file mode 100644 index 00000000000..f41c6c9893a --- /dev/null +++ b/contrib/pgcrypto/expected/pgp-pubkey-decrypt_1.out @@ -0,0 +1,652 @@ +-- +-- PGP Public Key Encryption +-- +-- As most of the low-level stuff is tested in symmetric key +-- tests, here's only public-key specific tests +create table keytbl ( + id int4, + name text, + pubkey text, + seckey text +); +create table encdata ( + id int4, + data text +); +insert into keytbl (id, name, pubkey, seckey) +values (1, 'elg1024', ' +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +mQGiBELIIUgRBACp401L6jXrLB28c3YA4sM3OJKnxM1GT9YTkWyE3Vyte65H8WU9 +tGPBX7OMuaX5eGZ84LFUGvaP0k7anfmXcDkCO3P9GgL+ro/dS2Ps/vChQPZqHaxE +xpKDUt47B7DGdRJrC8DRnIR4wbSyQA6ma3S1yFqC5pJhSs+mqf9eExOjiwCgntth +klRxIYw352ZX9Ov9oht/p/ED/1Xi4PS+tkXVvyIw5aZfa61bT6XvDkoPI0Aj3GE5 +YmCHJlKA/IhEr8QJOLV++5VEv4l6KQ1/DFoJzoNdr1AGJukgTc6X/WcQRzfQtUic +PHQme5oAWoHa6bVQZOwvbJh3mOXDq/Tk/KF22go8maM44vMn4bvv+SBbslviYLiL +jZJ1A/9JXF1esNq+X9HehJyqHHU7LEEf/ck6zC7o2erM3/LZlZuLNPD2cv3oL3Nv +saEgcTSZl+8XmO8pLmzjKIb+hi70qVx3t2IhMqbb4B/dMY1Ck62gPBKa81/Wwi7v +IsEBQLEtyBmGmI64YpzoRNFeaaF9JY+sAKqROqe6dLjJ7vebQLQfRWxnYW1hbCAx +MDI0IDx0ZXN0QGV4YW1wbGUub3JnPoheBBMRAgAeBQJCyCFIAhsDBgsJCAcDAgMV +AgMDFgIBAh4BAheAAAoJEBwpvA0YF3NkOtsAniI9W2bC3CxARTpYrev7ihreDzFc +AJ9WYLQxDQAi5Ec9AQoodPkI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MY1Ck62gPBKa81/Wwi7v +IsEBQLEtyBmGmI64YpzoRNFeaaF9JY+sAKqROqe6dLjJ7vebQAAAnj4i4st+s+C6 +WKTIDcL1Iy0Saq8lCp60H0VsZ2FtYWwgMTAyNCA8dGVzdEBleGFtcGxlLm9yZz6I +XgQTEQIAHgUCQsghSAIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRAcKbwNGBdz +ZDrbAJ9cp6AsjOhiLxwznsMJheGf4xkH8wCfUPjMCLm4tAEnyYn2hDNt7CB8B6Kd +ATEEQsghShAEAIeUjW2yTALCfrEG3FhM3ZLvAHWAec2O0Mn/RDr59IN/W8wDYcZp +m+oG0ZUDdIqMppQ8K2kylAH7gmYDXIP9D7MRRm/Zw3L4yFfKnVaZ6tT7szBbgW5h +iOsHoOz49NXZT4jtMLdZS1/krm5Lam2MSPod9XN0Q2asY/igIMUfGDRjAAMGA/sE +LNh3tWefqeDkoDBEYjcxdGnGVGJnNHvv/eoHy9H7dyD/kkhaOoRAa5ClYWSqD0kk +a+SqTWhKG4XcbJyo1GsP6sqGhXDTM2+LBZPMKuVJQpEfoe9ruob/BbpXglfEiVE9 +VNiY7ZVyUdj3svYn4fK2X7ue1G3cHR2tL4lnOA4pYQAA9030E4u2ZKOfJBpUM+EM +m9VmsGjaQZV4teB0R/q3W8sRIYhJBBgRAgAJBQJCyCFKAhsMAAoJEBwpvA0YF3Nk +7a8AniFFotw1x2X+oryu3Q3nNtmxoKHpAJ9HU7jw7ydg33dI9J8gVkrmsSZ2/w== +=nvqq +-----END PGP PRIVATE KEY BLOCK----- +'); +insert into keytbl (id, name, pubkey, seckey) +values (2, 'elg2048', ' +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +mQGiBELIIgoRBAC1onBpxKYgDvrgCaUWPY34947X3ogxGOfCN0p6Eqrx+2PUhm4n +vFvmczpMT4iDc0mUO+iwnwsEkXQI1eC99g8c0jnZAvzJZ5miAHL8hukMA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E KEY BLOCK----- +'); +insert into keytbl (id, name, pubkey, seckey) +values (3, 'elg4096', ' +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +mQGiBELII7wRBACFuaAvb11cIvjJK9LkZr4cYuYhLWh3DJdojNNnLNiym5OEksvY +05cw8OgqKtPzICU7o/mHXTWhzJYUt3i50/AeYygI8Q0uATS6RnDAKNlES1EMoHKz +2a5iFbYs4bm4IwlkvYd8uWjcu+U0YLbxir39u+anIc6eT+q3WiH/q3zDRwCgkT98 +cnIG8iO8PdwDSP8G4Lt6TYED/R45GvCzJ4onQALLE92KkLUz8aFWSl05r84kczEN +SxiP9Ss6m465RmwWHfwYAu4b+c4GeNyU8fIU2EM8cezchC+edEi3xu1s+pCV0Dk4 +18DGC8WKCICO30vBynuNmYg7W/7Zd4wtjss454fMW7+idVDNM701mmXBtI1nsBtG +7Z4tA/9FxjFbJK9jh24RewfjHpLYqcfCo2SsUjOwsnMZ5yg2yv9KyVVQhRqwmrqt +q8MRyjGmfoD9PPdCgvqgzy0hHvAHUtTm2zUczGTG+0g4hNIklxC/Mv6J4KE+NWTh +uB4acqofHyaw2WnKOuRUsoDi6rG5AyjNMyAK/vVcEGj7J1tk27QjRWxnYW1hbCA0 +MDk2IDx0ZXN0NDA5NkBleGFtcGxlLm9yZz6IXgQTEQIAHgUCQsgjvAIbAwYLCQgH +AwIDFQIDAxYCAQIeAQIXgAAKCRBj+HX2P2d0oAEDAJ9lI+CNmb42z3+a6TnVusM6 +FI7oLwCfUwA1zEcRdsT3nIkoYh0iKxFSDFW5BA0EQsgkdhAQAJQbLXlgcJ/jq+Xh +Eujb77/eeftFJObNIRYD9fmJ7HFIXbUcknEpbs+cRH/nrj5dGSY3OT3jCXOUtvec +sCoX/CpZWL0oqDjAiZtNSFiulw5Gav4gHYkWKgKdSo+2rkavEPqKIVHvMeXaJtGT +d7v/AmL/P8T7gls93o5WFBOLtPbDvWqaKRy2U5TAhl1laiM0vGALR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Z4OOfhvI/OlRJ3HBx2L53embkbdY9gFYCCdTjPyjKoDIx +kALgCajjCYMNUsAKNSd6mMCQ8TtvukSzkZS1RGKP27ohsdnzIVsiEAbxDMMcI4k1 +ul0LExUTCXSjeIhJBBgRAgAJBQJCyCR2AhsMAAoJEGP4dfY/Z3Sg19sAn0NDS8pb +qrMpQAxSb7zRTmcXEFd9AJ435H0ttP/NhLHXC9ezgbCMmpXMOQ== +=kRxT +-----END PGP PUBLIC KEY BLOCK----- +', ' +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +lQG7BELII7wRBACFuaAvb11cIvjJK9LkZr4cYuYhLWh3DJdojNNnLNiym5OEksvY +05cw8OgqKtPzICU7o/mHXTWhzJYUt3i50/AeYygI8Q0uATS6RnDAKNlES1EMoHKz +2a5iFbYs4bm4IwlkvYd8uWjcu+U0YLbxir39u+anIc6eT+q3WiH/q3zDRwCgkT98 +cnIG8iO8PdwDSP8G4Lt6TYED/R45GvCzJ4onQALLE92KkLUz8aFWSl05r84kczEN +SxiP9Ss6m465RmwWHfwYAu4b+c4GeNyU8fIU2EM8cezchC+edEi3xu1s+pCV0Dk4 +18DGC8WKCICO30vBynuNmYg7W/7Zd4wtjss454fMW7+idVDNM701mmXBtI1nsBtG +7Z4tA/9FxjFbJK9jh24RewfjHpLYqcfCo2SsUjOwsnMZ5yg2yv9KyVVQhRqwmrqt +q8MRyjGmfoD9PPdCgvqgzy0hHvAHUtTm2zUczGTG+0g4hNIklxC/Mv6J4KE+NWTh +uB4acqofHyaw2WnKOuRUsoDi6rG5AyjNMyAK/vVcEGj7J1tk2wAAoJCUNy6awTkw +XfbLbpqh0fvDst7jDLa0I0VsZ2FtYWwgNDA5NiA8dGVzdDQwOTZAZXhhbXBsZS5v +cmc+iF4EExECAB4FAkLII7wCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQY/h1 +9j9ndKABAwCeNEOVK87EzXYbtxYBsnjrUI948NIAn2+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wlJsXxiiDobA9KC1J+/A55DjVRnl8wYm0sMLW4HzM3nuBvME +lHye8PFl89U8mp2hi5yfg7igEkjqxaAQgxxA7lmVoEi++DTkLqRUZNIMTj5qlPeG +PB84kFpmv3BE25g/N6vK8TfhjNqAcUJEBsXG6jExxO2lYVd7cpm0llWmIcMN6CML +GUvaFCItQ5zxKMEugqVUa8Hby4yyZyc81TtwBT5/XmdUO0dbTcfs2eDjn4byPzpU +Sdxwcdi+d3pm5G3WPYBWAgnU4z8oyqAyMZAC4Amo4wmDDVLACjUnepjAkPE7b7pE +s5GUtURij9u6IbHZ8yFbIhAG8QzDHCOJNbpdCxMVEwl0o3gAAckBdfKuasiNUn5G +L5XRnSvaOFzftr8zteOlZChCSNvzH5k+i1j7RJbWq06OeKRywPzjfjgM2MvRzI43 +ICeISQQYEQIACQUCQsgkdgIbDAAKCRBj+HX2P2d0oNfbAJ9+G3SeXrk+dWwo9EGi +hqMi2GVTsgCfeoQJPsc8FLYUgfymc/3xqAVLUtg= +=Gjq6 +-----END PGP PRIVATE KEY BLOCK----- +'); +insert into keytbl (id, name, pubkey, seckey) +values (4, 'rsa2048', ' +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +mQELBELIJbEBCADAIdtcoLAmQfl8pb73pPRuEYx8qW9klLfCGG5A4OUOi00JHNwP +ZaABe1PGzjoeXrgM1MTQZhoZu1Vdg+KDI6XAtiy9P6bLg7ntsXksD4wBoIKtQKc2 +55pdukxTiu+xeJJG2q8ZZPOp97CV9fbQ9vPCwgnuSsDCoQlibZikDVPAyVTvp7Jx +5rz8yXsl4sxvaeMZPqqFPtA/ENeQ3cpsyR1BQXSvoZpH1Fq0b8GcZTEdWWD/w6/K +MCRC8TmgEd+z3e8kIsCwFQ+TSHbCcxRWdgZE7gE31sJHHVkrZlXtLU8MPXWqslVz +R0cX+yC8j6bXI6/BqZ2SvRndJwuunRAr4um7AAYptB5SU0EgMjA0OCA8cnNhMjA0 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t8Zu5YG6+CtTbJXp +rPI7pJ1jHbeE+q/29hWJQtS8Abx82AcOkzhvS3NZKoJ/1DrGgoDAu1mGkM4KvLAx +fDs/qQ9dZhtEmDbKPLTVEA== +=WKAv +-----END PGP PRIVATE KEY BLOCK----- +'); +insert into keytbl (id, name, pubkey, seckey) +values (5, 'psw-elg1024', ' +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +mQGiBELIIUgRBACp401L6jXrLB28c3YA4sM3OJKnxM1GT9YTkWyE3Vyte65H8WU9 +tGPBX7OMuaX5eGZ84LFUGvaP0k7anfmXcDkCO3P9GgL+ro/dS2Ps/vChQPZqHaxE +xpKDUt47B7DGdRJrC8DRnIR4wbSyQA6ma3S1yFqC5pJhSs+mqf9eExOjiwCgntth +klRxIYw352ZX9Ov9oht/p/ED/1Xi4PS+tkXVvyIw5aZfa61bT6XvDkoPI0Aj3GE5 +YmCHJlKA/IhEr8QJOLV++5VEv4l6KQ1/DFoJzoNdr1AGJukgTc6X/WcQRzfQtUic +PHQme5oAWoHa6bVQZOwvbJh3mOXDq/Tk/KF22go8maM44vMn4bvv+SBbslviYLiL +jZJ1A/9JXF1esNq+X9HehJyqHHU7LEEf/ck6zC7o2erM3/LZlZuLNPD2cv3oL3Nv +saEgcTSZl+8XmO8pLmzjKIb+hi70qVx3t2IhMqbb4B/dMY1Ck62gPBKa81/Wwi7v +IsEBQLEtyBmGmI64YpzoRNFeaaF9JY+sAKqROqe6dLjJ7vebQLQfRWxnYW1hbCAx +MDI0IDx0ZXN0QGV4YW1wbGUub3JnPoheBBMRAgAeBQJCyCFIAhsDBgsJCAcDAgMV +AgMDFgIBAh4BAheAAAoJEBwpvA0YF3NkOtsAniI9W2bC3CxARTpYrev7ihreDzFc +AJ9WYLQxDQAi5Ec9AQoodPkIagzZ4LkBDQRCyCFKEAQAh5SNbbJMAsJ+sQbcWEzd +ku8AdYB5zY7Qyf9EOvn0g39bzANhxmmb6gbRlQN0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wT +D2DDAY/IQBjes7WgqZeacfLPDoB8ecD/KLoSCH6Z3etvbPHSOKiazxoJ962Ix74H +ZAE6ZbMTtl5dZW1ptB9FbGdhbWFsIDEwMjQgPHRlc3RAZXhhbXBsZS5vcmc+iF4E +ExECAB4FAkLIIUgCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQHCm8DRgXc2Q6 +2wCfXKegLIzoYi8cM57DCYXhn+MZB/MAn1D4zAi5uLQBJ8mJ9oQzbewgfAeinQFf +BELIIUoQBACHlI1tskwCwn6xBtxYTN2S7wB1gHnNjtDJ/0Q6+fSDf1vMA2HGaZvq +BtGVA3SKjKaUPCtpMpQB+4JmA1yD/Q+zEUZv2cNy+MhXyp1WmerU+7MwW4FuYYjr +B6Ds+PTV2U+I7TC3WUtf5K5uS2ptjEj6HfVzdENmrGP4oCDFHxg0YwADBgP7BCzY +d7Vnn6ng5KAwRGI3MXRpxlRiZzR77/3qB8vR+3cg/5JIWjqEQGuQpWFkqg9JJGvk +qk1oShuF3GycqNRrD+rKhoVw0zNviwWTzCrlSUKRH6Hva7qG/wW6V4JXxIlRPVTY +mO2VclHY97L2J+Hytl+7ntRt3B0drS+JZzgOKWH+BwMCJimeatkMEw9gRkFjt4Xa +9rX8awMBE5+vVcGKv/DNiCvJnlYvSdCj8VfuHsYFliiJo6u17NJon+K43e3yvDNk +f631VOVanGEz7TyqOkWQiEkEGBECAAkFAkLIIUoCGwwACgkQHCm8DRgXc2TtrwCe +IUWi3DXHZf6ivK7dDec22bGgoekAn0dTuPDvJ2Dfd0j0nyBWSuaxJnb/ +=SNvr +-----END PGP PRIVATE KEY BLOCK----- +'); +insert into keytbl (id, name, pubkey, seckey) +values (6, 'rsaenc2048', ' +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +mQELBELr2m0BCADOrnknlnXI0EzRExf/TgoHvK7Xx/E0keWqV3KrOyC3/tY2KOrj +UVxaAX5pkFX9wdQObGPIJm06u6D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Wnu0PF +JVK4xyRmhIq2rVCw16a1pBJirvGM+y0ABimJAR8EGAECAAkFAkLr2roCGwwACgkQ +yJnqk0QZVVku1wgAg1bLSjPkhw+ldG5HzumpqR84+JKyozdJaJzefu2+1iqYE0B0 +WLz2PJVIiK41xiEkKhBvTOQYuXmtWqAWXptD91P5SoXoNJWLQO3TNwarANhHxkWg +w/TOUxQqoctlRUej5NDD+4eW5G9lcS1FEGuKDWtX096u80vO+TbyJjvx2eVM1k+X +dmeYsGOiNgDimCreJGYc14G7eY9jt24gw10n1sMAKI1qm6lcoHqZ9OOyla+wJdro +PYZGO7R8+1O9R22WrK6BYDT5j/1JwMZqbOESjNvDEVT0yOHClCHRN4CChbt6LhKh +CLUNdz/udIt0JAC6c/HdPLSW3HnmM3+iNj+Kug== +=pwU2 +-----END PGP PUBLIC KEY BLOCK----- +', ' +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1.4.1 (GNU/Linux) + +lQOWBELr2m0BCADOrnknlnXI0EzRExf/TgoHvK7Xx/E0keWqV3KrOyC3/tY2KOrj +UVxaAX5pkFX9wdQObGPIJm06u6D16CH6CildX/vxG7YgvvKzK8JGAbwrXAfk7OIW +czO2zRaZGDynoK3mAxHRBReyTKtNv8rDQhuZs6AOozJNARdbyUO/yqUnqNNygWuT +4htFDEuLPIJwAbMSD0BvFW6YQaPdxzaAZm3EWVNbwDzjgbBUdBiUUwRdZIFUhsjJ +dirFdy5+uuZru6y6CNC1OERkJ7P8EyoFiZckAIE5gshVZzNuyLOZjc5DhWBvLbX4 +NZElAnfiv+4nA6y8wQLSIbmHA3nqJaBklj85AAYpAAf9GuKpxrXp267eSPw9ZeSw +Ik6ob1I0MHbhhHeaXQnF0SuOViJ1+Bs74hUB3/F5fqrnjVLIS/ysYzegYpbpXOIa +MZwYcp2e+dpmVb7tkGQgzXH0igGtBQBqoSUVq9mG2XKPVh2JmiYgOH6GrHSGmnCq +GCgEK4ezSomB/3OtPFSjAxOlSw6dXSkapSx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7UytKe2f3A3ZInGXJIK2Hl+TzapWYcYxql+4 +ol5mEDDMDbhEE8Wmj9KyB6iifdLI0K+yxNb9T4Jpj3J18+St+G8+9AcFcBEEAM1b +M9C+/05cnV8gjcByqH9M9ypo8fzPvMKVXWwCLQXpaL50QIkzLURkiMoEWrCdELaA +sVPotRzePTIQ1ooLeDxd1gRnDqjZiIR0kwmv6vq8tfzY96O2ZbGWFI5eth89aWEJ +WB8AR3zYcXpwJLwPuhXW2/NlZF0bclJ3jNzAfTIeQmeJAR8EGAECAAkFAkLr2roC +GwwACgkQyJnqk0QZVVku1wgAg1bLSjPkhw+ldG5HzumpqR84+JKyozdJaJzefu2+ +1iqYE0B0WLz2PJVIiK41xiEkKhBvTOQYuXmtWqAWXptD91P5SoXoNJWLQO3TNwar +ANhHxkWgw/TOUxQqoctlRUej5NDD+4eW5G9lcS1FEGuKDWtX096u80vO+TbyJjvx +2eVM1k+XdmeYsGOiNgDimCreJGYc14G7eY9jt24gw10n1sMAKI1qm6lcoHqZ9OOy +la+wJdroPYZGO7R8+1O9R22WrK6BYDT5j/1JwMZqbOESjNvDEVT0yOHClCHRN4CC +hbt6LhKhCLUNdz/udIt0JAC6c/HdPLSW3HnmM3+iNj+Kug== +=UKh3 +-----END PGP PRIVATE KEY BLOCK----- +'); +insert into keytbl (id, name, pubkey, seckey) +values (7, 'rsaenc2048-psw', ' +same key with password +', ' +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1.4.11 (GNU/Linux) + +lQPEBELr2m0BCADOrnknlnXI0EzRExf/TgoHvK7Xx/E0keWqV3KrOyC3/tY2KOrj +UVxaAX5pkFX9wdQObGPIJm06u6D16CH6CildX/vxG7YgvvKzK8JGAbwrXAfk7OIW +czO2zRaZGDynoK3mAxHRBReyTKtNv8rDQhuZs6AOozJNARdbyUO/yqUnqNNygWuT +4htFDEuLPIJwAbMSD0BvFW6YQaPdxzaAZm3EWVNbwDzjgbBUdBiUUwRdZIFUhsjJ +dirFdy5+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6 +=QFm5 +-----END PGP PRIVATE KEY BLOCK----- +'); +-- elg1024 / aes128 +insert into encdata (id, data) values (1, ' +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1.4.1 (GNU/Linux) + +hQEOA9k2z2S7c/RmEAQAgVWW0DeLrZ+1thWJGBPp2WRFL9HeNqqWHbKJCXJbz1Uy +faUY7yxVvG5Eutmo+JMiY3mg23/DgVVXHQZsTWpGvGM6djgUNGKUjZDbW6Nog7Mr +e78IywattCOmgUP9vIwwg3OVjuDCN/nVirGQFnXpJBc8DzWqDMWRWDy1M0ZsK7AD +/2JTosSFxUdpON0DKtIY3GLzmh6Nk3iV0g8VgJKUBT1rhCXuMDj3snm//EMm7hTY +PlnObq4mIhgz8NqprmhooxnU0Kapofb3P3wCHPpU14zxhXY8iKO/3JhBq2uFcx4X +uBMwkW4AdNxY/mzJZELteTL8Tr0s7PISk+owb4URpG3n0jsBc0CVULxrjh5Ejkdw +wCM195J6+KbQxOOFQ0b3uOVvv4dEgd/hRERCOq5EPaFhlHegyYJ7YO842vnSDA== +=PABx +-----END PGP MESSAGE----- +'); +-- elg2048 / blowfish +insert into encdata (id, data) values (2, ' +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1.4.1 (GNU/Linux) + +hQIOAywibh/+XMfUEAf+OINhBngEsw4a/IJIeJvUgv1gTQzBwOdQEuc/runr4Oa8 +Skw/Bj0X/zgABVZLem1a35NHaNwaQaCFwMQ41YyWCu+jTdsiyX/Nw0w8LKKz0rNC +vVpG6YuV7Turtsf8a5lXy1K0SHkLlgxQ6c76GS4gtSl5+bsL2+5R1gSRJ9NXqCQP +OHRipEiYwBPqr5R21ZG0FXXNKGOGkj6jt/M/wh3WVtAhYuBI+HPKRfAEjd/Pu/eD +e1zYtkH1dKKFmp44+nF0tTI274xpuso7ShfKYrOK3saFWrl0DWiWteUinjSA1YBY +m7dG7NZ8PW+g1SZWhEoPjEEEHz3kWMvlKheMRDudnQf/dDyX6kZVIAQF/5B012hq +QyVewgTGysowFIDn01uIewoEA9cASw699jw9IoJp+k5WZXnU+INllBLzQxniQCSu +iEcr0x3fYqNtj9QBfbIqyRcY6HTWcmzyOUeGaSyX76j+tRAvtVtXpraFFFnaHB70 +YpXTjLkp8EBafzMghFaKDeXlr2TG/T7rbwcwWrFIwPqEAUKWN5m97Q3eyo8/ioMd +YoFD64J9ovSsgbuU5IpIGAsjxK+NKzg/2STH7zZFEVCtgcIXsTHTZfiwS98/+1H9 +p1DIDaXIcUFV2ztmcKxh9gt2sXRz1W+x6D8O0k3nanU5yGG4miLKaq18fbcA0BD1 ++NIzAfelq6nvvxYKcGcamBMgLo5JkZOBHvyr6RsAKIT5QYc0QTjysTk9l0Am3gYc +G2pAE+3k +=TBHV +-----END PGP MESSAGE----- +'); +-- elg4096 / aes256 +insert into encdata (id, data) values (3, ' +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1.4.1 (GNU/Linux) + +hQQOA7aFBP0Sjh/5EA/+JCgncc8IZmmRjPStWnGf9tVJhgHTn+smIclibGzs0deS +SPSCitzpblwbUDvu964+/5e5Q1l7rRuNN+AgETlEd4eppv7Swn2ChdgOXxRwukcT +Nh3G+PTFvD4ayi7w1db3qvXIt0MwN4Alt436wJmK1oz2Ka9IcyO+wHWrDy1nSGSx +z5x7YEj+EZPgWc/YAvudqE8Jpzd/OT5zSHN09UFkIAk6NxisKaIstbEGFgpqtoDZ +1SJM84XAdL2IcaJ3YY7k/yzwlawhsakKd4GSd5vWmAwvyzzbSiBMfKsDE16ePLNU +ZBF7CzmlCBPZ7YrFAHLpXBXXkCQvzD2BEYOjse50ZEfJ036T7950Ozcdy1EQbGon +nyQ4Gh0PBpnMcBuiXOceWuYzhlzFOzDtlVKdNTxFRDcbEyW2jo9xQYvCCLnYy8EH +2M7S8jCtVYJBbn63a82ELv+3+kWYcsvBJv2ZVBh4ncrBu9o0P+OYS7ApoOU+j6p2 ++t0RXHksqXS1YiUwYF5KSw09EbYMgNZ9G04Px/PxLU6fSC9iDrGX7Xt3kOUP0mku +C518fPckT0zzRXqfFruJNRzDytW50KxkOQZzU1/Az1YlYN9QzWeU4EtLPb2fftZo +D0qH/ln+f9Op5t6sD2fcxZVECU1b/bFtZsxvwH406YL+UQ7hU/XnZrzVVzODal8P +/j1hg7v7BdJqu1DTp9nFWUuwMFcYAczuXn29IG183NZ7Ts4whDeYEhS8eNoLPX4j +txY12ILD/w/3Q4LoW/hPa6OdfEzsn0U5GLf1WiGmJE1H6ft2U/xUnerc/u0kt+FU +WAisArd4MuKtf7B5Vu/VF3kUdrR0hTniUKUivmC4o1jSId31Dufxj4aadVyldXAr +6TNBcdyragZjxEZ6hsBCYzA0Rd1a8atd6OaQoIEEfAzCu5Ks29pydHErStYGjWJ1 +KA5KPLVvjbHpDmRhlCcm8vgpYQsBYEB5gE9fx5yCTlsVhCB6y23h7hfdMqerDqkO +ZOPsO5h+tiHCdIrQ36sMjuINy1/K2rYcXd+Crh2iHcfidpU9fvDz2ihTRNQlhjuT +0cQZM5JhctEx4VXF4LDctRhit7Hn0iqsk604woQfJVvP8O673xSXT/kBY0A/v9C0 +3C4YoFNeSaKwbfZQ/4u1ZFPJxK2IIJa8UGpyAUewLMlzGVVagljybv/f4Z9ERAhy +huq5sMmw8UPsrJF2TUGHz5WSIwoh0J/qovoQI09I9sdEnFczDvRavMO2Mldy3E5i +exz9oewtel6GOmsZQSYWT/vJzbYMmvHNmNpVwwoKrLV6oI3kyQ80GHBwI1WlwHoK +2iRB0w8q4VVvJeYAz8ZIp380cqC3pfO0uZsrOx4g3k4X0jsB5y7rF5xXcZfnVbvG +DYKcOy60/OHMWVvpw6trAoA+iP+cVWPtrbRvLglTVTfYmi1ToZDDipkALBhndQ== +=L/M/ +-----END PGP MESSAGE----- +'); +-- rsaenc2048 / aes128 +insert into encdata (id, data) values (4, ' +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1.4.1 (GNU/Linux) + +hQEMA/0CBsQJt0h1AQf+JyYnCiortj26P11zk28MKOGfWpWyAhuIgwbJXsdQ+e6r +pEyyqs9GC6gI7SNF6+J8B/gsMwvkAL4FHAQCvA4ZZ6eeXR1Of4YG22JQGmpWVWZg +DTyfhA2vkczuqfAD2tgUpMT6sdyGkQ/fnQ0lknlfHgC5GRx7aavOoAKtMqiZW5PR +yae/qR48mjX7Mb+mLvbagv9mHEgQSmHwFpaq2k456BbcZ23bvCmBnCvqV/90Ggfb +VP6gkSoFVsJ19RHsOhW1dk9ehbl51WB3zUOO5FZWwUTY9DJvKblRK/frF0+CXjE4 +HfcZXHSpSjx4haGGTsMvEJ85qFjZpr0eTGOdY5cFhNJAAVP8MZfji7OhPRAoOOIK +eRGOCkao12pvPyFTFnPd5vqmyBbdNpK4Q0hS82ljugMJvM0p3vJZVzW402Kz6iBL +GQ== +=XHkF +-----END PGP MESSAGE----- +'); +-- rsaenc2048 / aes128 (not from gnupg) +insert into encdata (id, data) values (5, ' +-----BEGIN PGP MESSAGE----- + +wcBMA/0CBsQJt0h1AQgAzxZ8j+OTeZ8IlLxfZ/mVd28/gUsCY+xigWBk/anZlK3T +p2tNU2idHzKdAttH2Hu/PWbZp4kwjl9spezYxMqCeBZqtfGED88Y+rqK0n/ul30A +7jjFHaw0XUOqFNlST1v6H2i7UXndnp+kcLfHPhnO5BIYWxB2CYBehItqtrn75eqr +C7trGzU/cr74efcWagbCDSNjiAV7GlEptlzmgVMmNikyI6w0ojEUx8lCLc/OsFz9 +pJUAX8xuwjxDVv+W7xk6c96grQiQlm+FLDYGiGNXoAzx3Wi/howu3uV40dXfY+jx +3WBrhEew5Pkpt1SsWoFnJWOfJ8GLd0ec8vfRCqAIVdLgAeS7NyawQYtd6wuVrEAj +5SMg4Thb4d+g45RksuGLHUUr4qO9tiXglODa4InhmJfgNuLk+RGz4LXjq8wepEmW +vRbgFOG54+Cf4C/gC+HkreDm5JKSKjvvw4B/jC6CDxq+JoziEe2Z1uEjCuEcr+Es +/eGzeOi36BejXPMHeKxXejj5qBBHKV0pHVhZSgffR0TtlXdB967Yl/5agV0R89hI +7Gw52emfnH4Z0Y4V0au2H0k1dR/2IxXdJEWSTG7Be1JHT59p9ei2gSEOrdBMIOjP +tbYYUlmmbvD49bHfThkDiC+oc9947LgQsk3kOOLbNHcjkbrjH8R5kjII4m/SEZA1 +g09T+338SzevBcVXh/cFrQ6/Et+lyyO2LJRUMs69g/HyzJOVWT2Iu8E0eS9MWevY +Qtrkrhrpkl3Y02qEp/j6M03Yu2t6ZF7dp51aJ5VhO2mmmtHaTnCyCc8Fcf72LmD8 +blH2nKZC9d6fi4YzSYMepZpMOFR65M80MCMiDUGnZBB8sEADu2/iVtqDUeG8mAA= +=PHJ1 +-----END PGP MESSAGE----- +'); +-- successful decrypt +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=1 and encdata.id=1; + pgp_pub_decrypt +----------------- + Secret msg +(1 row) + +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=2 and encdata.id=2; +ERROR: Wrong key or corrupt data +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=3 and encdata.id=3; + pgp_pub_decrypt +----------------- + Secret msg +(1 row) + +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=6 and encdata.id=4; + pgp_pub_decrypt +----------------- + Secret message. +(1 row) + +-- wrong key +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=2 and encdata.id=1; +ERROR: Wrong key +-- sign-only key +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=4 and encdata.id=1; +ERROR: No encryption key found +-- rsa: password-protected secret key, wrong password +select pgp_pub_decrypt(dearmor(data), dearmor(seckey), '123') +from keytbl, encdata where keytbl.id=7 and encdata.id=4; +ERROR: Wrong key or corrupt data +-- rsa: password-protected secret key, right password +select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'parool') +from keytbl, encdata where keytbl.id=7 and encdata.id=4; + pgp_pub_decrypt +----------------- + Secret message. +(1 row) + +-- password-protected secret key, no password +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=5 and encdata.id=1; +ERROR: Need password for secret key +-- password-protected secret key, wrong password +select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'foo') +from keytbl, encdata where keytbl.id=5 and encdata.id=1; +ERROR: Wrong key or corrupt data +-- password-protected secret key, right password +select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'parool') +from keytbl, encdata where keytbl.id=5 and encdata.id=1; + pgp_pub_decrypt +----------------- + Secret msg +(1 row) + +-- test for a short read from prefix_init +select pgp_pub_decrypt(dearmor(data), dearmor(seckey)) +from keytbl, encdata where keytbl.id=6 and encdata.id=5; +ERROR: Wrong key or corrupt data diff --git a/doc/src/sgml/pgcrypto.sgml b/doc/src/sgml/pgcrypto.sgml index fa20c07a520..d8ba9f26b11 100644 --- a/doc/src/sgml/pgcrypto.sgml +++ b/doc/src/sgml/pgcrypto.sgml @@ -1225,6 +1225,13 @@ gen_random_uuid() returns uuid + + When compiled against OpenSSL 3.0.0 and later + versions, the legacy provider must be activated in the + openssl.cnf configuration file in order to use older + ciphers like DES or Blowfish. + + Notes: From a5cd81b88027e6983ef19c59a98d42347c3efda4 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 5 Jun 2021 07:16:34 +0200 Subject: [PATCH 5/8] Fix subtransaction test for Python 3.10 Starting with Python 3.10, the stacktrace looks differently: - PL/Python function "subtransaction_exit_subtransaction_in_with", line 3, in - s.__exit__(None, None, None) + PL/Python function "subtransaction_exit_subtransaction_in_with", line 2, in + with plpy.subtransaction() as s: Using try/except specifically makes the error look always the same. (See https://github.com/python/cpython/pull/25719 for the discussion of this change in Python.) Author: Honza Horak Discussion: https://www.postgresql.org/message-id/flat/853083.1620749597%40sss.pgh.pa.us RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1959080 --- src/pl/plpython/expected/plpython_subtransaction.out | 11 +++++++---- src/pl/plpython/sql/plpython_subtransaction.sql | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pl/plpython/expected/plpython_subtransaction.out b/src/pl/plpython/expected/plpython_subtransaction.out index b38cde8d2db..d9a830dfcc6 100644 --- a/src/pl/plpython/expected/plpython_subtransaction.out +++ b/src/pl/plpython/expected/plpython_subtransaction.out @@ -236,8 +236,11 @@ with plpy.subtransaction() as s: $$ LANGUAGE plpythonu; CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void AS $$ -with plpy.subtransaction() as s: - s.__exit__(None, None, None) +try: + with plpy.subtransaction() as s: + s.__exit__(None, None, None) +except ValueError as e: + raise ValueError(e) $$ LANGUAGE plpythonu; SELECT subtransaction_exit_without_enter(); ERROR: ValueError: this subtransaction has not been entered @@ -289,8 +292,8 @@ PL/Python function "subtransaction_enter_subtransaction_in_with" SELECT subtransaction_exit_subtransaction_in_with(); ERROR: ValueError: this subtransaction has already been exited CONTEXT: Traceback (most recent call last): - PL/Python function "subtransaction_exit_subtransaction_in_with", line 3, in - s.__exit__(None, None, None) + PL/Python function "subtransaction_exit_subtransaction_in_with", line 6, in + raise ValueError(e) PL/Python function "subtransaction_exit_subtransaction_in_with" -- Make sure we don't get a "current transaction is aborted" error SELECT 1 as test; diff --git a/src/pl/plpython/sql/plpython_subtransaction.sql b/src/pl/plpython/sql/plpython_subtransaction.sql index 398c65720ce..572930f8bf2 100644 --- a/src/pl/plpython/sql/plpython_subtransaction.sql +++ b/src/pl/plpython/sql/plpython_subtransaction.sql @@ -158,8 +158,11 @@ $$ LANGUAGE plpythonu; CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void AS $$ -with plpy.subtransaction() as s: - s.__exit__(None, None, None) +try: + with plpy.subtransaction() as s: + s.__exit__(None, None, None) +except ValueError as e: + raise ValueError(e) $$ LANGUAGE plpythonu; SELECT subtransaction_exit_without_enter(); From 48b4aa3b9855e87170c64639b02480251868a861 Mon Sep 17 00:00:00 2001 From: mrdrivingduck Date: Sun, 10 Mar 2024 15:00:08 +0800 Subject: [PATCH 6/8] ci: GitHub Actions upgrade --- .github/workflows/docs-format-check.yml | 8 +-- .github/workflows/docs.yml | 8 +-- .github/workflows/regression-test.yml | 72 +++++++++++++++---------- 3 files changed, 51 insertions(+), 37 deletions(-) diff --git a/.github/workflows/docs-format-check.yml b/.github/workflows/docs-format-check.yml index 8e8ca7af68b..08cc79eabcb 100644 --- a/.github/workflows/docs-format-check.yml +++ b/.github/workflows/docs-format-check.yml @@ -3,7 +3,7 @@ name: docs format check on: # trigger deployment on every PR to branch POLARDB_11_DEV in docs/ pull_request: - branches: [POLARDB_11_DEV] + branches: [ POLARDB_11_DEV ] paths: - ".github/workflows/docs.yml" - "docs/**" @@ -16,20 +16,20 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # fetch all commits to get last updated time or other git log info fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: # choose node.js version to use node-version: "16" # cache node_modules - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 id: yarn-cache with: path: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index be4e0469d41..71852c36cb5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,20 +16,20 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # fetch all commits to get last updated time or other git log info fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: # choose node.js version to use node-version: "16" # cache node_modules - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 id: yarn-cache with: path: | @@ -50,7 +50,7 @@ jobs: # please check out the docs of the workflow for more details # @see https://github.com/crazy-max/ghaction-github-pages - name: Deploy to GitHub Pages - uses: crazy-max/ghaction-github-pages@v3 + uses: crazy-max/ghaction-github-pages@v4 with: # deploy to gh-pages branch target_branch: gh-pages diff --git a/.github/workflows/regression-test.yml b/.github/workflows/regression-test.yml index 1620e1ac35e..f4ac318089b 100644 --- a/.github/workflows/regression-test.yml +++ b/.github/workflows/regression-test.yml @@ -25,20 +25,16 @@ on: workflow_dispatch: jobs: - build: + build_normal: runs-on: ubuntu-latest strategy: matrix: - container_image: [ centos7 ] - instance_type: [ oltp, htap, dma ] - + container_image: [ centos7, ubuntu20.04, ubuntu22.04 ] + instance_type: [ oltp, htap ] steps: - - - name: Fetch PolarDB source code - uses: actions/checkout@v3 - - - - name: Create and start the container + - name: Fetch PolarDB source code + uses: actions/checkout@v4 + - name: Create and start the container run: | docker create \ -t \ @@ -47,63 +43,81 @@ jobs: polardb/polardb_pg_devel:${{ matrix.container_image }} \ bash && \ docker start polardb_${{ matrix.container_image }} - - - - name: Change ownership of the source code + - name: Change ownership of the source code run: | docker exec \ polardb_${{ matrix.container_image }} \ bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \ sudo chown -R postgres:postgres ./" - - - - name: Ignore some test cases for OLTP regression testing + - name: Ignore some test cases for OLTP regression testing if: ${{ matrix.instance_type == 'oltp' }} run: | docker exec \ polardb_${{ matrix.container_image }} \ bash -c "cd /home/postgres/PolarDB-for-PostgreSQL" - - - name: Build and run OLTP regression testing + - name: Build and run OLTP regression testing if: ${{ matrix.instance_type == 'oltp' }} run: | docker exec \ polardb_${{ matrix.container_image }} \ bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \ - source /etc/bashrc && \ + if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \ ./polardb_build.sh --withrep -r -e -r-external \ -r-contrib -r-pl --with-tde" - - - - name: Ignore some test cases for HTAP regression testing + - name: Ignore some test cases for HTAP regression testing if: ${{ matrix.instance_type == 'htap' }} run: | docker exec \ polardb_${{ matrix.container_image }} \ bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \ sed -i 's/test: polar-px-dev\/polar_partition_huge/#&/g' src/test/regress/polar-px-dev-schedule" - - - name: Build and run HTAP regression testing + - name: Build and run HTAP regression testing if: ${{ matrix.instance_type == 'htap' }} run: | docker exec \ polardb_${{ matrix.container_image }} \ bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \ - source /etc/bashrc && \ + if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \ ./polardb_build.sh -r-px -e -r-external \ -r-contrib -r-pl --with-tde" + - name: Change ownership of the source code + run: | + sudo chown -R runner:runner `pwd` + + build_dma: + runs-on: ubuntu-latest + strategy: + matrix: + container_image: [ centos7 ] + instance_type: [ dma ] + steps: + - name: Fetch PolarDB source code + uses: actions/checkout@v4 - - - name: Build and run DMA regression testing + - name: Create and start the container + run: | + docker create \ + -t \ + --name polardb_${{ matrix.container_image }} \ + -v `pwd`:/home/postgres/PolarDB-for-PostgreSQL \ + polardb/polardb_pg_devel:${{ matrix.container_image }} \ + bash && \ + docker start polardb_${{ matrix.container_image }} + - name: Change ownership of the source code + run: | + docker exec \ + polardb_${{ matrix.container_image }} \ + bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \ + sudo chown -R postgres:postgres ./" + - name: Build and run DMA regression testing if: ${{ matrix.instance_type == 'dma' }} run: | docker exec \ polardb_${{ matrix.container_image }} \ bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \ - source /etc/bashrc && \ + if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \ ./polardb_build.sh -r -e -r-external \ -r-contrib -r-pl --with-tde --with-dma" - - name: Change ownership of the source code run: | sudo chown -R runner:runner `pwd` From f6e0c4908ad99b03f2a5eeb5de793529d521b5da Mon Sep 17 00:00:00 2001 From: mrdrivingduck Date: Sun, 10 Mar 2024 15:13:49 +0800 Subject: [PATCH 7/8] bug: fix broken xml test cases --- src/test/regress/expected/xml.out | 52 ++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out index bffbce7ab48..c05f5d79733 100644 --- a/src/test/regress/expected/xml.out +++ b/src/test/regress/expected/xml.out @@ -9,6 +9,8 @@ ERROR: invalid XML content LINE 1: INSERT INTO xmltest VALUES (3, '', NULL, ''); xmlconcat -------------- @@ -105,9 +109,16 @@ SELECT xmlelement(name element, xmlelement(name nested, 'stuff')); (1 row) SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp; -ERROR: relation "emp" does not exist -LINE 1: ...ame employee, xmlforest(name, age, salary as pay)) FROM emp; - ^ + xmlelement +---------------------------------------------------------------------- + sharon251000 + sam302000 + bill201000 + jeff23600 + cim30400 + linda19100 +(6 rows) + SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a)); ERROR: XML attribute name "a" appears more than once LINE 1: ...ment(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a)); @@ -213,12 +224,16 @@ DETAIL: line 1: xmlParseEntityRef: no name & ^ line 1: chunk is not well balanced +& + ^ SELECT xmlparse(content '&idontexist;'); ERROR: invalid XML content DETAIL: line 1: Entity 'idontexist' not defined &idontexist; ^ line 1: chunk is not well balanced +&idontexist; + ^ SELECT xmlparse(content ''); xmlparse --------------------------- @@ -237,7 +252,11 @@ DETAIL: line 1: Entity 'idontexist' not defined &idontexist; ^ line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced +&idontexist; + ^ line 1: chunk is not well balanced +&idontexist; + ^ SELECT xmlparse(content ''); xmlparse --------------------- @@ -247,6 +266,8 @@ SELECT xmlparse(content ''); SELECT xmlparse(document ' '); ERROR: invalid XML document DETAIL: line 1: Start tag expected, '<' not found + + ^ SELECT xmlparse(document 'abc'); ERROR: invalid XML document DETAIL: line 1: Start tag expected, '<' not found @@ -264,12 +285,16 @@ DETAIL: line 1: xmlParseEntityRef: no name & ^ line 1: Opening and ending tag mismatch: invalidentity line 1 and abc +& + ^ SELECT xmlparse(document '&idontexist;'); ERROR: invalid XML document DETAIL: line 1: Entity 'idontexist' not defined &idontexist; ^ line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc +&idontexist; + ^ SELECT xmlparse(document ''); xmlparse --------------------------- @@ -288,6 +313,8 @@ DETAIL: line 1: Entity 'idontexist' not defined &idontexist; ^ line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced +&idontexist; + ^ SELECT xmlparse(document ''); xmlparse --------------------- @@ -472,9 +499,11 @@ SELECT xmlagg(data) FROM xmltest WHERE id > 10; (1 row) SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp; -ERROR: relation "emp" does not exist -LINE 1: ...me employees, xmlagg(xmlelement(name name, name))) FROM emp; - ^ + xmlelement +-------------------------------------------------------------------------------------------------------------------------------- + sharonsambilljeffcimlinda +(1 row) + -- Check mapping SQL identifier to XML name SELECT xmlpi(name ":::_xml_abc135.%-&_"); xmlpi @@ -567,9 +596,6 @@ CREATE VIEW xmlview1 AS SELECT xmlcomment('test'); CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you'); CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&'); CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp; -ERROR: relation "emp" does not exist -LINE 1: ...ame employee, xmlforest(name, age, salary as pay)) FROM emp; - ^ CREATE VIEW xmlview5 AS SELECT xmlparse(content 'x'); CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar'); CREATE VIEW xmlview7 AS SELECT xmlroot(xml '', version no value, standalone yes); @@ -577,17 +603,19 @@ CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10)); CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text); SELECT table_name, view_definition FROM information_schema.views WHERE table_name LIKE 'xmlview%' ORDER BY 1; - table_name | view_definition -------------+------------------------------------------------------------------------------------------------------------ + table_name | view_definition +------------+------------------------------------------------------------------------------------------------------------------- xmlview1 | SELECT xmlcomment('test'::text) AS xmlcomment; xmlview2 | SELECT XMLCONCAT('hello'::xml, 'you'::xml) AS "xmlconcat"; xmlview3 | SELECT XMLELEMENT(NAME element, XMLATTRIBUTES(1 AS ":one:", 'deuce' AS two), 'content&') AS "xmlelement"; + xmlview4 | SELECT XMLELEMENT(NAME employee, XMLFOREST(emp.name AS name, emp.age AS age, emp.salary AS pay)) AS "xmlelement"+ + | FROM emp; xmlview5 | SELECT XMLPARSE(CONTENT 'x'::text STRIP WHITESPACE) AS "xmlparse"; xmlview6 | SELECT XMLPI(NAME foo, 'bar'::text) AS "xmlpi"; xmlview7 | SELECT XMLROOT(''::xml, VERSION NO VALUE, STANDALONE YES) AS "xmlroot"; xmlview8 | SELECT (XMLSERIALIZE(CONTENT 'good'::xml AS character(10)))::character(10) AS "xmlserialize"; xmlview9 | SELECT XMLSERIALIZE(CONTENT 'good'::xml AS text) AS "xmlserialize"; -(8 rows) +(9 rows) -- Text XPath expressions evaluation SELECT xpath('/value', data) FROM xmltest; From ffb3160d6751e62311ef7faabe52ac1ee189e993 Mon Sep 17 00:00:00 2001 From: mrdrivingduck Date: Sun, 10 Mar 2024 16:17:07 +0800 Subject: [PATCH 8/8] bug: fix ePQ plpython cases --- .github/workflows/regression-test.yml | 2 +- .../polar-px-dev/bfv_aggregate.out | 4 +- .../px_expected/polar-px-dev/bfv_index.out | 6 +- .../polar-px-dev/bfv_partition_plans.out | 251 ++++++++++-------- .../px_expected/polar-px-dev/gporca.out | 10 +- .../qp_with_functional_inlining.out | 4 +- .../qp_with_functional_noinlining.out | 4 +- .../sql/polar-px-dev/bfv_aggregate.sql | 4 +- .../regress/sql/polar-px-dev/bfv_index.sql | 4 +- .../sql/polar-px-dev/bfv_partition_plans.sql | 2 +- .../sql/polar-px-dev/qp_with_functional.sql | 2 +- 11 files changed, 154 insertions(+), 139 deletions(-) diff --git a/.github/workflows/regression-test.yml b/.github/workflows/regression-test.yml index f4ac318089b..78ed9546663 100644 --- a/.github/workflows/regression-test.yml +++ b/.github/workflows/regression-test.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - container_image: [ centos7, ubuntu20.04, ubuntu22.04 ] + container_image: [ ubuntu20.04, ubuntu22.04 ] instance_type: [ oltp, htap ] steps: - name: Fetch PolarDB source code diff --git a/src/test/regress/px_expected/polar-px-dev/bfv_aggregate.out b/src/test/regress/px_expected/polar-px-dev/bfv_aggregate.out index 2d61ddb90a0..b67ad0a3d51 100644 --- a/src/test/regress/px_expected/polar-px-dev/bfv_aggregate.out +++ b/src/test/regress/px_expected/polar-px-dev/bfv_aggregate.out @@ -291,7 +291,7 @@ select f3, array_sort(myaggp20a(f1)) from t group by f3 order by f3; (3 rows) -- start_ignore -create language plpythonu; +create language plpython3u; -- end_ignore create or replace function count_operator(query text, operator text) returns int as $$ @@ -304,7 +304,7 @@ for i in range(len(rv)): result = result+1 return result $$ -language plpythonu; +language plpython3u; -- -- Testing adding a traceflag to favor multi-stage aggregation -- diff --git a/src/test/regress/px_expected/polar-px-dev/bfv_index.out b/src/test/regress/px_expected/polar-px-dev/bfv_index.out index 7c3ef71eba1..5a92da652ef 100644 --- a/src/test/regress/px_expected/polar-px-dev/bfv_index.out +++ b/src/test/regress/px_expected/polar-px-dev/bfv_index.out @@ -296,8 +296,8 @@ AND ft.id = dt1.id; (30 rows) -- start_ignore -create language plpythonu; -ERROR: language "plpythonu" already exists +create language plpython3u; +ERROR: language "plpython3u" already exists -- end_ignore create or replace function count_index_scans(explain_query text) returns int as $$ @@ -310,7 +310,7 @@ for i in range(len(rv)): result = result+1 return result $$ -language plpythonu; +language plpython3u; DROP TABLE bfv_tab1; DROP TABLE bfv_tab2_facttable1; DROP TABLE bfv_tab2_dimdate; diff --git a/src/test/regress/px_expected/polar-px-dev/bfv_partition_plans.out b/src/test/regress/px_expected/polar-px-dev/bfv_partition_plans.out index d827844fd7a..fdbd1d29b35 100644 --- a/src/test/regress/px_expected/polar-px-dev/bfv_partition_plans.out +++ b/src/test/regress/px_expected/polar-px-dev/bfv_partition_plans.out @@ -9,8 +9,8 @@ set search_path=bfv_partition_plans; -- Initial setup for all the partitioning test for this suite -- -- start_ignore -CREATE LANGUAGE plpythonu; -ERROR: language "plpythonu" already exists +CREATE LANGUAGE plpython3u; +ERROR: language "plpython3u" already exists -- end_ignore create or replace function count_operator(query text, operator text) returns int as $$ @@ -24,8 +24,6 @@ for i in range(len(rv)): return result $$ language plpython3u; -ERROR: language "plpython3u" does not exist -HINT: Use CREATE EXTENSION to load the language into the database. create or replace function find_operator(query text, operator_name text) returns text as $$ rv = plpy.execute('EXPLAIN ' + query) @@ -39,8 +37,6 @@ for i in range(len(rv)): return result $$ language plpython3u; -ERROR: language "plpython3u" does not exist -HINT: Use CREATE EXTENSION to load the language into the database. -- Test UPDATE that moves row from one partition to another. The partitioning -- key is also the distribution key in this case. create table mpp3061 (i int) partition by range(i); @@ -93,10 +89,11 @@ CREATE TABLE mpp7980_5 PARTITION of mpp7980 for values from ('2009-06-01') to (' CREATE TABLE mpp7980_6 PARTITION of mpp7980 for values from ('2009-07-01') to ('2009-08-01'); -- TEST select count_operator('select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select cust_type, subscription_status... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1'); insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1'); insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1'); @@ -133,10 +130,11 @@ insert into mpp23195_t1 values (generate_series(1,19)); insert into mpp23195_t2 values (1); -- TEST select find_operator('select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan'); -ERROR: function find_operator(unknown, unknown) does not exist -LINE 1: select find_operator('select * from mpp23195_t1,mpp23195_t2 ... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + find_operator +--------------- + ['false'] +(1 row) + select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i; i | i ---+--- @@ -189,15 +187,17 @@ create table mpp21834_t2(i int, j int); -- TEST set polar_px_optimizer_enable_hashjoin = off; select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan'); -ERROR: function find_operator(unknown, unknown) does not exist -LINE 1: select find_operator('analyze select * from mpp21834_t2,mpp2... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + find_operator +--------------- + ['false'] +(1 row) + select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop'); -ERROR: function find_operator(unknown, unknown) does not exist -LINE 1: select find_operator('analyze select * from mpp21834_t2,mpp2... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + find_operator +--------------- + ['true'] +(1 row) + -- CLEANUP drop index index_2; drop index index_1; @@ -222,10 +222,11 @@ insert into mpp23288(a) select generate_series(1,20); analyze mpp23288; -- TEST select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Seq Scan'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select t2.a, t1.a from mpp23288 as t1... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a; a | a ----+--- @@ -268,10 +269,11 @@ select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2 (23 rows) select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Seq Scan'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select t2.a, t1.a from mpp23288 as t1... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a; a | a ----+---- @@ -334,10 +336,11 @@ select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t (28 rows) select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Seq Scan'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select t2.a, t1.a from mpp23288 as t1... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a; a | a ---+---- @@ -592,10 +595,11 @@ set polar_px_optimizer_enable_dynamictablescan = off; -- implemented during the v12 merge, I'm not sure if this test is testing anything -- useful anymore. And/or it redundant with the tests in 'dpe'? select count_operator('select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','-> Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from mpp24151_t, mpp24151_pt... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = 'hello0' order by tid, mpp24151_t.dist, mpp24151_pt.dist; dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid @@ -887,55 +891,65 @@ analyze p3; analyze p; -- TEST select count_operator('select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 excep... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 excep... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 inter... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select count_operator('select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from (select * from p1 union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + -- CLEANUP -- start_ignore drop table t; @@ -994,10 +1008,11 @@ create index dbs_index on dbs using bitmap(c3); ERROR: access method "bitmap" does not exist -- TEST select find_operator('(select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Seq Scan'); -ERROR: function find_operator(unknown, unknown) does not exist -LINE 1: select find_operator('(select * from dts where c2 = 1) union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + find_operator +--------------- + ['false'] +(1 row) + (select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union @@ -1071,10 +1086,11 @@ HINT: No function matches the given name and argument types. You might need to set polar_px_optimizer_enable_dynamictablescan = off; select find_operator('(select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan'); -ERROR: function find_operator(unknown, unknown) does not exist -LINE 1: select find_operator('(select * from dis where c3 = 1) union... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + find_operator +--------------- + ['false'] +(1 row) + (select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union @@ -1417,10 +1433,11 @@ HINT: No function matches the given name and argument types. You might need to (323 rows) select find_operator('select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Heap Scan'); -ERROR: function find_operator(unknown, unknown) does not exist -LINE 1: select find_operator('select * from dbs where c2= 15 and c3 ... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + find_operator +--------------- + ['false'] +(1 row) + select * from dbs where c2= 15 and c3 = 5; c1 | c2 | c3 ----+----+---- @@ -1468,10 +1485,11 @@ select * from pp where b=2 and c=2; (0 rows) select count_operator('select * from pp where b=2 and c=2;','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from pp where b=2 and c=2;',... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + -- CLEANUP -- start_ignore drop index if exists pp_rest_2_idx; @@ -1521,10 +1539,11 @@ select * from ds_4 where month_id = '200800'; (7 rows) select count_operator('select * from ds_4 where month_id = E''200800'';','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from ds_4 where month_id = E... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select * from ds_4 where month_id > '200800'; month_id | cust_group_acc | mobile_no ----------+----------------+----------- @@ -1548,10 +1567,11 @@ select * from ds_4 where month_id > '200800'; (13 rows) select count_operator('select * from ds_4 where month_id > E''200800'';','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from ds_4 where month_id > E... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select * from ds_4 where month_id <= '200800'; month_id | cust_group_acc | mobile_no ----------+----------------+----------- @@ -1569,10 +1589,11 @@ select * from ds_4 where month_id <= '200800'; (7 rows) select count_operator('select * from ds_4 where month_id <= E''200800'';','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from ds_4 where month_id <= ... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > '200800'; month_id | cust_group_acc | mobile_no | month_id | cust_group_acc | mobile_no ----------+----------------+-----------+----------+----------------+----------- @@ -1616,10 +1637,11 @@ select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > (33 rows) select count_operator('select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('select * from ds_4 a1,ds_4 a2 where a... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 0 +(1 row) + -- CLEANUP -- start_ignore DROP TABLE IF EXISTS ds_4; @@ -2005,10 +2027,11 @@ CREATE TABLE mpp6247_foo_10 PARTITION of mpp6247_foo for values from ('2009-05-1 create table mpp6247_bar (like mpp6247_foo); -- EXPECT: Single HJ after partition elimination instead of sequence of HJ under Append select count_operator('delete from mpp6247_foo using mpp6247_bar where mpp6247_foo.c1 = mpp6247_bar.c1 and mpp6247_foo.dt = ''2009-05-03''', 'Hash Join'); -ERROR: function count_operator(unknown, unknown) does not exist -LINE 1: select count_operator('delete from mpp6247_foo using mpp6247... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. + count_operator +---------------- + 1 +(1 row) + drop table mpp6247_bar; drop table mpp6247_foo; -- CLEANUP diff --git a/src/test/regress/px_expected/polar-px-dev/gporca.out b/src/test/regress/px_expected/polar-px-dev/gporca.out index 504601ba61e..197d2a2f647 100644 --- a/src/test/regress/px_expected/polar-px-dev/gporca.out +++ b/src/test/regress/px_expected/polar-px-dev/gporca.out @@ -16145,7 +16145,7 @@ drop table can_set_tag_target; drop table can_set_tag_audit; -- start_ignore create language plpython3u; -ERROR: could not access file "$libdir/plpython3": No such file or directory +ERROR: language "plpython3u" already exists -- end_ignore -- Checking if ORCA uses parser's canSetTag for CREATE TABLE AS SELECT create or replace function canSetTag_Func(x int) returns int as $$ @@ -16154,8 +16154,6 @@ create or replace function canSetTag_Func(x int) returns int as $$ else: return x * 3 $$ language plpython3u; -ERROR: language "plpython3u" does not exist -HINT: Use CREATE EXTENSION to load the language into the database. create table canSetTag_input_data (domain integer, class integer, attr text, value integer) ; insert into canSetTag_input_data values(1, 1, 'A', 1); @@ -16164,14 +16162,8 @@ insert into canSetTag_input_data values(3, 0, 'B', 1); create table canSetTag_bug_table as SELECT attr, class, (select canSetTag_Func(count(distinct class)::int) from canSetTag_input_data) as dclass FROM canSetTag_input_data GROUP BY attr, class ; -ERROR: function cansettag_func(integer) does not exist -LINE 2: SELECT attr, class, (select canSetTag_Func(count(distinct cl... - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. drop function canSetTag_Func(x int); -ERROR: function cansettag_func(integer) does not exist drop table canSetTag_bug_table; -ERROR: table "cansettag_bug_table" does not exist drop table canSetTag_input_data; -- Test B-Tree index scan with in list CREATE TABLE btree_test as SELECT i a, i b FROM generate_series(1,100) i ; diff --git a/src/test/regress/px_expected/polar-px-dev/qp_with_functional_inlining.out b/src/test/regress/px_expected/polar-px-dev/qp_with_functional_inlining.out index 5d3242e0b16..842f677d92c 100644 --- a/src/test/regress/px_expected/polar-px-dev/qp_with_functional_inlining.out +++ b/src/test/regress/px_expected/polar-px-dev/qp_with_functional_inlining.out @@ -46,8 +46,8 @@ set search_path='qp_with_functional_inlining'; -- end_matchsubs -- start_ignore /*--EXPLAIN_QUERY_BEGIN*/ -CREATE LANGUAGE plpythonu; -psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpythonu" already exists +CREATE LANGUAGE plpython3u; +psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpython3u" already exists -- end_ignore CREATE TABLE foo AS SELECT i as a, i+1 as b from generate_series(1,10)i; CREATE TABLE bar AS SELECT i as c, i+1 as d from generate_series(1,10)i; diff --git a/src/test/regress/px_expected/polar-px-dev/qp_with_functional_noinlining.out b/src/test/regress/px_expected/polar-px-dev/qp_with_functional_noinlining.out index 471b2d505ac..1f1382bddcf 100644 --- a/src/test/regress/px_expected/polar-px-dev/qp_with_functional_noinlining.out +++ b/src/test/regress/px_expected/polar-px-dev/qp_with_functional_noinlining.out @@ -45,8 +45,8 @@ set search_path='qp_with_functional_noinlining'; -- end_matchsubs -- start_ignore /*--EXPLAIN_QUERY_BEGIN*/ -CREATE LANGUAGE plpythonu; -psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpythonu" already exists +CREATE LANGUAGE plpython3u; +psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpython3u" already exists -- end_ignore CREATE TABLE foo AS SELECT i as a, i+1 as b from generate_series(1,10)i; CREATE TABLE bar AS SELECT i as c, i+1 as d from generate_series(1,10)i; diff --git a/src/test/regress/sql/polar-px-dev/bfv_aggregate.sql b/src/test/regress/sql/polar-px-dev/bfv_aggregate.sql index 027178f8787..02f8e790b9f 100644 --- a/src/test/regress/sql/polar-px-dev/bfv_aggregate.sql +++ b/src/test/regress/sql/polar-px-dev/bfv_aggregate.sql @@ -92,7 +92,7 @@ insert into t values(3,array[3],'b'); select f3, array_sort(myaggp20a(f1)) from t group by f3 order by f3; -- start_ignore -create language plpythonu; +create language plpython3u; -- end_ignore create or replace function count_operator(query text, operator text) returns int as $$ @@ -105,7 +105,7 @@ for i in range(len(rv)): result = result+1 return result $$ -language plpythonu; +language plpython3u; -- -- Testing adding a traceflag to favor multi-stage aggregation diff --git a/src/test/regress/sql/polar-px-dev/bfv_index.sql b/src/test/regress/sql/polar-px-dev/bfv_index.sql index d7460f53aae..add64f54c63 100644 --- a/src/test/regress/sql/polar-px-dev/bfv_index.sql +++ b/src/test/regress/sql/polar-px-dev/bfv_index.sql @@ -121,7 +121,7 @@ WHERE ft.wk_id = dt.wk_id AND ft.id = dt1.id; -- start_ignore -create language plpythonu; +create language plpython3u; -- end_ignore create or replace function count_index_scans(explain_query text) returns int as @@ -135,7 +135,7 @@ for i in range(len(rv)): result = result+1 return result $$ -language plpythonu; +language plpython3u; DROP TABLE bfv_tab1; DROP TABLE bfv_tab2_facttable1; diff --git a/src/test/regress/sql/polar-px-dev/bfv_partition_plans.sql b/src/test/regress/sql/polar-px-dev/bfv_partition_plans.sql index cd33e26ccc7..c49f173522f 100644 --- a/src/test/regress/sql/polar-px-dev/bfv_partition_plans.sql +++ b/src/test/regress/sql/polar-px-dev/bfv_partition_plans.sql @@ -11,7 +11,7 @@ set search_path=bfv_partition_plans; -- Initial setup for all the partitioning test for this suite -- -- start_ignore -CREATE LANGUAGE plpythonu; +CREATE LANGUAGE plpython3u; -- end_ignore create or replace function count_operator(query text, operator text) returns int as diff --git a/src/test/regress/sql/polar-px-dev/qp_with_functional.sql b/src/test/regress/sql/polar-px-dev/qp_with_functional.sql index 0d418214cb7..60b56064b46 100644 --- a/src/test/regress/sql/polar-px-dev/qp_with_functional.sql +++ b/src/test/regress/sql/polar-px-dev/qp_with_functional.sql @@ -37,7 +37,7 @@ -- start_ignore /*--EXPLAIN_QUERY_BEGIN*/ -CREATE LANGUAGE plpythonu; +CREATE LANGUAGE plpython3u; -- end_ignore CREATE TABLE foo AS SELECT i as a, i+1 as b from generate_series(1,10)i;