|
26 | 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
27 | 27 | * SUCH DAMAGE.
|
28 | 28 | *
|
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 $ |
30 | 30 | */
|
31 | 31 |
|
32 | 32 | #include "postgres.h"
|
@@ -87,32 +87,6 @@ pg_digest(PG_FUNCTION_ARGS)
|
87 | 87 | PG_RETURN_BYTEA_P(res);
|
88 | 88 | }
|
89 | 89 |
|
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 |
| - |
116 | 90 | /* SQL function: hmac(data:bytea, key:bytea, type:text) returns bytea */
|
117 | 91 | PG_FUNCTION_INFO_V1(pg_hmac);
|
118 | 92 |
|
@@ -158,32 +132,6 @@ pg_hmac(PG_FUNCTION_ARGS)
|
158 | 132 | PG_RETURN_BYTEA_P(res);
|
159 | 133 | }
|
160 | 134 |
|
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 |
| - |
187 | 135 |
|
188 | 136 | /* SQL function: pg_gen_salt(text) returns text */
|
189 | 137 | PG_FUNCTION_INFO_V1(pg_gen_salt);
|
@@ -565,27 +513,6 @@ pg_random_bytes(PG_FUNCTION_ARGS)
|
565 | 513 | PG_RETURN_BYTEA_P(res);
|
566 | 514 | }
|
567 | 515 |
|
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 |
| - |
589 | 516 | static void *
|
590 | 517 | find_provider(text *name,
|
591 | 518 | PFN provider_lookup,
|
|
0 commit comments