diff options
Diffstat (limited to 'src/include/libpq')
| -rw-r--r-- | src/include/libpq/libpq-be.h | 24 | ||||
| -rw-r--r-- | src/include/libpq/libpq.h | 9 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h index e78c565b1e..34e52e44b0 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -21,7 +21,7 @@ #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif -#ifdef USE_SSL +#ifdef USE_OPENSSL #include <openssl/ssl.h> #include <openssl/err.h> #endif @@ -184,17 +184,33 @@ typedef struct Port #endif /* - * SSL structures (keep these last so that USE_SSL doesn't affect - * locations of other fields) + * SSL structures (keep these last so that the locations of other fields + * are the same whether or not you build with SSL) */ #ifdef USE_SSL + bool ssl_in_use; + char *peer_cn; + bool peer_cert_valid; +#endif +#ifdef USE_OPENSSL SSL *ssl; X509 *peer; - char *peer_cn; unsigned long count; #endif } Port; +#ifdef USE_SSL +/* + * These functions are implemented by the glue code specific to each + * SSL implementation (e.g. be-secure-openssl.c) + */ +extern void be_tls_init(void); +extern int be_tls_open_server(Port *port); +extern void be_tls_close(Port *port); +extern ssize_t be_tls_read(Port *port, void *ptr, size_t len); +extern ssize_t be_tls_write(Port *port, void *ptr, size_t len); + +#endif extern ProtocolVersion FrontendProtocol; diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index e4e354dafa..5da9d8d4f5 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -82,5 +82,14 @@ extern int secure_open_server(Port *port); extern void secure_close(Port *port); extern ssize_t secure_read(Port *port, void *ptr, size_t len); extern ssize_t secure_write(Port *port, void *ptr, size_t len); +extern ssize_t secure_raw_read(Port *port, void *ptr, size_t len); +extern ssize_t secure_raw_write(Port *port, const void *ptr, size_t len); + +extern bool ssl_loaded_verify_locations; + +/* GUCs */ +extern char *SSLCipherSuites; +extern char *SSLECDHCurve; +extern bool SSLPreferServerCiphers; #endif /* LIBPQ_H */ |
