Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d4838d

Browse files
committed
Remove pgcrypto functions that were deprecated and slated for removal.
Marko Kreen
1 parent7bae5a2 commit7d4838d

File tree

5 files changed

+6
-106
lines changed

5 files changed

+6
-106
lines changed

‎contrib/pgcrypto/README.pgcrypto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pgcrypto - cryptographic functions for PostgreSQL
22
=================================================
3-
Marko Kreen <marko@l-t.ee>
3+
Marko Kreen <markokr@gmail.com>
44

55
// Note: this document is in asciidoc format.
66

@@ -79,14 +79,7 @@ As standard in SQL, all functions return NULL, if any of the arguments
7979
are NULL. This may create security risks on careless usage.
8080

8181

82-
2.3. Deprecated functions
83-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
84-
85-
The `digest_exists()`, `hmac_exists()` and `cipher_exists()` functions
86-
are deprecated. The plan is to remove them in PostgreSQL 8.2.
87-
88-
89-
2.4. Security
82+
2.3. Security
9083
~~~~~~~~~~~~~~~
9184

9285
All the functions here run inside database server. That means that all
@@ -714,4 +707,4 @@ http://www.cs.ut.ee/~helger/crypto/[]::
714707
Collection of cryptology pointers.
715708

716709

717-
// $PostgreSQL: pgsql/contrib/pgcrypto/README.pgcrypto,v 1.17 2006/08/0500:29:11 neilc Exp $
710+
// $PostgreSQL: pgsql/contrib/pgcrypto/README.pgcrypto,v 1.18 2006/09/0521:26:48 tgl Exp $

‎contrib/pgcrypto/pgcrypto.c

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.22 2006/07/13 04:15:25 neilc Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.23 2006/09/05 21:26:48 tgl Exp $
3030
*/
3131

3232
#include"postgres.h"
@@ -87,32 +87,6 @@ pg_digest(PG_FUNCTION_ARGS)
8787
PG_RETURN_BYTEA_P(res);
8888
}
8989

90-
/* check if given hash exists */
91-
PG_FUNCTION_INFO_V1(pg_digest_exists);
92-
93-
Datum
94-
pg_digest_exists(PG_FUNCTION_ARGS)
95-
{
96-
text*name;
97-
PX_MD*res;
98-
99-
if (PG_ARGISNULL(0))
100-
PG_RETURN_NULL();
101-
102-
name=PG_GETARG_TEXT_P(0);
103-
104-
res=find_provider(name, (PFN)px_find_digest,"Digest",1);
105-
106-
PG_FREE_IF_COPY(name,0);
107-
108-
if (res==NULL)
109-
PG_RETURN_BOOL(false);
110-
111-
res->free(res);
112-
113-
PG_RETURN_BOOL(true);
114-
}
115-
11690
/* SQL function: hmac(data:bytea, key:bytea, type:text) returns bytea */
11791
PG_FUNCTION_INFO_V1(pg_hmac);
11892

@@ -158,32 +132,6 @@ pg_hmac(PG_FUNCTION_ARGS)
158132
PG_RETURN_BYTEA_P(res);
159133
}
160134

161-
/* check if given hmac type exists */
162-
PG_FUNCTION_INFO_V1(pg_hmac_exists);
163-
164-
Datum
165-
pg_hmac_exists(PG_FUNCTION_ARGS)
166-
{
167-
text*name;
168-
PX_HMAC*h;
169-
170-
if (PG_ARGISNULL(0))
171-
PG_RETURN_NULL();
172-
173-
name=PG_GETARG_TEXT_P(0);
174-
175-
h=find_provider(name, (PFN)px_find_hmac,"HMAC",1);
176-
177-
PG_FREE_IF_COPY(name,0);
178-
179-
if (h!=NULL)
180-
{
181-
px_hmac_free(h);
182-
PG_RETURN_BOOL(true);
183-
}
184-
PG_RETURN_BOOL(false);
185-
}
186-
187135

188136
/* SQL function: pg_gen_salt(text) returns text */
189137
PG_FUNCTION_INFO_V1(pg_gen_salt);
@@ -565,27 +513,6 @@ pg_random_bytes(PG_FUNCTION_ARGS)
565513
PG_RETURN_BYTEA_P(res);
566514
}
567515

568-
/* SQL function: pg_cipher_exists(text) returns bool */
569-
PG_FUNCTION_INFO_V1(pg_cipher_exists);
570-
571-
Datum
572-
pg_cipher_exists(PG_FUNCTION_ARGS)
573-
{
574-
text*arg;
575-
PX_Combo*c;
576-
577-
if (PG_ARGISNULL(0))
578-
PG_RETURN_NULL();
579-
580-
arg=PG_GETARG_TEXT_P(0);
581-
582-
c=find_provider(arg, (PFN)px_find_combo,"Cipher",1);
583-
if (c!=NULL)
584-
px_combo_free(c);
585-
586-
PG_RETURN_BOOL((c!=NULL) ? true : false);
587-
}
588-
589516
staticvoid*
590517
find_provider(text*name,
591518
PFNprovider_lookup,

‎contrib/pgcrypto/pgcrypto.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.h,v 1.10 2006/07/13 04:15:25 neilc Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.h,v 1.11 2006/09/05 21:26:48 tgl Exp $
3030
*/
3131

3232
#ifndef_PG_CRYPTO_H
@@ -36,17 +36,14 @@
3636

3737
/* exported functions */
3838
Datumpg_digest(PG_FUNCTION_ARGS);
39-
Datumpg_digest_exists(PG_FUNCTION_ARGS);
4039
Datumpg_hmac(PG_FUNCTION_ARGS);
41-
Datumpg_hmac_exists(PG_FUNCTION_ARGS);
4240
Datumpg_gen_salt(PG_FUNCTION_ARGS);
4341
Datumpg_gen_salt_rounds(PG_FUNCTION_ARGS);
4442
Datumpg_crypt(PG_FUNCTION_ARGS);
4543
Datumpg_encrypt(PG_FUNCTION_ARGS);
4644
Datumpg_decrypt(PG_FUNCTION_ARGS);
4745
Datumpg_encrypt_iv(PG_FUNCTION_ARGS);
4846
Datumpg_decrypt_iv(PG_FUNCTION_ARGS);
49-
Datumpg_cipher_exists(PG_FUNCTION_ARGS);
5047
Datumpg_random_bytes(PG_FUNCTION_ARGS);
5148

5249
#endif

‎contrib/pgcrypto/pgcrypto.sql.in

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ RETURNS bytea
1111
AS 'MODULE_PATHNAME', 'pg_digest'
1212
LANGUAGE C IMMUTABLE STRICT;
1313

14-
CREATE OR REPLACE FUNCTION digest_exists(text)
15-
RETURNS bool
16-
AS 'MODULE_PATHNAME', 'pg_digest_exists'
17-
LANGUAGE C IMMUTABLE STRICT;
18-
1914
CREATE OR REPLACE FUNCTION hmac(text, text, text)
2015
RETURNS bytea
2116
AS 'MODULE_PATHNAME', 'pg_hmac'
@@ -26,11 +21,6 @@ RETURNS bytea
2621
AS 'MODULE_PATHNAME', 'pg_hmac'
2722
LANGUAGE C IMMUTABLE STRICT;
2823

29-
CREATE OR REPLACE FUNCTION hmac_exists(text)
30-
RETURNS bool
31-
AS 'MODULE_PATHNAME', 'pg_hmac_exists'
32-
LANGUAGE C IMMUTABLE STRICT;
33-
3424
CREATE OR REPLACE FUNCTION crypt(text, text)
3525
RETURNS text
3626
AS 'MODULE_PATHNAME', 'pg_crypt'
@@ -66,11 +56,6 @@ RETURNS bytea
6656
AS 'MODULE_PATHNAME', 'pg_decrypt_iv'
6757
LANGUAGE C IMMUTABLE STRICT;
6858

69-
CREATE OR REPLACE FUNCTION cipher_exists(text)
70-
RETURNS bool
71-
AS 'MODULE_PATHNAME', 'pg_cipher_exists'
72-
LANGUAGE C IMMUTABLE STRICT;
73-
7459
CREATE OR REPLACE FUNCTION gen_random_bytes(int4)
7560
RETURNS bytea
7661
AS 'MODULE_PATHNAME', 'pg_random_bytes'

‎contrib/pgcrypto/uninstall_pgcrypto.sql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ SET search_path = public;
33

44
DROPFUNCTION digest(text,text);
55
DROPFUNCTION digest(bytea,text);
6-
DROPFUNCTION digest_exists(text);
76

87
DROPFUNCTION hmac(text,text,text);
98
DROPFUNCTION hmac(bytea,bytea,text);
10-
DROPFUNCTION hmac_exists(text);
119

1210
DROPFUNCTION crypt(text,text);
1311
DROPFUNCTION gen_salt(text);
@@ -17,7 +15,7 @@ DROP FUNCTION encrypt(bytea, bytea, text);
1715
DROPFUNCTION decrypt(bytea,bytea,text);
1816
DROPFUNCTION encrypt_iv(bytea,bytea,bytea,text);
1917
DROPFUNCTION decrypt_iv(bytea,bytea,bytea,text);
20-
DROPFUNCTION cipher_exists(text);
18+
2119
DROPFUNCTION gen_random_bytes(int4);
2220

2321
DROPFUNCTION pgp_sym_encrypt(text,text);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp