Re: [HACKERS] pgcrypto deprecated functions?

2006-09-05 Thread Marko Kreen

On 8/30/06, Bruce Momjian [EMAIL PROTECTED] wrote:

Michael Fuhr wrote:
 In README.pgcrypto, Section 2.3 Deprecated functions says that
 digest_exists(), hmac_exists(), and cipher_exists() are planned to
 be removed in PostgreSQL 8.2.  Those functions still exist -- should
 they be removed or does that section need updating?

Marko, any comment on this pgcrypto item?


Heh, I had it forgotten.  Lets do it.  Although there's no hurry with it,
delaying just will annoy more users.

Also, update my email address.

--
marko
Index: contrib/pgcrypto/README.pgcrypto
===
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/README.pgcrypto,v
retrieving revision 1.17
diff -u -c -r1.17 README.pgcrypto
*** contrib/pgcrypto/README.pgcrypto	5 Aug 2006 00:29:11 -	1.17
--- contrib/pgcrypto/README.pgcrypto	5 Sep 2006 08:29:58 -
***
*** 1,6 
  pgcrypto - cryptographic functions for PostgreSQL
  =
! Marko Kreen marko@l-t.ee
  
  // Note: this document is in asciidoc format.
  
--- 1,6 
  pgcrypto - cryptographic functions for PostgreSQL
  =
! Marko Kreen [EMAIL PROTECTED]
  
  // Note: this document is in asciidoc format.
  
***
*** 79,92 
  are NULL.  This may create security risks on careless usage.
  
  
! 2.3.  Deprecated functions
! ~~~
! 
! The `digest_exists()`, `hmac_exists()` and `cipher_exists()` functions
! are deprecated.  The plan is to remove them in PostgreSQL 8.2.
! 
! 
! 2.4.  Security
  ~~~
  
  All the functions here run inside database server.  That means that all
--- 79,85 
  are NULL.  This may create security risks on careless usage.
  
  
! 2.3.  Security
  ~~~
  
  All the functions here run inside database server.  That means that all
Index: contrib/pgcrypto/pgcrypto.c
===
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/pgcrypto.c,v
retrieving revision 1.22
diff -u -c -r1.22 pgcrypto.c
*** contrib/pgcrypto/pgcrypto.c	13 Jul 2006 04:15:25 -	1.22
--- contrib/pgcrypto/pgcrypto.c	5 Sep 2006 08:28:23 -
***
*** 87,118 
  	PG_RETURN_BYTEA_P(res);
  }
  
- /* check if given hash exists */
- PG_FUNCTION_INFO_V1(pg_digest_exists);
- 
- Datum
- pg_digest_exists(PG_FUNCTION_ARGS)
- {
- 	text	   *name;
- 	PX_MD	   *res;
- 
- 	if (PG_ARGISNULL(0))
- 		PG_RETURN_NULL();
- 
- 	name = PG_GETARG_TEXT_P(0);
- 
- 	res = find_provider(name, (PFN) px_find_digest, Digest, 1);
- 
- 	PG_FREE_IF_COPY(name, 0);
- 
- 	if (res == NULL)
- 		PG_RETURN_BOOL(false);
- 
- 	res-free(res);
- 
- 	PG_RETURN_BOOL(true);
- }
- 
  /* SQL function: hmac(data:bytea, key:bytea, type:text) returns bytea */
  PG_FUNCTION_INFO_V1(pg_hmac);
  
--- 87,92 
***
*** 158,189 
  	PG_RETURN_BYTEA_P(res);
  }
  
- /* check if given hmac type exists */
- PG_FUNCTION_INFO_V1(pg_hmac_exists);
- 
- Datum
- pg_hmac_exists(PG_FUNCTION_ARGS)
- {
- 	text	   *name;
- 	PX_HMAC*h;
- 
- 	if (PG_ARGISNULL(0))
- 		PG_RETURN_NULL();
- 
- 	name = PG_GETARG_TEXT_P(0);
- 
- 	h = find_provider(name, (PFN) px_find_hmac, HMAC, 1);
- 
- 	PG_FREE_IF_COPY(name, 0);
- 
- 	if (h != NULL)
- 	{
- 		px_hmac_free(h);
- 		PG_RETURN_BOOL(true);
- 	}
- 	PG_RETURN_BOOL(false);
- }
- 
  
  /* SQL function: pg_gen_salt(text) returns text */
  PG_FUNCTION_INFO_V1(pg_gen_salt);
--- 132,137 
***
*** 565,591 
  	PG_RETURN_BYTEA_P(res);
  }
  
- /* SQL function: pg_cipher_exists(text) returns bool */
- PG_FUNCTION_INFO_V1(pg_cipher_exists);
- 
- Datum
- pg_cipher_exists(PG_FUNCTION_ARGS)
- {
- 	text	   *arg;
- 	PX_Combo   *c;
- 
- 	if (PG_ARGISNULL(0))
- 		PG_RETURN_NULL();
- 
- 	arg = PG_GETARG_TEXT_P(0);
- 
- 	c = find_provider(arg, (PFN) px_find_combo, Cipher, 1);
- 	if (c != NULL)
- 		px_combo_free(c);
- 
- 	PG_RETURN_BOOL((c != NULL) ? true : false);
- }
- 
  static void *
  find_provider(text *name,
  			  PFN provider_lookup,
--- 513,518 
Index: contrib/pgcrypto/pgcrypto.h
===
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/pgcrypto.h,v
retrieving revision 1.10
diff -u -c -r1.10 pgcrypto.h
*** contrib/pgcrypto/pgcrypto.h	13 Jul 2006 04:15:25 -	1.10
--- contrib/pgcrypto/pgcrypto.h	5 Sep 2006 08:27:28 -
***
*** 36,44 
  
  /* exported functions */
  Datum		pg_digest(PG_FUNCTION_ARGS);
- Datum		pg_digest_exists(PG_FUNCTION_ARGS);
  Datum		pg_hmac(PG_FUNCTION_ARGS);
- Datum		pg_hmac_exists(PG_FUNCTION_ARGS);
  Datum		pg_gen_salt(PG_FUNCTION_ARGS);
  Datum		pg_gen_salt_rounds(PG_FUNCTION_ARGS);
  Datum		pg_crypt(PG_FUNCTION_ARGS);
--- 36,42 
***
*** 46,52 
  Datum		pg_decrypt(PG_FUNCTION_ARGS);
  Datum		pg_encrypt_iv(PG_FUNCTION_ARGS);
  Datum		pg_decrypt_iv(PG_FUNCTION_ARGS);
- Datum		pg_cipher_exists(PG_FUNCTION_ARGS);
  

Re: [HACKERS] pgcrypto deprecated functions?

2006-09-05 Thread Tom Lane
Marko Kreen [EMAIL PROTECTED] writes:
 On 8/30/06, Bruce Momjian [EMAIL PROTECTED] wrote:
 Michael Fuhr wrote:
 In README.pgcrypto, Section 2.3 Deprecated functions says that
 digest_exists(), hmac_exists(), and cipher_exists() are planned to
 be removed in PostgreSQL 8.2.  Those functions still exist -- should
 they be removed or does that section need updating?
 
 Marko, any comment on this pgcrypto item?

 Heh, I had it forgotten.  Lets do it.  Although there's no hurry with it,
 delaying just will annoy more users.
 Also, update my email address.

Applied, thanks.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] pgcrypto deprecated functions?

2006-09-05 Thread Bruce Momjian
Tom Lane wrote:
 Marko Kreen [EMAIL PROTECTED] writes:
  On 8/30/06, Bruce Momjian [EMAIL PROTECTED] wrote:
  Michael Fuhr wrote:
  In README.pgcrypto, Section 2.3 Deprecated functions says that
  digest_exists(), hmac_exists(), and cipher_exists() are planned to
  be removed in PostgreSQL 8.2.  Those functions still exist -- should
  they be removed or does that section need updating?
  
  Marko, any comment on this pgcrypto item?
 
  Heh, I had it forgotten.  Lets do it.  Although there's no hurry with it,
  delaying just will annoy more users.
  Also, update my email address.
 
 Applied, thanks.

FYI, and email address updated.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] pgcrypto deprecated functions?

2006-08-30 Thread Bruce Momjian
Michael Fuhr wrote:
 In README.pgcrypto, Section 2.3 Deprecated functions says that
 digest_exists(), hmac_exists(), and cipher_exists() are planned to
 be removed in PostgreSQL 8.2.  Those functions still exist -- should
 they be removed or does that section need updating?

Marko, any comment on this pgcrypto item?

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] pgcrypto deprecated functions?

2006-08-25 Thread Bruce Momjian
Michael Fuhr wrote:
 In README.pgcrypto, Section 2.3 Deprecated functions says that
 digest_exists(), hmac_exists(), and cipher_exists() are planned to
 be removed in PostgreSQL 8.2.  Those functions still exist -- should
 they be removed or does that section need updating?

Yes, I see this text:

The `digest_exists()`, `hmac_exists()` and `cipher_exists()` functions
are deprecated.  The plan is to remove them in PostgreSQL 8.2.

Would someone address this?

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq