aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgcrypto.c
diff options
context:
space:
mode:
authorDaniel Gustafsson <dgustafsson@postgresql.org>2025-01-24 14:18:40 +0100
committerDaniel Gustafsson <dgustafsson@postgresql.org>2025-01-24 14:18:40 +0100
commit924d89a354750976cdd271d1dfc6c1e97cbb8851 (patch)
tree70db89728ad4ec471dab811e3fdaaaad46ac8ce7 /contrib/pgcrypto/pgcrypto.c
parentc44c2d2759876463dcbab2eb608e33ed2e772d12 (diff)
downloadpostgresql-924d89a354750976cdd271d1dfc6c1e97cbb8851.tar.gz
postgresql-924d89a354750976cdd271d1dfc6c1e97cbb8851.zip
pgcrypto: Add function to check FIPS mode
This adds a SQL callable function for reading and returning the status of FIPS configuration of OpenSSL. If OpenSSL is operating with FIPS enabled it will return true, otherwise false. As this adds a function to the SQL file, bump the extension version to 1.4. Author: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Joe Conway <mail@joeconway.com> Discussion: https://postgr.es/m/8f979145-e206-475a-a31b-73c977a4134c@joeconway.com
Diffstat (limited to 'contrib/pgcrypto/pgcrypto.c')
-rw-r--r--contrib/pgcrypto/pgcrypto.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c
index ebd76eed702..ee2a010e402 100644
--- a/contrib/pgcrypto/pgcrypto.c
+++ b/contrib/pgcrypto/pgcrypto.c
@@ -450,6 +450,14 @@ pg_random_uuid(PG_FUNCTION_ARGS)
return gen_random_uuid(fcinfo);
}
+PG_FUNCTION_INFO_V1(pg_check_fipsmode);
+
+Datum
+pg_check_fipsmode(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(CheckFIPSMode());
+}
+
static void *
find_provider(text *name,
PFN provider_lookup,