Re: contrib/pgcrypto functions not IMMUTABLE? - Mailing list pgsql-hackers

From Marko Kreen
Subject Re: contrib/pgcrypto functions not IMMUTABLE?
Date
Msg-id 20050703144318.GA23919@l-t.ee
Whole thread Raw
In response to Re: contrib/pgcrypto functions not IMMUTABLE?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: contrib/pgcrypto functions not IMMUTABLE?
List pgsql-hackers
On Sun, Jul 03, 2005 at 07:54:47AM -0600, Michael Fuhr wrote:
> I'll submit a patch.  Does the following look right?
> 
> digest         IMMUTABLE STRICT
> digest_exists  IMMUTABLE STRICT
> hmac           IMMUTABLE STRICT
> hmac_exists    IMMUTABLE STRICT
> crypt          IMMUTABLE STRICT
> gen_salt       VOLATILE STRICT
> encrypt        IMMUTABLE
> decrypt        IMMUTABLE
> encrypt_iv     IMMUTABLE
> decrypt_iv     IMMUTABLE
> cipher_exists  IMMUTABLE STRICT

Nice overview.  Now that I have them before me, I think crypt() should
stay also non-strict, as it also has delicate security properties.

Everything else is OK.

> In the functions marked STRICT, should I leave the PG_ARGISNULL()
> checks in place as a precaution?  Removing those checks could cause
> problems if people use the new code but have old (non-STRICT) catalog
> entries.

Good point.  Let them be.

Rather, could you make crypt, encrypt, decrypt return error for
NULL input?  With nice message, eg. "NULL input"...

Then this topic would be solved in one go.

-- 
marko



pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: contrib/pgcrypto functions not IMMUTABLE?
Next
From: Tom Lane
Date:
Subject: Re: Checkpoint cost, looks like it is WAL/CRC