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

Commit1241fcb

Browse files
committed
Second attempt to silence SSL compile failures on hamerkop.
After further investigation, it seems the cause of the problemis our recent decision to start defining WIN32_LEAN_AND_MEAN.That causes <windows.h> to no longer include <wincrypt.h>, whichmeans that the OpenSSL headers are unable to prevent conflictswith that header by #undef'ing the conflicting macros. Apparently,some other system header that be-secure-openssl.c #includes afterthe OpenSSL headers is pulling in <wincrypt.h>. It's obscure justwhere that happens and why we're not seeing it on other Windowsbuildfarm animals. However, it should work to move the OpenSSL#includes to the end of the list. For the sake of future-proofing,do likewise in fe-secure-openssl.c. In passing, remove uselessdouble inclusions of <openssl/ssl.h>.Thanks to Thomas Munro for running down the relevant information.Discussion:https://postgr.es/m/1051867.1635720347@sss.pgh.pa.us
1 parent05e6e78 commit1241fcb

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

‎src/backend/libpq/be-secure-openssl.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@
2929
#include<arpa/inet.h>
3030
#endif
3131

32-
#include<openssl/ssl.h>
33-
#include<openssl/conf.h>
34-
#include<openssl/dh.h>
35-
#ifndefOPENSSL_NO_ECDH
36-
#include<openssl/ec.h>
37-
#endif
38-
#include<openssl/x509v3.h>
39-
40-
#include"common/openssl.h"
4132
#include"libpq/libpq.h"
4233
#include"miscadmin.h"
4334
#include"pgstat.h"
@@ -46,6 +37,21 @@
4637
#include"tcop/tcopprot.h"
4738
#include"utils/memutils.h"
4839

40+
/*
41+
* These SSL-related #includes must come after all system-provided headers.
42+
* This ensures that OpenSSL can take care of conflicts with Windows'
43+
* <wincrypt.h> by #undef'ing the conflicting macros. (We don't directly
44+
* include <wincrypt.h>, but some other Windows headers do.)
45+
*/
46+
#include"common/openssl.h"
47+
#include<openssl/conf.h>
48+
#include<openssl/dh.h>
49+
#ifndefOPENSSL_NO_ECDH
50+
#include<openssl/ec.h>
51+
#endif
52+
#include<openssl/x509v3.h>
53+
54+
4955
/* default init hook can be overridden by a shared library */
5056
staticvoiddefault_openssl_tls_init(SSL_CTX*context,boolisServerStart);
5157
openssl_tls_init_hook_typopenssl_tls_init_hook=default_openssl_tls_init;

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include"fe-auth.h"
3131
#include"fe-secure-common.h"
3232
#include"libpq-int.h"
33-
#include"common/openssl.h"
3433

3534
#ifdefWIN32
3635
#include"win32.h"
@@ -55,13 +54,20 @@
5554
#endif
5655
#endif
5756

58-
#include<openssl/ssl.h>
57+
/*
58+
* These SSL-related #includes must come after all system-provided headers.
59+
* This ensures that OpenSSL can take care of conflicts with Windows'
60+
* <wincrypt.h> by #undef'ing the conflicting macros. (We don't directly
61+
* include <wincrypt.h>, but some other Windows headers do.)
62+
*/
63+
#include"common/openssl.h"
5964
#include<openssl/conf.h>
6065
#ifdefUSE_SSL_ENGINE
6166
#include<openssl/engine.h>
6267
#endif
6368
#include<openssl/x509v3.h>
6469

70+
6571
staticintverify_cb(intok,X509_STORE_CTX*ctx);
6672
staticintopenssl_verify_peer_name_matches_certificate_name(PGconn*conn,
6773
ASN1_STRING*name,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp