summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch')
-rw-r--r--meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch156
1 files changed, 0 insertions, 156 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch
deleted file mode 100644
index 05caf0a99e..0000000000
--- a/meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch
+++ /dev/null
@@ -1,156 +0,0 @@
1From c5b831f21d0d29d1e517d139d9d101763f60c9a2 Mon Sep 17 00:00:00 2001
2From: Matt Caswell <matt@openssl.org>
3Date: Thu, 17 Dec 2015 02:57:20 +0000
4Subject: [PATCH] Always generate DH keys for ephemeral DH cipher suites
5
6Modified version of the commit ffaef3f15 in the master branch by Stephen
7Henson. This makes the SSL_OP_SINGLE_DH_USE option a no-op and always
8generates a new DH key for every handshake regardless.
9
10CVE-2016-0701 (fix part 2 or 2)
11
12Issue reported by Antonio Sanso
13
14Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
15
16Upstream-Status: Backport
17
18https://github.com/openssl/openssl/commit/c5b831f21d0d29d1e517d139d9d101763f60c9a2
19
20CVE: CVE-2016-0701 #2
21Signed-of-by: Armin Kuster <akuster@mvisa.com>
22
23---
24 doc/ssl/SSL_CTX_set_tmp_dh_callback.pod | 29 +++++------------------------
25 ssl/s3_lib.c | 14 --------------
26 ssl/s3_srvr.c | 17 +++--------------
27 ssl/ssl.h | 2 +-
28 4 files changed, 9 insertions(+), 53 deletions(-)
29
30Index: openssl-1.0.2d/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
31===================================================================
32--- openssl-1.0.2d.orig/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
33+++ openssl-1.0.2d/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
34@@ -48,25 +48,8 @@ even if he gets hold of the normal (cert
35 only used for signing.
36
37 In order to perform a DH key exchange the server must use a DH group
38-(DH parameters) and generate a DH key.
39-The server will always generate a new DH key during the negotiation
40-if either the DH parameters are supplied via callback or the
41-SSL_OP_SINGLE_DH_USE option of SSL_CTX_set_options(3) is set (or both).
42-It will immediately create a DH key if DH parameters are supplied via
43-SSL_CTX_set_tmp_dh() and SSL_OP_SINGLE_DH_USE is not set.
44-In this case,
45-it may happen that a key is generated on initialization without later
46-being needed, while on the other hand the computer time during the
47-negotiation is being saved.
48-
49-If "strong" primes were used to generate the DH parameters, it is not strictly
50-necessary to generate a new key for each handshake but it does improve forward
51-secrecy. If it is not assured that "strong" primes were used,
52-SSL_OP_SINGLE_DH_USE must be used in order to prevent small subgroup
53-attacks. Always using SSL_OP_SINGLE_DH_USE has an impact on the
54-computer time needed during negotiation, but it is not very large, so
55-application authors/users should consider always enabling this option.
56-The option is required to implement perfect forward secrecy (PFS).
57+(DH parameters) and generate a DH key. The server will always generate
58+a new DH key during the negotiation.
59
60 As generating DH parameters is extremely time consuming, an application
61 should not generate the parameters on the fly but supply the parameters.
62@@ -93,10 +76,9 @@ can supply the DH parameters via a callb
63 Previous versions of the callback used B<is_export> and B<keylength>
64 parameters to control parameter generation for export and non-export
65 cipher suites. Modern servers that do not support export ciphersuites
66-are advised to either use SSL_CTX_set_tmp_dh() in combination with
67-SSL_OP_SINGLE_DH_USE, or alternatively, use the callback but ignore
68-B<keylength> and B<is_export> and simply supply at least 2048-bit
69-parameters in the callback.
70+are advised to either use SSL_CTX_set_tmp_dh() or alternatively, use
71+the callback but ignore B<keylength> and B<is_export> and simply
72+supply at least 2048-bit parameters in the callback.
73
74 =head1 EXAMPLES
75
76@@ -128,7 +110,6 @@ partly left out.)
77 if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) {
78 /* Error. */
79 }
80- SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE);
81 ...
82
83 =head1 RETURN VALUES
84Index: openssl-1.0.2d/ssl/s3_lib.c
85===================================================================
86--- openssl-1.0.2d.orig/ssl/s3_lib.c
87+++ openssl-1.0.2d/ssl/s3_lib.c
88@@ -3206,13 +3206,6 @@ long ssl3_ctrl(SSL *s, int cmd, long lar
89 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
90 return (ret);
91 }
92- if (!(s->options & SSL_OP_SINGLE_DH_USE)) {
93- if (!DH_generate_key(dh)) {
94- DH_free(dh);
95- SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
96- return (ret);
97- }
98- }
99 if (s->cert->dh_tmp != NULL)
100 DH_free(s->cert->dh_tmp);
101 s->cert->dh_tmp = dh;
102@@ -3710,13 +3703,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd
103 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
104 return 0;
105 }
106- if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) {
107- if (!DH_generate_key(new)) {
108- SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
109- DH_free(new);
110- return 0;
111- }
112- }
113 if (cert->dh_tmp != NULL)
114 DH_free(cert->dh_tmp);
115 cert->dh_tmp = new;
116Index: openssl-1.0.2d/ssl/s3_srvr.c
117===================================================================
118--- openssl-1.0.2d.orig/ssl/s3_srvr.c
119+++ openssl-1.0.2d/ssl/s3_srvr.c
120@@ -1684,20 +1684,9 @@ int ssl3_send_server_key_exchange(SSL *s
121 }
122
123 s->s3->tmp.dh = dh;
124- if ((dhp->pub_key == NULL ||
125- dhp->priv_key == NULL ||
126- (s->options & SSL_OP_SINGLE_DH_USE))) {
127- if (!DH_generate_key(dh)) {
128- SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB);
129- goto err;
130- }
131- } else {
132- dh->pub_key = BN_dup(dhp->pub_key);
133- dh->priv_key = BN_dup(dhp->priv_key);
134- if ((dh->pub_key == NULL) || (dh->priv_key == NULL)) {
135- SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB);
136- goto err;
137- }
138+ if (!DH_generate_key(dh)) {
139+ SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB);
140+ goto err;
141 }
142 r[0] = dh->p;
143 r[1] = dh->g;
144Index: openssl-1.0.2d/ssl/ssl.h
145===================================================================
146--- openssl-1.0.2d.orig/ssl/ssl.h
147+++ openssl-1.0.2d/ssl/ssl.h
148@@ -625,7 +625,7 @@ struct ssl_session_st {
149 # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L
150 /* If set, always create a new key when using tmp_ecdh parameters */
151 # define SSL_OP_SINGLE_ECDH_USE 0x00080000L
152-/* If set, always create a new key when using tmp_dh parameters */
153+/* Does nothing: retained for compatibility */
154 # define SSL_OP_SINGLE_DH_USE 0x00100000L
155 /* Does nothing: retained for compatibiity */
156 # define SSL_OP_EPHEMERAL_RSA 0x0