Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7d4838dc
Commit
7d4838dc
authored
Sep 05, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pgcrypto functions that were deprecated and slated for removal.
Marko Kreen
parent
7bae5a28
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
106 deletions
+6
-106
contrib/pgcrypto/README.pgcrypto
contrib/pgcrypto/README.pgcrypto
+3
-10
contrib/pgcrypto/pgcrypto.c
contrib/pgcrypto/pgcrypto.c
+1
-74
contrib/pgcrypto/pgcrypto.h
contrib/pgcrypto/pgcrypto.h
+1
-4
contrib/pgcrypto/pgcrypto.sql.in
contrib/pgcrypto/pgcrypto.sql.in
+0
-15
contrib/pgcrypto/uninstall_pgcrypto.sql
contrib/pgcrypto/uninstall_pgcrypto.sql
+1
-3
No files found.
contrib/pgcrypto/README.pgcrypto
View file @
7d4838dc
pgcrypto - cryptographic functions for PostgreSQL
pgcrypto - cryptographic functions for PostgreSQL
=================================================
=================================================
Marko Kreen <marko
@l-t.ee
>
Marko Kreen <marko
kr@gmail.com
>
// Note: this document is in asciidoc format.
// Note: this document is in asciidoc format.
...
@@ -79,14 +79,7 @@ As standard in SQL, all functions return NULL, if any of the arguments
...
@@ -79,14 +79,7 @@ As standard in SQL, all functions return NULL, if any of the arguments
are NULL. This may create security risks on careless usage.
are NULL. This may create security risks on careless usage.
2.3. Deprecated functions
2.3. Security
~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
All the functions here run inside database server. That means that all
...
@@ -714,4 +707,4 @@ http://www.cs.ut.ee/~helger/crypto/[]::
...
@@ -714,4 +707,4 @@ http://www.cs.ut.ee/~helger/crypto/[]::
Collection of cryptology pointers.
Collection of cryptology pointers.
// $PostgreSQL: pgsql/contrib/pgcrypto/README.pgcrypto,v 1.1
7 2006/08/05 00:29:11 neilc
Exp $
// $PostgreSQL: pgsql/contrib/pgcrypto/README.pgcrypto,v 1.1
8 2006/09/05 21:26:48 tgl
Exp $
contrib/pgcrypto/pgcrypto.c
View file @
7d4838dc
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* SUCH DAMAGE.
*
*
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.2
2 2006/07/13 04:15:25 neilc
Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.2
3 2006/09/05 21:26:48 tgl
Exp $
*/
*/
#include "postgres.h"
#include "postgres.h"
...
@@ -87,32 +87,6 @@ pg_digest(PG_FUNCTION_ARGS)
...
@@ -87,32 +87,6 @@ pg_digest(PG_FUNCTION_ARGS)
PG_RETURN_BYTEA_P
(
res
);
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 */
/* SQL function: hmac(data:bytea, key:bytea, type:text) returns bytea */
PG_FUNCTION_INFO_V1
(
pg_hmac
);
PG_FUNCTION_INFO_V1
(
pg_hmac
);
...
@@ -158,32 +132,6 @@ pg_hmac(PG_FUNCTION_ARGS)
...
@@ -158,32 +132,6 @@ pg_hmac(PG_FUNCTION_ARGS)
PG_RETURN_BYTEA_P
(
res
);
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 */
/* SQL function: pg_gen_salt(text) returns text */
PG_FUNCTION_INFO_V1
(
pg_gen_salt
);
PG_FUNCTION_INFO_V1
(
pg_gen_salt
);
...
@@ -565,27 +513,6 @@ pg_random_bytes(PG_FUNCTION_ARGS)
...
@@ -565,27 +513,6 @@ pg_random_bytes(PG_FUNCTION_ARGS)
PG_RETURN_BYTEA_P
(
res
);
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
*
static
void
*
find_provider
(
text
*
name
,
find_provider
(
text
*
name
,
PFN
provider_lookup
,
PFN
provider_lookup
,
...
...
contrib/pgcrypto/pgcrypto.h
View file @
7d4838dc
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* SUCH DAMAGE.
*
*
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.h,v 1.1
0 2006/07/13 04:15:25 neilc
Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.h,v 1.1
1 2006/09/05 21:26:48 tgl
Exp $
*/
*/
#ifndef _PG_CRYPTO_H
#ifndef _PG_CRYPTO_H
...
@@ -36,9 +36,7 @@
...
@@ -36,9 +36,7 @@
/* exported functions */
/* exported functions */
Datum
pg_digest
(
PG_FUNCTION_ARGS
);
Datum
pg_digest
(
PG_FUNCTION_ARGS
);
Datum
pg_digest_exists
(
PG_FUNCTION_ARGS
);
Datum
pg_hmac
(
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
(
PG_FUNCTION_ARGS
);
Datum
pg_gen_salt_rounds
(
PG_FUNCTION_ARGS
);
Datum
pg_gen_salt_rounds
(
PG_FUNCTION_ARGS
);
Datum
pg_crypt
(
PG_FUNCTION_ARGS
);
Datum
pg_crypt
(
PG_FUNCTION_ARGS
);
...
@@ -46,7 +44,6 @@ Datum pg_encrypt(PG_FUNCTION_ARGS);
...
@@ -46,7 +44,6 @@ Datum pg_encrypt(PG_FUNCTION_ARGS);
Datum
pg_decrypt
(
PG_FUNCTION_ARGS
);
Datum
pg_decrypt
(
PG_FUNCTION_ARGS
);
Datum
pg_encrypt_iv
(
PG_FUNCTION_ARGS
);
Datum
pg_encrypt_iv
(
PG_FUNCTION_ARGS
);
Datum
pg_decrypt_iv
(
PG_FUNCTION_ARGS
);
Datum
pg_decrypt_iv
(
PG_FUNCTION_ARGS
);
Datum
pg_cipher_exists
(
PG_FUNCTION_ARGS
);
Datum
pg_random_bytes
(
PG_FUNCTION_ARGS
);
Datum
pg_random_bytes
(
PG_FUNCTION_ARGS
);
#endif
#endif
contrib/pgcrypto/pgcrypto.sql.in
View file @
7d4838dc
...
@@ -11,11 +11,6 @@ RETURNS bytea
...
@@ -11,11 +11,6 @@ RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_digest'
AS 'MODULE_PATHNAME', 'pg_digest'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION digest_exists(text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pg_digest_exists'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION hmac(text, text, text)
CREATE OR REPLACE FUNCTION hmac(text, text, text)
RETURNS bytea
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_hmac'
AS 'MODULE_PATHNAME', 'pg_hmac'
...
@@ -26,11 +21,6 @@ RETURNS bytea
...
@@ -26,11 +21,6 @@ RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_hmac'
AS 'MODULE_PATHNAME', 'pg_hmac'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION hmac_exists(text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pg_hmac_exists'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION crypt(text, text)
CREATE OR REPLACE FUNCTION crypt(text, text)
RETURNS text
RETURNS text
AS 'MODULE_PATHNAME', 'pg_crypt'
AS 'MODULE_PATHNAME', 'pg_crypt'
...
@@ -66,11 +56,6 @@ RETURNS bytea
...
@@ -66,11 +56,6 @@ RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_decrypt_iv'
AS 'MODULE_PATHNAME', 'pg_decrypt_iv'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cipher_exists(text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pg_cipher_exists'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION gen_random_bytes(int4)
CREATE OR REPLACE FUNCTION gen_random_bytes(int4)
RETURNS bytea
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_random_bytes'
AS 'MODULE_PATHNAME', 'pg_random_bytes'
...
...
contrib/pgcrypto/uninstall_pgcrypto.sql
View file @
7d4838dc
...
@@ -3,11 +3,9 @@ SET search_path = public;
...
@@ -3,11 +3,9 @@ SET search_path = public;
DROP
FUNCTION
digest
(
text
,
text
);
DROP
FUNCTION
digest
(
text
,
text
);
DROP
FUNCTION
digest
(
bytea
,
text
);
DROP
FUNCTION
digest
(
bytea
,
text
);
DROP
FUNCTION
digest_exists
(
text
);
DROP
FUNCTION
hmac
(
text
,
text
,
text
);
DROP
FUNCTION
hmac
(
text
,
text
,
text
);
DROP
FUNCTION
hmac
(
bytea
,
bytea
,
text
);
DROP
FUNCTION
hmac
(
bytea
,
bytea
,
text
);
DROP
FUNCTION
hmac_exists
(
text
);
DROP
FUNCTION
crypt
(
text
,
text
);
DROP
FUNCTION
crypt
(
text
,
text
);
DROP
FUNCTION
gen_salt
(
text
);
DROP
FUNCTION
gen_salt
(
text
);
...
@@ -17,7 +15,7 @@ DROP FUNCTION encrypt(bytea, bytea, text);
...
@@ -17,7 +15,7 @@ DROP FUNCTION encrypt(bytea, bytea, text);
DROP
FUNCTION
decrypt
(
bytea
,
bytea
,
text
);
DROP
FUNCTION
decrypt
(
bytea
,
bytea
,
text
);
DROP
FUNCTION
encrypt_iv
(
bytea
,
bytea
,
bytea
,
text
);
DROP
FUNCTION
encrypt_iv
(
bytea
,
bytea
,
bytea
,
text
);
DROP
FUNCTION
decrypt_iv
(
bytea
,
bytea
,
bytea
,
text
);
DROP
FUNCTION
decrypt_iv
(
bytea
,
bytea
,
bytea
,
text
);
DROP
FUNCTION
cipher_exists
(
text
);
DROP
FUNCTION
gen_random_bytes
(
int4
);
DROP
FUNCTION
gen_random_bytes
(
int4
);
DROP
FUNCTION
pgp_sym_encrypt
(
text
,
text
);
DROP
FUNCTION
pgp_sym_encrypt
(
text
,
text
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment