]> granicus.if.org Git - postgresql/commit - src/interfaces/libpq/fe-secure.c
Break out OpenSSL-specific code to separate files.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 11 Aug 2014 08:54:19 +0000 (11:54 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 11 Aug 2014 08:54:19 +0000 (11:54 +0300)
commit680513ab79c7e12e402a2aad7921b95a25a4bcc8
treec2a5b1debb5599ae4a3522be921a78a6f1cf35c3
parent6aa61580e08d58909b2a8845a4087b7699335ee0
Break out OpenSSL-specific code to separate files.

This refactoring is in preparation for adding support for other SSL
implementations, with no user-visible effects. There are now two #defines,
USE_OPENSSL which is defined when building with OpenSSL, and USE_SSL which
is defined when building with any SSL implementation. Currently, OpenSSL is
the only implementation so the two #defines go together, but USE_SSL is
supposed to be used for implementation-independent code.

The libpq SSL code is changed to use a custom BIO, which does all the raw
I/O, like we've been doing in the backend for a long time. That makes it
possible to use MSG_NOSIGNAL to block SIGPIPE when using SSL, which avoids
a couple of syscall for each send(). Probably doesn't make much performance
difference in practice - the SSL encryption is expensive enough to mask the
effect - but it was a natural result of this refactoring.

Based on a patch by Martijn van Oosterhout from 2006. Briefly reviewed by
Alvaro Herrera, Andreas Karlsson, Jeff Janes.
26 files changed:
configure
configure.in
src/backend/libpq/Makefile
src/backend/libpq/auth.c
src/backend/libpq/be-secure-openssl.c [new file with mode: 0644]
src/backend/libpq/be-secure.c
src/backend/libpq/hba.c
src/backend/postmaster/fork_process.c
src/backend/utils/init/postinit.c
src/backend/utils/misc/guc.c
src/bin/psql/command.c
src/include/libpq/libpq-be.h
src/include/libpq/libpq.h
src/include/pg_config.h.in
src/include/pg_config.h.win32
src/include/pg_config_manual.h
src/interfaces/libpq/Makefile
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-secure-openssl.c [new file with mode: 0644]
src/interfaces/libpq/fe-secure.c
src/interfaces/libpq/libpq-int.h
src/interfaces/libpq/win32.mak
src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/Solution.pm
src/tools/msvc/config_default.pl