Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit092b785

Browse files
committed
Simplify code related to compilation of SSL and OpenSSL
This commit makes more generic some comments and code related to thecompilation with OpenSSL and SSL in general to ease the addition of moreSSL implementations in the future. In libpq, some OpenSSL-only code ismoved under USE_OPENSSL and not USE_SSL.While on it, make a comment more consistent in libpq-fe.h.Author: Daniel GustafssonDiscussion:https://postgr.es/m/5382CB4A-9CF3-4145-BA46-C802615935E0@yesql.se
1 parentbd12080 commit092b785

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

‎src/backend/libpq/hba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ parse_hba_line(TokenizedLine *tok_line, int elevel)
10411041
ereport(elevel,
10421042
(errcode(ERRCODE_CONFIG_FILE_ERROR),
10431043
errmsg("hostssl record cannot match because SSL is not supported by this build"),
1044-
errhint("Compile with --with-ssl=openssl to use SSL connections."),
1044+
errhint("Compile with --with-ssl to use SSL connections."),
10451045
errcontext("line %d of configuration file \"%s\"",
10461046
line_num,HbaFileName)));
10471047
*err_msg="hostssl record cannot match because SSL is not supported by this build";

‎src/include/libpq/libpq-be.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ typedef struct Port
194194

195195
/*
196196
* OpenSSL structures. (Keep these last so that the locations of other
197-
* fields are the same whether or not you build withOpenSSL.)
197+
* fields are the same whether or not you build withSSL enabled.)
198198
*/
199199
#ifdefUSE_OPENSSL
200200
SSL*ssl;

‎src/include/pg_config_manual.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@
176176

177177
/*
178178
* USE_SSL code should be compiled only when compiling with an SSL
179-
* implementation. (Currently, only OpenSSL is supported, but we might add
180-
* more implementations in the future.)
179+
* implementation.
181180
*/
182181
#ifdefUSE_OPENSSL
183182
#defineUSE_SSL

‎src/interfaces/libpq/fe-secure.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,13 @@ PQsslAttributeNames(PGconn *conn)
421421

422422
returnresult;
423423
}
424+
#endif/* USE_SSL */
425+
426+
/*
427+
* Dummy versions of OpenSSL key password hook functions, when built without
428+
* OpenSSL.
429+
*/
430+
#ifndefUSE_OPENSSL
424431

425432
PQsslKeyPassHook_OpenSSL_type
426433
PQgetSSLKeyPassHook_OpenSSL(void)
@@ -439,7 +446,7 @@ PQdefaultSSLKeyPassHook_OpenSSL(char *buf, int size, PGconn *conn)
439446
{
440447
return0;
441448
}
442-
#endif/*USE_SSL */
449+
#endif/*USE_OPENSSL */
443450

444451
/* Dummy version of GSSAPI information functions, when built without GSS support */
445452
#ifndefENABLE_GSS

‎src/interfaces/libpq/libpq-fe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ extern intpg_valid_server_encoding_id(int encoding);
619619

620620
/* === in fe-secure-openssl.c === */
621621

622-
/* Support for overriding sslpassword handling with a callback. */
622+
/* Support for overriding sslpassword handling with a callback */
623623
typedefint (*PQsslKeyPassHook_OpenSSL_type) (char*buf,intsize,PGconn*conn);
624624
externPQsslKeyPassHook_OpenSSL_typePQgetSSLKeyPassHook_OpenSSL(void);
625625
externvoidPQsetSSLKeyPassHook_OpenSSL(PQsslKeyPassHook_OpenSSL_typehook);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp