aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-01-17 10:06:17 +0900
committerMichael Paquier <michael@paquier.xyz>2020-01-17 10:06:17 +0900
commitf7cd5896a69621818189fbdd209fb2e1fc008102 (patch)
treedace04fa5faa78aca98ef79204fe67776d6139c4 /src/include
parent5afaa2e42655811461044c4216e2f821cadc766d (diff)
downloadpostgresql-f7cd5896a69621818189fbdd209fb2e1fc008102.tar.gz
postgresql-f7cd5896a69621818189fbdd209fb2e1fc008102.zip
Move OpenSSL routines for min/max protocol setting to src/common/
Two routines have been added in OpenSSL 1.1.0 to set the protocol bounds allowed within a given SSL context: - SSL_CTX_set_min_proto_version - SSL_CTX_set_max_proto_version As Postgres supports OpenSSL down to 1.0.1 (as of HEAD), equivalent replacements exist in the tree, which are only available for the backend. A follow-up patch is planned to add control of the SSL protocol bounds for libpq, so move those routines to src/common/ so as libpq can use them. Author: Daniel Gustafsson Discussion: https://postgr.es/m/4F246AE3-A7AE-471E-BD3D-C799D3748E03@yesql.se
Diffstat (limited to 'src/include')
-rw-r--r--src/include/common/openssl.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/common/openssl.h b/src/include/common/openssl.h
new file mode 100644
index 00000000000..47fa1299945
--- /dev/null
+++ b/src/include/common/openssl.h
@@ -0,0 +1,28 @@
+/*-------------------------------------------------------------------------
+ *
+ * openssl.h
+ * OpenSSL supporting functionality shared between frontend and backend
+ *
+ * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * IDENTIFICATION
+ * src/include/common/openssl.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef COMMON_OPENSSL_H
+#define COMMON_OPENSSL_H
+
+#ifdef USE_OPENSSL
+#include <openssl/ssl.h>
+
+/* src/common/protocol_openssl.c */
+#ifndef SSL_CTX_set_min_proto_version
+extern int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version);
+extern int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version);
+#endif
+
+#endif
+
+#endif /* COMMON_OPENSSL_H */