|
11 | 11 | * IDENTIFICATION |
12 | 12 | * src/backend/libpq/be-secure-openssl.c |
13 | 13 | * |
14 | | - * Since the server static private key ($DataDir/server.key) |
15 | | - * will normally be stored unencrypted so that the database |
16 | | - * backend can restart automatically, it is important that |
17 | | - * we select an algorithm that continues to provide confidentiality |
18 | | - * even if the attacker has the server's private key. Ephemeral |
19 | | - * DH (EDH) keys provide this and more (Perfect Forward Secrecy |
20 | | - * aka PFS). |
21 | | - * |
22 | | - * N.B., the static private key should still be protected to |
23 | | - * the largest extent possible, to minimize the risk of |
24 | | - * impersonations. |
25 | | - * |
26 | | - * Another benefit of EDH is that it allows the backend and |
27 | | - * clients to use DSA keys. DSA keys can only provide digital |
28 | | - * signatures, not encryption, and are often acceptable in |
29 | | - * jurisdictions where RSA keys are unacceptable. |
30 | | - * |
31 | | - * The downside to EDH is that it makes it impossible to |
32 | | - * use ssldump(1) if there's a problem establishing an SSL |
33 | | - * session. In this case you'll need to temporarily disable |
34 | | - * EDH (see initialize_dh()). |
35 | | - * |
36 | 14 | *------------------------------------------------------------------------- |
37 | 15 | */ |
38 | 16 |
|
@@ -87,40 +65,6 @@ static SSL_CTX *SSL_context = NULL; |
87 | 65 | static bool SSL_initialized = false; |
88 | 66 | static bool ssl_passwd_cb_called = false; |
89 | 67 |
|
90 | | -/* ------------------------------------------------------------ */ |
91 | | -/* Hardcoded values */ |
92 | | -/* ------------------------------------------------------------ */ |
93 | | - |
94 | | -/* |
95 | | - * Hardcoded DH parameters, used in ephemeral DH keying. |
96 | | - * As discussed above, EDH protects the confidentiality of |
97 | | - * sessions even if the static private key is compromised, |
98 | | - * so we are *highly* motivated to ensure that we can use |
99 | | - * EDH even if the DBA has not provided custom DH parameters. |
100 | | - * |
101 | | - * We could refuse SSL connections unless a good DH parameter |
102 | | - * file exists, but some clients may quietly renegotiate an |
103 | | - * unsecured connection without fully informing the user. |
104 | | - * Very uncool. Alternatively, the system could refuse to start |
105 | | - * if a DH parameters is not specified, but this would tend to |
106 | | - * piss off DBAs. |
107 | | - * |
108 | | - * If you want to create your own hardcoded DH parameters |
109 | | - * for fun and profit, review "Assigned Number for SKIP |
110 | | - * Protocols" (http://www.skip-vpn.org/spec/numbers.html) |
111 | | - * for suggestions. |
112 | | - */ |
113 | | - |
114 | | -static const char file_dh2048[] = |
115 | | -"-----BEGIN DH PARAMETERS-----\n\ |
116 | | -MIIBCAKCAQEA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV\n\ |
117 | | -89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50\n\ |
118 | | -T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknb\n\ |
119 | | -zSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdX\n\ |
120 | | -Q6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbT\n\ |
121 | | -CD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwIBAg==\n\ |
122 | | ------END DH PARAMETERS-----\n"; |
123 | | - |
124 | 68 |
|
125 | 69 | /* ------------------------------------------------------------ */ |
126 | 70 | /* Public interface */ |
@@ -1080,7 +1024,7 @@ initialize_dh(SSL_CTX *context, bool isServerStart) |
1080 | 1024 | if (ssl_dh_params_file[0]) |
1081 | 1025 | dh = load_dh_file(ssl_dh_params_file, isServerStart); |
1082 | 1026 | if (!dh) |
1083 | | - dh = load_dh_buffer(file_dh2048, sizeof file_dh2048); |
| 1027 | + dh = load_dh_buffer(FILE_DH2048, sizeof(FILE_DH2048)); |
1084 | 1028 | if (!dh) |
1085 | 1029 | { |
1086 | 1030 | ereport(isServerStart ? FATAL : LOG, |
|
0 commit comments