Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRUB3-000000010hQ-1AyV for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2026 12:45:17 +0000 Received: from localhost ([127.0.0.1]:58130 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xRUB1-0000000GMHW-0QjH for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2026 12:45:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:38204) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRUB0-0000000GMHO-2Wg1 for pgsql-bugs@lists.postgresql.org; Thu, 12 Nov 2026 12:45:14 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRUAy-00000000XmY-0znw for pgsql-bugs@lists.postgresql.org; Thu, 12 Nov 2026 12:45:13 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id D46F67C518B for ; Thu, 12 Nov 2026 13:45:08 +0100 (CET) Received: from s934.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id C565A7C5E51; Thu, 12 Nov 2026 13:45:08 +0100 (CET) Received: from localhost (unknown [172.22.191.6]) by s934.loopia.se (Postfix) with ESMTP id C31B31A35F09; Thu, 12 Nov 2026 13:45:08 +0100 (CET) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s473.loopia.se (amavis); dkim=pass (2048-bit key) header.d=yesql.se Received: from s980.loopia.se ([172.22.191.6]) by localhost (s473.loopia.se [172.22.190.13]) (amavis, port 10024) with UTF8LMTP id sxbmE1-Px-GY; Thu, 12 Nov 2026 13:45:08 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s980.loopia.se (Postfix) with ESMTPSA id 41DEE220167E; Thu, 12 Nov 2026 13:45:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1794487508; bh=2WGCt+szR2dV0HP+7iK70ch68j4HR92BLFLYIoPDjVQ=; h=From:Subject:Date:In-Reply-To:Cc:To:References; b=QWzzVj2x4uTAPKcTxhSzApI9DKfz/9sAWac3MQq2ACfaQrBiI777JDR4M1LHSKBb+ iSYvrj/e772Nvg65GOGSEjSLoyqhoIv7YgXdxDUfRFm2HIgzQ89Gj4YaIJ+3bKenyU tgCk8BVxVGyz4d68oA5Kf66dMeYRksNSwPE1ZXV+g64AIIE/3dTd9dPPeQ61uhbY0b Oi7egqWBR8bhR6JGsS5NrxeT3x4gSaRmB+THLvHcPV5TFYkk/Oz1mpMP5LfxkcCVg2 15cOcEwPGFTHHqNItbnzDnmMnLEzoOPUZbIOJ3IubGyRiB2tXt4NSskSSQa+ykHzsz aL6RN4fgCcDMQ== From: Daniel Gustafsson Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_751ED864-2A65-41EC-99DB-D12286C2DF53" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.12\)) Subject: Re: BUG #19714: pgcrypto pgp_sym_encrypt accepts nonnumeric s2k-mode as mode 0 Date: Thu, 12 Nov 2026 13:44:57 +0100 In-Reply-To: Cc: Sho Ito , imchifan@163.com, pgsql-bugs@lists.postgresql.org To: shihao zhong References: <19714-2c7439b39f73bde9@postgresql.org> X-Mailer: Apple Mail (2.3776.700.51.11.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_751ED864-2A65-41EC-99DB-D12286C2DF53 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 11 Nov 2026, at 02:03, shihao zhong wrote: > Thanks for v2. expect-s2k-mode now goes through PARSE_INT_AS_BOOL, so > the existing expect-s2k-mode=3D3 tests in pgp-encrypt fail.=20 Yes, fixed in the attached. I also expanded the check for compression which allows the undocumented = (and not working) bzip2 option now as well which the previous coding did. = Attached is what I have lined up for later today. -- Daniel Gustafsson --Apple-Mail=_751ED864-2A65-41EC-99DB-D12286C2DF53 Content-Disposition: attachment; filename=v3-0001-pgcrypto-reject-invalid-PGP-options.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v3-0001-pgcrypto-reject-invalid-PGP-options.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f4f8fa3aa1f8667c20b2c640654294e88c312898=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Gustafsson=20= =0ADate:=20Thu,=2012=20Nov=202026=2013:41:31=20= +0100=0ASubject:=20[PATCH=20v3]=20pgcrypto:=20reject=20invalid=20PGP=20= options=0A=0AThe=20PGP=20option=20parser=20used=20atoi()=20for=20integer=20= options=20which=20would=0Aconvert=20non-numeric=20options=20to=200.=20=20= Since=200=20is=20a=20legitimate=20input=0Avalue=20for=20the=20PGP=20= options=20this=20would=20mask=20invalid=20input.=20=20In=20most=0Acases=20= that=20was=20not=20a=20problem=20as=200=20was=20the=20default,=20= s2k-mode=20used=0A3=20as=20the=20default=20however=20with=200=20being=20= a=20weaker=20option.=20=20Fix=20by=0Ausing=20strtoint()=20to=20parse=20= the=20input=20instead=20and=20reject=20invalid=0Aor=20out-of-range=20= values.=20=20Also=20create=20macros=20for=20magic=20numbers=20to=0A= improve=20readability=20and=20greppability.=0A=0ABug:=20#19714=0AAuthor:=20= Shihao=20Zhong=20=0AReviewed-by:=20Sho=20Ito=20= =0AReported-by:=20Qifan=20Liu=20=0A= Discussion:=20https://postgr.es/m/19714-2c7439b39f73bde9@postgresql.org=0A= Backpatch-through:=2015=0A---=0A=20= contrib/pgcrypto/expected/pgp-encrypt.out=20=20=20|=20=207=20+++=0A=20= contrib/pgcrypto/expected/pgp-encrypt_1.out=20|=20=207=20+++=0A=20= contrib/pgcrypto/pgp-pgsql.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=2059=20+++++++++++++++------=0A=20contrib/pgcrypto/pgp.c=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=203=20+-=0A=20= contrib/pgcrypto/pgp.h=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20|=20=203=20++=0A=20contrib/pgcrypto/sql/pgp-encrypt.sql=20= =20=20=20=20=20=20=20|=20=205=20++=0A=206=20files=20changed,=2067=20= insertions(+),=2017=20deletions(-)=0A=0Adiff=20--git=20= a/contrib/pgcrypto/expected/pgp-encrypt.out=20= b/contrib/pgcrypto/expected/pgp-encrypt.out=0Aindex=20= 50cd3f6daa0..a6ca7334079=20100644=0A---=20= a/contrib/pgcrypto/expected/pgp-encrypt.out=0A+++=20= b/contrib/pgcrypto/expected/pgp-encrypt.out=0A@@=20-120,6=20+120,13=20@@=20= NOTICE:=20=20pgp_decrypt:=20unexpected=20s2k_count:=20expected=20= 65000000=20got=2065011712=0A=20=20Secret.=0A=20(1=20row)=0A=20=0A+--=20= integer=20options=20must=20be=20valid=20integers=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-mode=3Dnot_a_number');=0A= +ERROR:=20=20Illegal=20argument=20to=20function=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-mode=3D3x');=0A+ERROR:=20=20= Illegal=20argument=20to=20function=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-count=3D4294968320');=0A= +ERROR:=20=20Illegal=20argument=20to=20function=0A=20--=20s2k=20digest=20= change=0A=20select=20pgp_sym_decrypt(=0A=20=09=09= pgp_sym_encrypt('Secret.',=20'key',=20's2k-digest-algo=3Dsha1'),=0Adiff=20= --git=20a/contrib/pgcrypto/expected/pgp-encrypt_1.out=20= b/contrib/pgcrypto/expected/pgp-encrypt_1.out=0Aindex=20= 36b1052809c..e828300f415=20100644=0A---=20= a/contrib/pgcrypto/expected/pgp-encrypt_1.out=0A+++=20= b/contrib/pgcrypto/expected/pgp-encrypt_1.out=0A@@=20-116,6=20+116,13=20= @@=20NOTICE:=20=20pgp_decrypt:=20unexpected=20s2k_count:=20expected=20= 65000000=20got=2065011712=0A=20=20Secret.=0A=20(1=20row)=0A=20=0A+--=20= integer=20options=20must=20be=20valid=20integers=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-mode=3Dnot_a_number');=0A= +ERROR:=20=20Illegal=20argument=20to=20function=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-mode=3D3x');=0A+ERROR:=20=20= Illegal=20argument=20to=20function=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-count=3D4294968320');=0A= +ERROR:=20=20Illegal=20argument=20to=20function=0A=20--=20s2k=20digest=20= change=0A=20select=20pgp_sym_decrypt(=0A=20=09=09= pgp_sym_encrypt('Secret.',=20'key',=20's2k-digest-algo=3Dsha1'),=0Adiff=20= --git=20a/contrib/pgcrypto/pgp-pgsql.c=20b/contrib/pgcrypto/pgp-pgsql.c=0A= index=2005ef45fbe4c..3bfbed1b666=20100644=0A---=20= a/contrib/pgcrypto/pgp-pgsql.c=0A+++=20b/contrib/pgcrypto/pgp-pgsql.c=0A= @@=20-164,6=20+164,27=20@@=20show_debug(const=20char=20*msg)=0A=20=09= ereport(NOTICE,=20(errmsg("dbg:=20%s",=20msg)));=0A=20}=0A=20=0A+/*=0A+=20= *=20Parse=20the=20value=20of=20an=20integer=20option.=20=20Don't=20use=20= atoi()=20here,=20as=20it=20would=0A+=20*=20silently=20turn=20a=20value=20= like=20"foo"=20into=200,=20which=20for=20s2k-mode=20means=20no=20salt.=0A= +=20*/=0A+static=20int=0A+parse_int_arg(const=20char=20*val,=20int=20= min,=20int=20max)=0A+{=0A+=09char=09=20=20=20*endptr;=0A+=09int=09=09=09= result;=0A+=0A+=09errno=20=3D=200;=0A+=09result=20=3D=20strtoint(val,=20= &endptr,=2010);=0A+=09if=20(errno=20!=3D=200=20||=20endptr=20=3D=3D=20= val=20||=20*endptr=20!=3D=20'\0')=0A+=09=09= px_THROW_ERROR(PXE_ARGUMENT_ERROR);=0A+=09if=20(result=20<=20min=20||=20= result=20>=20max)=0A+=09=09px_THROW_ERROR(PXE_ARGUMENT_ERROR);=0A+=09= return=20result;=0A+}=0A+=0A+#define=20PARSE_INT_AS_BOOL(a)=09= parse_int_arg((a),=200,=201)=0A+=0A=20static=20int=0A=20= set_arg(PGP_Context=20*ctx,=20char=20*key,=20char=20*val,=0A=20=09=09= struct=20debug_expect=20*ex)=0A@@=20-173,34=20+194,40=20@@=20= set_arg(PGP_Context=20*ctx,=20char=20*key,=20char=20*val,=0A=20=09if=20= (strcmp(key,=20"cipher-algo")=20=3D=3D=200)=0A=20=09=09res=20=3D=20= pgp_set_cipher_algo(ctx,=20val);=0A=20=09else=20if=20(strcmp(key,=20= "disable-mdc")=20=3D=3D=200)=0A-=09=09res=20=3D=20pgp_disable_mdc(ctx,=20= atoi(val));=0A+=09=09res=20=3D=20pgp_disable_mdc(ctx,=20= PARSE_INT_AS_BOOL(val));=0A=20=09else=20if=20(strcmp(key,=20"sess-key")=20= =3D=3D=200)=0A-=09=09res=20=3D=20pgp_set_sess_key(ctx,=20atoi(val));=0A+=09= =09res=20=3D=20pgp_set_sess_key(ctx,=20PARSE_INT_AS_BOOL(val));=0A=20=09= else=20if=20(strcmp(key,=20"s2k-mode")=20=3D=3D=200)=0A-=09=09res=20=3D=20= pgp_set_s2k_mode(ctx,=20atoi(val));=0A+=09=09res=20=3D=20= pgp_set_s2k_mode(ctx,=20parse_int_arg(val,=0A+=09=09=09=09=09=09=09=09=09= =09=09=09=20=20PGP_S2K_SIMPLE,=0A+=09=09=09=09=09=09=09=09=09=09=09=09=20= =20PGP_S2K_ISALTED));=0A=20=09else=20if=20(strcmp(key,=20"s2k-count")=20= =3D=3D=200)=0A-=09=09res=20=3D=20pgp_set_s2k_count(ctx,=20atoi(val));=0A= +=09=09res=20=3D=20pgp_set_s2k_count(ctx,=20parse_int_arg(val,=0A+=09=09=09= =09=09=09=09=09=09=09=09=09=20=20=20PGP_S2K_COUNT_MIN,=0A+=09=09=09=09=09= =09=09=09=09=09=09=09=20=20=20PGP_S2K_COUNT_MAX));=0A=20=09else=20if=20= (strcmp(key,=20"s2k-digest-algo")=20=3D=3D=200)=0A=20=09=09res=20=3D=20= pgp_set_s2k_digest_algo(ctx,=20val);=0A=20=09else=20if=20(strcmp(key,=20= "s2k-cipher-algo")=20=3D=3D=200)=0A=20=09=09res=20=3D=20= pgp_set_s2k_cipher_algo(ctx,=20val);=0A=20=09else=20if=20(strcmp(key,=20= "compress-algo")=20=3D=3D=200)=0A-=09=09res=20=3D=20= pgp_set_compress_algo(ctx,=20atoi(val));=0A+=09=09res=20=3D=20= pgp_set_compress_algo(ctx,=20parse_int_arg(val,=0A+=09=09=09=09=09=09=09=09= =09=09=09=09=09=20=20=20PGP_COMPR_NONE,=0A+=09=09=09=09=09=09=09=09=09=09= =09=09=09=20=20=20PGP_COMPR_BZIP2));=0A=20=09else=20if=20(strcmp(key,=20= "compress-level")=20=3D=3D=200)=0A-=09=09res=20=3D=20= pgp_set_compress_level(ctx,=20atoi(val));=0A+=09=09res=20=3D=20= pgp_set_compress_level(ctx,=20parse_int_arg(val,=200,=209));=0A=20=09= else=20if=20(strcmp(key,=20"convert-crlf")=20=3D=3D=200)=0A-=09=09res=20= =3D=20pgp_set_convert_crlf(ctx,=20atoi(val));=0A+=09=09res=20=3D=20= pgp_set_convert_crlf(ctx,=20PARSE_INT_AS_BOOL(val));=0A=20=09else=20if=20= (strcmp(key,=20"unicode-mode")=20=3D=3D=200)=0A-=09=09res=20=3D=20= pgp_set_unicode_mode(ctx,=20atoi(val));=0A+=09=09res=20=3D=20= pgp_set_unicode_mode(ctx,=20PARSE_INT_AS_BOOL(val));=0A=20=09else=20if=20= (strcmp(key,=20"ignore-cipher-failure")=20=3D=3D=200)=0A-=09=09res=20=3D=20= pgp_set_ignore_cipher_failure(ctx,=20atoi(val));=0A+=09=09res=20=3D=20= pgp_set_ignore_cipher_failure(ctx,=20PARSE_INT_AS_BOOL(val));=0A=20=0A=20= =09/*=0A=20=09=20*=20The=20remaining=20options=20are=20for=20= debugging/testing=20and=20are=20therefore=20not=0A=20=09=20*=20= documented=20in=20the=20user-facing=20docs.=0A=20=09=20*/=0A=20=09else=20= if=20(ex=20!=3D=20NULL=20&&=20strcmp(key,=20"debug")=20=3D=3D=200)=0A-=09= =09ex->debug=20=3D=20atoi(val);=0A+=09=09ex->debug=20=3D=20= PARSE_INT_AS_BOOL(val);=0A=20=09else=20if=20(ex=20!=3D=20NULL=20&&=20= strcmp(key,=20"expect-cipher-algo")=20=3D=3D=200)=0A=20=09{=0A=20=09=09= ex->expect=20=3D=201;=0A@@=20-209,22=20+236,22=20@@=20= set_arg(PGP_Context=20*ctx,=20char=20*key,=20char=20*val,=0A=20=09else=20= if=20(ex=20!=3D=20NULL=20&&=20strcmp(key,=20"expect-disable-mdc")=20=3D=3D= =200)=0A=20=09{=0A=20=09=09ex->expect=20=3D=201;=0A-=09=09= ex->disable_mdc=20=3D=20atoi(val);=0A+=09=09ex->disable_mdc=20=3D=20= PARSE_INT_AS_BOOL(val);=0A=20=09}=0A=20=09else=20if=20(ex=20!=3D=20NULL=20= &&=20strcmp(key,=20"expect-sess-key")=20=3D=3D=200)=0A=20=09{=0A=20=09=09= ex->expect=20=3D=201;=0A-=09=09ex->use_sess_key=20=3D=20atoi(val);=0A+=09= =09ex->use_sess_key=20=3D=20PARSE_INT_AS_BOOL(val);=0A=20=09}=0A=20=09= else=20if=20(ex=20!=3D=20NULL=20&&=20strcmp(key,=20"expect-s2k-mode")=20= =3D=3D=200)=0A=20=09{=0A=20=09=09ex->expect=20=3D=201;=0A-=09=09= ex->s2k_mode=20=3D=20atoi(val);=0A+=09=09ex->s2k_mode=20=3D=20= parse_int_arg(val,=20PGP_S2K_SIMPLE,=20PGP_S2K_ISALTED);=0A=20=09}=0A=20=09= else=20if=20(ex=20!=3D=20NULL=20&&=20strcmp(key,=20"expect-s2k-count")=20= =3D=3D=200)=0A=20=09{=0A=20=09=09ex->expect=20=3D=201;=0A-=09=09= ex->s2k_count=20=3D=20atoi(val);=0A+=09=09ex->s2k_count=20=3D=20= parse_int_arg(val,=20PGP_S2K_COUNT_MIN,=20PGP_S2K_COUNT_MAX);=0A=20=09}=0A= =20=09else=20if=20(ex=20!=3D=20NULL=20&&=20strcmp(key,=20= "expect-s2k-digest-algo")=20=3D=3D=200)=0A=20=09{=0A@@=20-239,12=20= +266,12=20@@=20set_arg(PGP_Context=20*ctx,=20char=20*key,=20char=20*val,=0A= =20=09else=20if=20(ex=20!=3D=20NULL=20&&=20strcmp(key,=20= "expect-compress-algo")=20=3D=3D=200)=0A=20=09{=0A=20=09=09ex->expect=20= =3D=201;=0A-=09=09ex->compress_algo=20=3D=20atoi(val);=0A+=09=09= ex->compress_algo=20=3D=20parse_int_arg(val,=20PGP_COMPR_NONE,=20= PGP_COMPR_BZIP2);=0A=20=09}=0A=20=09else=20if=20(ex=20!=3D=20NULL=20&&=20= strcmp(key,=20"expect-unicode-mode")=20=3D=3D=200)=0A=20=09{=0A=20=09=09= ex->expect=20=3D=201;=0A-=09=09ex->unicode_mode=20=3D=20atoi(val);=0A+=09= =09ex->unicode_mode=20=3D=20PARSE_INT_AS_BOOL(val);=0A=20=09}=0A=20=09= else=0A=20=09=09res=20=3D=20PXE_ARGUMENT_ERROR;=0Adiff=20--git=20= a/contrib/pgcrypto/pgp.c=20b/contrib/pgcrypto/pgp.c=0Aindex=20= e3c9e5fb394..1ea06addba8=20100644=0A---=20a/contrib/pgcrypto/pgp.c=0A+++=20= b/contrib/pgcrypto/pgp.c=0A@@=20-264,7=20+264,8=20@@=20= pgp_set_s2k_mode(PGP_Context=20*ctx,=20int=20mode)=0A=20int=0A=20= pgp_set_s2k_count(PGP_Context=20*ctx,=20int=20count)=0A=20{=0A-=09if=20= (ctx->s2k_mode=20=3D=3D=20PGP_S2K_ISALTED=20&&=20count=20>=3D=201024=20= &&=20count=20<=3D=2065011712)=0A+=09if=20(ctx->s2k_mode=20=3D=3D=20= PGP_S2K_ISALTED=20&&=0A+=09=09count=20>=3D=20PGP_S2K_COUNT_MIN=20&&=20= count=20<=3D=20PGP_S2K_COUNT_MAX)=0A=20=09{=0A=20=09=09ctx->s2k_count=20= =3D=20count;=0A=20=09=09return=20PXE_OK;=0Adiff=20--git=20= a/contrib/pgcrypto/pgp.h=20b/contrib/pgcrypto/pgp.h=0Aindex=20= 3c4610608d1..b7ec6af2a26=20100644=0A---=20a/contrib/pgcrypto/pgp.h=0A+++=20= b/contrib/pgcrypto/pgp.h=0A@@=20-114,6=20+114,9=20@@=20enum=20= PGP_DIGEST_TYPE=0A=20#define=20PGP_MAX_DIGEST=20(512/8)=0A=20#define=20= PGP_S2K_SALT=20=20=208=0A=20=0A+#define=20PGP_S2K_COUNT_MIN=201024=0A= +#define=20PGP_S2K_COUNT_MAX=2065011712=0A+=0A=20typedef=20struct=20= PGP_MPI=20PGP_MPI;=0A=20typedef=20struct=20PGP_PubKey=20PGP_PubKey;=0A=20= typedef=20struct=20PGP_Context=20PGP_Context;=0Adiff=20--git=20= a/contrib/pgcrypto/sql/pgp-encrypt.sql=20= b/contrib/pgcrypto/sql/pgp-encrypt.sql=0Aindex=20= f67329c2c30..e806f5761af=20100644=0A---=20= a/contrib/pgcrypto/sql/pgp-encrypt.sql=0A+++=20= b/contrib/pgcrypto/sql/pgp-encrypt.sql=0A@@=20-62,6=20+62,11=20@@=20= select=20pgp_sym_decrypt(=0A=20=09pgp_sym_encrypt('Secret.',=20'key',=20= 's2k-count=3D65000000'),=0A=20=09'key',=20'expect-s2k-count=3D65000000');=0A= =20=0A+--=20integer=20options=20must=20be=20valid=20integers=0A+select=20= pgp_sym_encrypt('Secret.',=20'key',=20's2k-mode=3Dnot_a_number');=0A= +select=20pgp_sym_encrypt('Secret.',=20'key',=20's2k-mode=3D3x');=0A= +select=20pgp_sym_encrypt('Secret.',=20'key',=20's2k-count=3D4294968320');= =0A+=0A=20--=20s2k=20digest=20change=0A=20select=20pgp_sym_decrypt(=0A=20= =09=09pgp_sym_encrypt('Secret.',=20'key',=20's2k-digest-algo=3Dsha1'),=0A= --=20=0A2.39.3=20(Apple=20Git-146)=0A=0A= --Apple-Mail=_751ED864-2A65-41EC-99DB-D12286C2DF53--