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.
Showing
- configure 1 addition, 1 deletionconfigure
- configure.in 1 addition, 1 deletionconfigure.in
- src/backend/libpq/Makefile 4 additions, 0 deletionssrc/backend/libpq/Makefile
- src/backend/libpq/auth.c 7 additions, 7 deletionssrc/backend/libpq/auth.c
- src/backend/libpq/be-secure-openssl.c 1045 additions, 0 deletionssrc/backend/libpq/be-secure-openssl.c
- src/backend/libpq/be-secure.c 24 additions, 1003 deletionssrc/backend/libpq/be-secure.c
- src/backend/libpq/hba.c 1 addition, 1 deletionsrc/backend/libpq/hba.c
- src/backend/postmaster/fork_process.c 2 additions, 2 deletionssrc/backend/postmaster/fork_process.c
- src/backend/utils/init/postinit.c 4 additions, 4 deletionssrc/backend/utils/init/postinit.c
- src/backend/utils/misc/guc.c 0 additions, 3 deletionssrc/backend/utils/misc/guc.c
- src/bin/psql/command.c 2 additions, 2 deletionssrc/bin/psql/command.c
- src/include/libpq/libpq-be.h 20 additions, 4 deletionssrc/include/libpq/libpq-be.h
- src/include/libpq/libpq.h 9 additions, 0 deletionssrc/include/libpq/libpq.h
- src/include/pg_config.h.in 3 additions, 3 deletionssrc/include/pg_config.h.in
- src/include/pg_config.h.win32 3 additions, 3 deletionssrc/include/pg_config.h.win32
- src/include/pg_config_manual.h 9 additions, 0 deletionssrc/include/pg_config_manual.h
- src/interfaces/libpq/Makefile 4 additions, 0 deletionssrc/interfaces/libpq/Makefile
- src/interfaces/libpq/fe-connect.c 4 additions, 3 deletionssrc/interfaces/libpq/fe-connect.c
- src/interfaces/libpq/fe-misc.c 2 additions, 2 deletionssrc/interfaces/libpq/fe-misc.c
- src/interfaces/libpq/fe-secure-openssl.c 1468 additions, 0 deletionssrc/interfaces/libpq/fe-secure-openssl.c
Loading
Please register or sign in to comment