summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRiyaz Khan <Riyaz.Khan@kpit.com>2023-06-01 16:14:52 +0530
committerSteve Sakoman <steve@sakoman.com>2023-06-14 04:16:59 -1000
commit20c192f0ecc8445a0e13a29b38329f762ec6b754 (patch)
tree66f634a25bd32132345f0e4555b504a2e9bf80e6
parent916105b35242eccea5c819e927d3ba01bd0ba098 (diff)
downloadpoky-20c192f0ecc8445a0e13a29b38329f762ec6b754.tar.gz
openssh: Remove BSD-4-clause contents completely from codebase
Below upstream commit removed BSD-4-Clause from the LICENSE variable, Link: https://git.yoctoproject.org/poky/commit/?id=2c86f586d55d0f6b99053e3e4d14c9ee36fa8aa8 But actually if we check from the source code of the openssh for this version (8.9p1), there are some files (openbsd-compat/libressl-api-compat.c) still affected. As upstream removed this BSD-4-clause license, there are still some files has this license. Below file is affected by this BSD-4-clause contents when the below command is executed grep -rl "All advertising materials mentioning features or use of this software" *|grep -v \.1|grep -v \.5|grep -v \.8 | sort openbsd-compat/libressl-api-compat.c All advertising materials mentioning features or use of this software Reason for backporting is some of the product restrict the BSD-4-Clause usage and the purpose of this commit is to completely remove the BSD-4-Clause license from the openssh. When checked in the master branch, openssh upstream removes the bsd-4 license compeletely from this commit https://github.com/openssh/openssh-portable/commit/7280401bdd77ca54be6867a154cc01e0d72612e0 Hence Backport this commit completely to remove license of BSD-4-clause contents from code. Hunks are refreshed. (From OE-Core rev: 10b9fdce3553a69714de17d3ed5c13c99ec8c460) Signed-off-by: Riyaz Khan <Riyaz.Khan@kpit.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-connectivity/openssh/openssh/7280401bdd77ca54be6867a154cc01e0d72612e0.patch984
-rw-r--r--meta/recipes-connectivity/openssh/openssh_8.9p1.bb1
2 files changed, 985 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/7280401bdd77ca54be6867a154cc01e0d72612e0.patch b/meta/recipes-connectivity/openssh/openssh/7280401bdd77ca54be6867a154cc01e0d72612e0.patch
new file mode 100644
index 0000000000..ebdff1ffe4
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/7280401bdd77ca54be6867a154cc01e0d72612e0.patch
@@ -0,0 +1,984 @@
1From 7280401bdd77ca54be6867a154cc01e0d72612e0 Mon Sep 17 00:00:00 2001
2From: Damien Miller <djm@mindrot.org>
3Date: Fri, 24 Mar 2023 13:56:25 +1100
4Subject: [PATCH] remove support for old libcrypto
5
6OpenSSH now requires LibreSSL 3.1.0 or greater or
7OpenSSL 1.1.1 or greater
8
9with/ok dtucker@
10
11Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/7280401bdd77ca54be6867a154cc01e0d72612e0]
12Comment: Hunk are refreshed, removed couple of hunks from configure.ac as hunk code is not prasent
13and backported to the existing code.
14Signed-off-by: Riyaz Khan <Riyaz.Khan@kpit.com>
15
16---
17 .github/workflows/c-cpp.yml | 7 -
18 INSTALL | 8 +-
19 cipher-aes.c | 2 +-
20 configure.ac | 96 ++---
21 openbsd-compat/libressl-api-compat.c | 556 +--------------------------
22 openbsd-compat/openssl-compat.h | 151 +-------
23 6 files changed, 40 insertions(+), 780 deletions(-)
24
25diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
26index 3d9aa22dba5..d299a32468d 100644
27--- a/.github/workflows/c-cpp.yml
28+++ b/.github/workflows/c-cpp.yml
29@@ -40,18 +40,11 @@
30 - { os: ubuntu-20.04, configs: tcmalloc }
31 - { os: ubuntu-20.04, configs: musl }
32 - { os: ubuntu-latest, configs: libressl-master }
33- - { os: ubuntu-latest, configs: libressl-2.2.9 }
34- - { os: ubuntu-latest, configs: libressl-2.8.3 }
35- - { os: ubuntu-latest, configs: libressl-3.0.2 }
36 - { os: ubuntu-latest, configs: libressl-3.2.6 }
37 - { os: ubuntu-latest, configs: libressl-3.3.4 }
38 - { os: ubuntu-latest, configs: libressl-3.4.1 }
39 - { os: ubuntu-latest, configs: openssl-master }
40 - { os: ubuntu-latest, configs: openssl-noec }
41- - { os: ubuntu-latest, configs: openssl-1.0.1 }
42- - { os: ubuntu-latest, configs: openssl-1.0.1u }
43- - { os: ubuntu-latest, configs: openssl-1.0.2u }
44- - { os: ubuntu-latest, configs: openssl-1.1.0h }
45 - { os: ubuntu-latest, configs: openssl-1.1.1 }
46 - { os: ubuntu-latest, configs: openssl-1.1.1k }
47 - { os: ubuntu-latest, configs: openssl-3.0.0 }
48diff --git a/INSTALL b/INSTALL
49index 68b15e13190..f99d1e2a809 100644
50--- a/INSTALL
51+++ b/INSTALL
52@@ -21,12 +21,8 @@ https://zlib.net/
53
54 libcrypto from either of LibreSSL or OpenSSL. Building without libcrypto
55 is supported but severely restricts the available ciphers and algorithms.
56- - LibreSSL (https://www.libressl.org/)
57- - OpenSSL (https://www.openssl.org) with any of the following versions:
58- - 1.0.x >= 1.0.1 or 1.1.0 >= 1.1.0g or any 1.1.1
59-
60-Note that due to a bug in EVP_CipherInit OpenSSL 1.1 versions prior to
61-1.1.0g can't be used.
62+ - LibreSSL (https://www.libressl.org/) 3.1.0 or greater
63+ - OpenSSL (https://www.openssl.org) 1.1.1 or greater
64
65 LibreSSL/OpenSSL should be compiled as a position-independent library
66 (i.e. -fPIC, eg by configuring OpenSSL as "./config [options] -fPIC"
67diff --git a/cipher-aes.c b/cipher-aes.c
68index 8b101727284..87c763353d8 100644
69--- a/cipher-aes.c
70+++ b/cipher-aes.c
71@@ -69,7 +69,7 @@ ssh_rijndael_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
72
73 static int
74 ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
75- LIBCRYPTO_EVP_INL_TYPE len)
76+ size_t len)
77 {
78 struct ssh_rijndael_ctx *c;
79 u_char buf[RIJNDAEL_BLOCKSIZE];
80diff --git a/configure.ac b/configure.ac
81index 22fee70f604..1c0ccdf19c5 100644
82--- a/configure.ac
83+++ b/configure.ac
84@@ -2744,42 +2744,40 @@
85 #include <openssl/crypto.h>
86 #define DATA "conftest.ssllibver"
87 ]], [[
88- FILE *fd;
89- int rc;
90+ FILE *f;
91
92- fd = fopen(DATA,"w");
93- if(fd == NULL)
94+ if ((f = fopen(DATA, "w")) == NULL)
95 exit(1);
96-#ifndef OPENSSL_VERSION
97-# define OPENSSL_VERSION SSLEAY_VERSION
98-#endif
99-#ifndef HAVE_OPENSSL_VERSION
100-# define OpenSSL_version SSLeay_version
101-#endif
102-#ifndef HAVE_OPENSSL_VERSION_NUM
103-# define OpenSSL_version_num SSLeay
104-#endif
105- if ((rc = fprintf(fd, "%08lx (%s)\n",
106+ if (fprintf(f, "%08lx (%s)",
107 (unsigned long)OpenSSL_version_num(),
108- OpenSSL_version(OPENSSL_VERSION))) < 0)
109+ OpenSSL_version(OPENSSL_VERSION)) < 0)
110+ exit(1);
111+#ifdef LIBRESSL_VERSION_NUMBER
112+ if (fprintf(f, " libressl-%08lx", LIBRESSL_VERSION_NUMBER) < 0)
113+ exit(1);
114+#endif
115+ if (fputc('\n', f) == EOF || fclose(f) == EOF)
116 exit(1);
117-
118 exit(0);
119 ]])],
120 [
121- ssl_library_ver=`cat conftest.ssllibver`
122+ sslver=`cat conftest.ssllibver`
123+ ssl_showver=`echo "$sslver" | sed 's/ libressl-.*//'`
124 # Check version is supported.
125- case "$ssl_library_ver" in
126- 10000*|0*)
127- AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")])
128- ;;
129- 100*) ;; # 1.0.x
130- 101000[[0123456]]*)
131- # https://github.com/openssl/openssl/pull/4613
132- AC_MSG_ERROR([OpenSSL 1.1.x versions prior to 1.1.0g have a bug that breaks their use with OpenSSH (have "$ssl_library_ver")])
133+ case "$sslver" in
134+ 100*|10100*) # 1.0.x, 1.1.0x
135+ AC_MSG_ERROR([OpenSSL >= 1.1.1 required (have "$ssl_showver")])
136 ;;
137 101*) ;; # 1.1.x
138- 200*) ;; # LibreSSL
139+ 200*) # LibreSSL
140+ lver=`echo "$sslver" | sed 's/.*libressl-//'`
141+ case "$lver" in
142+ 2*|300*) # 2.x, 3.0.0
143+ AC_MSG_ERROR([LibreSSL >= 3.1.0 required (have "$ssl_showver")])
144+ ;;
145+ *) ;; # Assume all other versions are good.
146+ esac
147+ ;;
148 300*) ;; # OpenSSL 3
149 301*) ;; # OpenSSL development branch.
150 *)
151@@ -2781,10 +2781,10 @@
152 300*) ;; # OpenSSL 3
153 301*) ;; # OpenSSL development branch.
154 *)
155- AC_MSG_ERROR([Unknown/unsupported OpenSSL version ("$ssl_library_ver")])
156+ AC_MSG_ERROR([Unknown/unsupported OpenSSL version ("$ssl_showver")])
157 ;;
158 esac
159- AC_MSG_RESULT([$ssl_library_ver])
160+ AC_MSG_RESULT([$ssl_showver])
161 ],
162 [
163 AC_MSG_RESULT([not found])
164@@ -2804,9 +2804,6 @@
165 #include <openssl/opensslv.h>
166 #include <openssl/crypto.h>
167 ]], [[
168-#ifndef HAVE_OPENSSL_VERSION_NUM
169-# define OpenSSL_version_num SSLeay
170-#endif
171 exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1);
172 ]])],
173 [
174@@ -2881,44 +2878,13 @@
175 )
176 )
177
178- # LibreSSL/OpenSSL 1.1x API
179+ # LibreSSL/OpenSSL API differences
180 AC_CHECK_FUNCS([ \
181- OPENSSL_init_crypto \
182- DH_get0_key \
183- DH_get0_pqg \
184- DH_set0_key \
185- DH_set_length \
186- DH_set0_pqg \
187- DSA_get0_key \
188- DSA_get0_pqg \
189- DSA_set0_key \
190- DSA_set0_pqg \
191- DSA_SIG_get0 \
192- DSA_SIG_set0 \
193- ECDSA_SIG_get0 \
194- ECDSA_SIG_set0 \
195 EVP_CIPHER_CTX_iv \
196 EVP_CIPHER_CTX_iv_noconst \
197 EVP_CIPHER_CTX_get_iv \
198 EVP_CIPHER_CTX_get_updated_iv \
199 EVP_CIPHER_CTX_set_iv \
200- RSA_get0_crt_params \
201- RSA_get0_factors \
202- RSA_get0_key \
203- RSA_set0_crt_params \
204- RSA_set0_factors \
205- RSA_set0_key \
206- RSA_meth_free \
207- RSA_meth_dup \
208- RSA_meth_set1_name \
209- RSA_meth_get_finish \
210- RSA_meth_set_priv_enc \
211- RSA_meth_set_priv_dec \
212- RSA_meth_set_finish \
213- EVP_PKEY_get0_RSA \
214- EVP_MD_CTX_new \
215- EVP_MD_CTX_free \
216- EVP_chacha20 \
217 ])
218
219 if test "x$openssl_engine" = "xyes" ; then
220@@ -3040,8 +3006,8 @@
221 fi
222 AC_CHECK_FUNCS([crypt DES_crypt])
223
224- # Check for SHA256, SHA384 and SHA512 support in OpenSSL
225- AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512])
226+ # Check for various EVP support in OpenSSL
227+ AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512 EVP_chacha20])
228
229 # Check complete ECC support in OpenSSL
230 AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1])
231diff --git a/openbsd-compat/libressl-api-compat.c b/openbsd-compat/libressl-api-compat.c
232index 498180dc894..59be17397c5 100644
233--- a/openbsd-compat/libressl-api-compat.c
234+++ b/openbsd-compat/libressl-api-compat.c
235@@ -1,129 +1,5 @@
236-/* $OpenBSD: dsa_lib.c,v 1.29 2018/04/14 07:09:21 tb Exp $ */
237-/* $OpenBSD: rsa_lib.c,v 1.37 2018/04/14 07:09:21 tb Exp $ */
238-/* $OpenBSD: evp_lib.c,v 1.17 2018/09/12 06:35:38 djm Exp $ */
239-/* $OpenBSD: dh_lib.c,v 1.32 2018/05/02 15:48:38 tb Exp $ */
240-/* $OpenBSD: p_lib.c,v 1.24 2018/05/30 15:40:50 tb Exp $ */
241-/* $OpenBSD: digest.c,v 1.30 2018/04/14 07:09:21 tb Exp $ */
242-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
243- * All rights reserved.
244- *
245- * This package is an SSL implementation written
246- * by Eric Young (eay@cryptsoft.com).
247- * The implementation was written so as to conform with Netscapes SSL.
248- *
249- * This library is free for commercial and non-commercial use as long as
250- * the following conditions are aheared to. The following conditions
251- * apply to all code found in this distribution, be it the RC4, RSA,
252- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
253- * included with this distribution is covered by the same copyright terms
254- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
255- *
256- * Copyright remains Eric Young's, and as such any Copyright notices in
257- * the code are not to be removed.
258- * If this package is used in a product, Eric Young should be given attribution
259- * as the author of the parts of the library used.
260- * This can be in the form of a textual message at program startup or
261- * in documentation (online or textual) provided with the package.
262- *
263- * Redistribution and use in source and binary forms, with or without
264- * modification, are permitted provided that the following conditions
265- * are met:
266- * 1. Redistributions of source code must retain the copyright
267- * notice, this list of conditions and the following disclaimer.
268- * 2. Redistributions in binary form must reproduce the above copyright
269- * notice, this list of conditions and the following disclaimer in the
270- * documentation and/or other materials provided with the distribution.
271- * 3. All advertising materials mentioning features or use of this software
272- * must display the following acknowledgement:
273- * "This product includes cryptographic software written by
274- * Eric Young (eay@cryptsoft.com)"
275- * The word 'cryptographic' can be left out if the rouines from the library
276- * being used are not cryptographic related :-).
277- * 4. If you include any Windows specific code (or a derivative thereof) from
278- * the apps directory (application code) you must include an acknowledgement:
279- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
280- *
281- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
282- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
283- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
284- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
285- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
286- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
287- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
288- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
289- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
290- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291- * SUCH DAMAGE.
292- *
293- * The licence and distribution terms for any publically available version or
294- * derivative of this code cannot be changed. i.e. this code cannot simply be
295- * copied and put under another distribution licence
296- * [including the GNU Public Licence.]
297- */
298-
299-/* $OpenBSD: dsa_asn1.c,v 1.22 2018/06/14 17:03:19 jsing Exp $ */
300-/* $OpenBSD: ecs_asn1.c,v 1.9 2018/03/17 15:24:44 tb Exp $ */
301-/* $OpenBSD: digest.c,v 1.30 2018/04/14 07:09:21 tb Exp $ */
302-/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
303- * project 2000.
304- */
305-/* ====================================================================
306- * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
307- *
308- * Redistribution and use in source and binary forms, with or without
309- * modification, are permitted provided that the following conditions
310- * are met:
311- *
312- * 1. Redistributions of source code must retain the above copyright
313- * notice, this list of conditions and the following disclaimer.
314- *
315- * 2. Redistributions in binary form must reproduce the above copyright
316- * notice, this list of conditions and the following disclaimer in
317- * the documentation and/or other materials provided with the
318- * distribution.
319- *
320- * 3. All advertising materials mentioning features or use of this
321- * software must display the following acknowledgment:
322- * "This product includes software developed by the OpenSSL Project
323- * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
324- *
325- * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
326- * endorse or promote products derived from this software without
327- * prior written permission. For written permission, please contact
328- * licensing@OpenSSL.org.
329- *
330- * 5. Products derived from this software may not be called "OpenSSL"
331- * nor may "OpenSSL" appear in their names without prior written
332- * permission of the OpenSSL Project.
333- *
334- * 6. Redistributions of any form whatsoever must retain the following
335- * acknowledgment:
336- * "This product includes software developed by the OpenSSL Project
337- * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
338- *
339- * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
340- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
341- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
342- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
343- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
344- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
345- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
346- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
347- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
348- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
349- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
350- * OF THE POSSIBILITY OF SUCH DAMAGE.
351- * ====================================================================
352- *
353- * This product includes cryptographic software written by Eric Young
354- * (eay@cryptsoft.com). This product includes software written by Tim
355- * Hudson (tjh@cryptsoft.com).
356- *
357- */
358-
359-/* $OpenBSD: rsa_meth.c,v 1.2 2018/09/12 06:35:38 djm Exp $ */
360 /*
361- * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
362+ * Copyright (c) 2018 Damien Miller <djm@mindrot.org>
363 *
364 * Permission to use, copy, modify, and distribute this software for any
365 * purpose with or without fee is hereby granted, provided that the above
366@@ -147,192 +23,7 @@
367 #include <stdlib.h>
368 #include <string.h>
369
370-#include <openssl/err.h>
371-#include <openssl/bn.h>
372-#include <openssl/dsa.h>
373-#include <openssl/rsa.h>
374 #include <openssl/evp.h>
375-#ifdef OPENSSL_HAS_ECC
376-#include <openssl/ecdsa.h>
377-#endif
378-#include <openssl/dh.h>
379-
380-#ifndef HAVE_DSA_GET0_PQG
381-void
382-DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
383-{
384- if (p != NULL)
385- *p = d->p;
386- if (q != NULL)
387- *q = d->q;
388- if (g != NULL)
389- *g = d->g;
390-}
391-#endif /* HAVE_DSA_GET0_PQG */
392-
393-#ifndef HAVE_DSA_SET0_PQG
394-int
395-DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)
396-{
397- if ((d->p == NULL && p == NULL) || (d->q == NULL && q == NULL) ||
398- (d->g == NULL && g == NULL))
399- return 0;
400-
401- if (p != NULL) {
402- BN_free(d->p);
403- d->p = p;
404- }
405- if (q != NULL) {
406- BN_free(d->q);
407- d->q = q;
408- }
409- if (g != NULL) {
410- BN_free(d->g);
411- d->g = g;
412- }
413-
414- return 1;
415-}
416-#endif /* HAVE_DSA_SET0_PQG */
417-
418-#ifndef HAVE_DSA_GET0_KEY
419-void
420-DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key)
421-{
422- if (pub_key != NULL)
423- *pub_key = d->pub_key;
424- if (priv_key != NULL)
425- *priv_key = d->priv_key;
426-}
427-#endif /* HAVE_DSA_GET0_KEY */
428-
429-#ifndef HAVE_DSA_SET0_KEY
430-int
431-DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
432-{
433- if (d->pub_key == NULL && pub_key == NULL)
434- return 0;
435-
436- if (pub_key != NULL) {
437- BN_free(d->pub_key);
438- d->pub_key = pub_key;
439- }
440- if (priv_key != NULL) {
441- BN_free(d->priv_key);
442- d->priv_key = priv_key;
443- }
444-
445- return 1;
446-}
447-#endif /* HAVE_DSA_SET0_KEY */
448-
449-#ifndef HAVE_RSA_GET0_KEY
450-void
451-RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
452-{
453- if (n != NULL)
454- *n = r->n;
455- if (e != NULL)
456- *e = r->e;
457- if (d != NULL)
458- *d = r->d;
459-}
460-#endif /* HAVE_RSA_GET0_KEY */
461-
462-#ifndef HAVE_RSA_SET0_KEY
463-int
464-RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
465-{
466- if ((r->n == NULL && n == NULL) || (r->e == NULL && e == NULL))
467- return 0;
468-
469- if (n != NULL) {
470- BN_free(r->n);
471- r->n = n;
472- }
473- if (e != NULL) {
474- BN_free(r->e);
475- r->e = e;
476- }
477- if (d != NULL) {
478- BN_free(r->d);
479- r->d = d;
480- }
481-
482- return 1;
483-}
484-#endif /* HAVE_RSA_SET0_KEY */
485-
486-#ifndef HAVE_RSA_GET0_CRT_PARAMS
487-void
488-RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1,
489- const BIGNUM **iqmp)
490-{
491- if (dmp1 != NULL)
492- *dmp1 = r->dmp1;
493- if (dmq1 != NULL)
494- *dmq1 = r->dmq1;
495- if (iqmp != NULL)
496- *iqmp = r->iqmp;
497-}
498-#endif /* HAVE_RSA_GET0_CRT_PARAMS */
499-
500-#ifndef HAVE_RSA_SET0_CRT_PARAMS
501-int
502-RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)
503-{
504- if ((r->dmp1 == NULL && dmp1 == NULL) ||
505- (r->dmq1 == NULL && dmq1 == NULL) ||
506- (r->iqmp == NULL && iqmp == NULL))
507- return 0;
508-
509- if (dmp1 != NULL) {
510- BN_free(r->dmp1);
511- r->dmp1 = dmp1;
512- }
513- if (dmq1 != NULL) {
514- BN_free(r->dmq1);
515- r->dmq1 = dmq1;
516- }
517- if (iqmp != NULL) {
518- BN_free(r->iqmp);
519- r->iqmp = iqmp;
520- }
521-
522- return 1;
523-}
524-#endif /* HAVE_RSA_SET0_CRT_PARAMS */
525-
526-#ifndef HAVE_RSA_GET0_FACTORS
527-void
528-RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)
529-{
530- if (p != NULL)
531- *p = r->p;
532- if (q != NULL)
533- *q = r->q;
534-}
535-#endif /* HAVE_RSA_GET0_FACTORS */
536-
537-#ifndef HAVE_RSA_SET0_FACTORS
538-int
539-RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
540-{
541- if ((r->p == NULL && p == NULL) || (r->q == NULL && q == NULL))
542- return 0;
543-
544- if (p != NULL) {
545- BN_free(r->p);
546- r->p = p;
547- }
548- if (q != NULL) {
549- BN_free(r->q);
550- r->q = q;
551- }
552-
553- return 1;
554-}
555-#endif /* HAVE_RSA_SET0_FACTORS */
556
557 #ifndef HAVE_EVP_CIPHER_CTX_GET_IV
558 int
559@@ -392,249 +83,4 @@ EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx, const unsigned char *iv, size_t len)
560 }
561 #endif /* HAVE_EVP_CIPHER_CTX_SET_IV */
562
563-#ifndef HAVE_DSA_SIG_GET0
564-void
565-DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
566-{
567- if (pr != NULL)
568- *pr = sig->r;
569- if (ps != NULL)
570- *ps = sig->s;
571-}
572-#endif /* HAVE_DSA_SIG_GET0 */
573-
574-#ifndef HAVE_DSA_SIG_SET0
575-int
576-DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)
577-{
578- if (r == NULL || s == NULL)
579- return 0;
580-
581- BN_clear_free(sig->r);
582- sig->r = r;
583- BN_clear_free(sig->s);
584- sig->s = s;
585-
586- return 1;
587-}
588-#endif /* HAVE_DSA_SIG_SET0 */
589-
590-#ifdef OPENSSL_HAS_ECC
591-#ifndef HAVE_ECDSA_SIG_GET0
592-void
593-ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
594-{
595- if (pr != NULL)
596- *pr = sig->r;
597- if (ps != NULL)
598- *ps = sig->s;
599-}
600-#endif /* HAVE_ECDSA_SIG_GET0 */
601-
602-#ifndef HAVE_ECDSA_SIG_SET0
603-int
604-ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
605-{
606- if (r == NULL || s == NULL)
607- return 0;
608-
609- BN_clear_free(sig->r);
610- BN_clear_free(sig->s);
611- sig->r = r;
612- sig->s = s;
613- return 1;
614-}
615-#endif /* HAVE_ECDSA_SIG_SET0 */
616-#endif /* OPENSSL_HAS_ECC */
617-
618-#ifndef HAVE_DH_GET0_PQG
619-void
620-DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
621-{
622- if (p != NULL)
623- *p = dh->p;
624- if (q != NULL)
625- *q = dh->q;
626- if (g != NULL)
627- *g = dh->g;
628-}
629-#endif /* HAVE_DH_GET0_PQG */
630-
631-#ifndef HAVE_DH_SET0_PQG
632-int
633-DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
634-{
635- if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL))
636- return 0;
637-
638- if (p != NULL) {
639- BN_free(dh->p);
640- dh->p = p;
641- }
642- if (q != NULL) {
643- BN_free(dh->q);
644- dh->q = q;
645- }
646- if (g != NULL) {
647- BN_free(dh->g);
648- dh->g = g;
649- }
650-
651- return 1;
652-}
653-#endif /* HAVE_DH_SET0_PQG */
654-
655-#ifndef HAVE_DH_GET0_KEY
656-void
657-DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
658-{
659- if (pub_key != NULL)
660- *pub_key = dh->pub_key;
661- if (priv_key != NULL)
662- *priv_key = dh->priv_key;
663-}
664-#endif /* HAVE_DH_GET0_KEY */
665-
666-#ifndef HAVE_DH_SET0_KEY
667-int
668-DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
669-{
670- if (pub_key != NULL) {
671- BN_free(dh->pub_key);
672- dh->pub_key = pub_key;
673- }
674- if (priv_key != NULL) {
675- BN_free(dh->priv_key);
676- dh->priv_key = priv_key;
677- }
678-
679- return 1;
680-}
681-#endif /* HAVE_DH_SET0_KEY */
682-
683-#ifndef HAVE_DH_SET_LENGTH
684-int
685-DH_set_length(DH *dh, long length)
686-{
687- if (length < 0 || length > INT_MAX)
688- return 0;
689-
690- dh->length = length;
691- return 1;
692-}
693-#endif /* HAVE_DH_SET_LENGTH */
694-
695-#ifndef HAVE_RSA_METH_FREE
696-void
697-RSA_meth_free(RSA_METHOD *meth)
698-{
699- if (meth != NULL) {
700- free((char *)meth->name);
701- free(meth);
702- }
703-}
704-#endif /* HAVE_RSA_METH_FREE */
705-
706-#ifndef HAVE_RSA_METH_DUP
707-RSA_METHOD *
708-RSA_meth_dup(const RSA_METHOD *meth)
709-{
710- RSA_METHOD *copy;
711-
712- if ((copy = calloc(1, sizeof(*copy))) == NULL)
713- return NULL;
714- memcpy(copy, meth, sizeof(*copy));
715- if ((copy->name = strdup(meth->name)) == NULL) {
716- free(copy);
717- return NULL;
718- }
719-
720- return copy;
721-}
722-#endif /* HAVE_RSA_METH_DUP */
723-
724-#ifndef HAVE_RSA_METH_SET1_NAME
725-int
726-RSA_meth_set1_name(RSA_METHOD *meth, const char *name)
727-{
728- char *copy;
729-
730- if ((copy = strdup(name)) == NULL)
731- return 0;
732- free((char *)meth->name);
733- meth->name = copy;
734- return 1;
735-}
736-#endif /* HAVE_RSA_METH_SET1_NAME */
737-
738-#ifndef HAVE_RSA_METH_GET_FINISH
739-int
740-(*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa)
741-{
742- return meth->finish;
743-}
744-#endif /* HAVE_RSA_METH_GET_FINISH */
745-
746-#ifndef HAVE_RSA_METH_SET_PRIV_ENC
747-int
748-RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen,
749- const unsigned char *from, unsigned char *to, RSA *rsa, int padding))
750-{
751- meth->rsa_priv_enc = priv_enc;
752- return 1;
753-}
754-#endif /* HAVE_RSA_METH_SET_PRIV_ENC */
755-
756-#ifndef HAVE_RSA_METH_SET_PRIV_DEC
757-int
758-RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen,
759- const unsigned char *from, unsigned char *to, RSA *rsa, int padding))
760-{
761- meth->rsa_priv_dec = priv_dec;
762- return 1;
763-}
764-#endif /* HAVE_RSA_METH_SET_PRIV_DEC */
765-
766-#ifndef HAVE_RSA_METH_SET_FINISH
767-int
768-RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa))
769-{
770- meth->finish = finish;
771- return 1;
772-}
773-#endif /* HAVE_RSA_METH_SET_FINISH */
774-
775-#ifndef HAVE_EVP_PKEY_GET0_RSA
776-RSA *
777-EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
778-{
779- if (pkey->type != EVP_PKEY_RSA) {
780- /* EVPerror(EVP_R_EXPECTING_AN_RSA_KEY); */
781- return NULL;
782- }
783- return pkey->pkey.rsa;
784-}
785-#endif /* HAVE_EVP_PKEY_GET0_RSA */
786-
787-#ifndef HAVE_EVP_MD_CTX_NEW
788-EVP_MD_CTX *
789-EVP_MD_CTX_new(void)
790-{
791- return calloc(1, sizeof(EVP_MD_CTX));
792-}
793-#endif /* HAVE_EVP_MD_CTX_NEW */
794-
795-#ifndef HAVE_EVP_MD_CTX_FREE
796-void
797-EVP_MD_CTX_free(EVP_MD_CTX *ctx)
798-{
799- if (ctx == NULL)
800- return;
801-
802- EVP_MD_CTX_cleanup(ctx);
803-
804- free(ctx);
805-}
806-#endif /* HAVE_EVP_MD_CTX_FREE */
807-
808 #endif /* WITH_OPENSSL */
809diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
810index 61a69dd56eb..d0dd2c3450d 100644
811--- a/openbsd-compat/openssl-compat.h
812+++ b/openbsd-compat/openssl-compat.h
813@@ -33,26 +33,13 @@
814 int ssh_compatible_openssl(long, long);
815 void ssh_libcrypto_init(void);
816
817-#if (OPENSSL_VERSION_NUMBER < 0x1000100fL)
818-# error OpenSSL 1.0.1 or greater is required
819+#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
820+# error OpenSSL 1.1.0 or greater is required
821 #endif
822-
823-#ifndef OPENSSL_VERSION
824-# define OPENSSL_VERSION SSLEAY_VERSION
825-#endif
826-
827-#ifndef HAVE_OPENSSL_VERSION
828-# define OpenSSL_version(x) SSLeay_version(x)
829-#endif
830-
831-#ifndef HAVE_OPENSSL_VERSION_NUM
832-# define OpenSSL_version_num SSLeay
833-#endif
834-
835-#if OPENSSL_VERSION_NUMBER < 0x10000001L
836-# define LIBCRYPTO_EVP_INL_TYPE unsigned int
837-#else
838-# define LIBCRYPTO_EVP_INL_TYPE size_t
839+#ifdef LIBRESSL_VERSION_NUMBER
840+# if LIBRESSL_VERSION_NUMBER < 0x3010000fL
841+# error LibreSSL 3.1.0 or greater is required
842+# endif
843 #endif
844
845 #ifndef OPENSSL_RSA_MAX_MODULUS_BITS
846@@ -68,25 +55,6 @@ void ssh_libcrypto_init(void);
847 # endif
848 #endif
849
850-/* LibreSSL/OpenSSL 1.1x API compat */
851-#ifndef HAVE_DSA_GET0_PQG
852-void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q,
853- const BIGNUM **g);
854-#endif /* HAVE_DSA_GET0_PQG */
855-
856-#ifndef HAVE_DSA_SET0_PQG
857-int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
858-#endif /* HAVE_DSA_SET0_PQG */
859-
860-#ifndef HAVE_DSA_GET0_KEY
861-void DSA_get0_key(const DSA *d, const BIGNUM **pub_key,
862- const BIGNUM **priv_key);
863-#endif /* HAVE_DSA_GET0_KEY */
864-
865-#ifndef HAVE_DSA_SET0_KEY
866-int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
867-#endif /* HAVE_DSA_SET0_KEY */
868-
869 #ifndef HAVE_EVP_CIPHER_CTX_GET_IV
870 # ifdef HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV
871 # define EVP_CIPHER_CTX_get_iv EVP_CIPHER_CTX_get_updated_iv
872@@ -101,112 +69,5 @@ int EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx,
873 const unsigned char *iv, size_t len);
874 #endif /* HAVE_EVP_CIPHER_CTX_SET_IV */
875
876-#ifndef HAVE_RSA_GET0_KEY
877-void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e,
878- const BIGNUM **d);
879-#endif /* HAVE_RSA_GET0_KEY */
880-
881-#ifndef HAVE_RSA_SET0_KEY
882-int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
883-#endif /* HAVE_RSA_SET0_KEY */
884-
885-#ifndef HAVE_RSA_GET0_CRT_PARAMS
886-void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1,
887- const BIGNUM **iqmp);
888-#endif /* HAVE_RSA_GET0_CRT_PARAMS */
889-
890-#ifndef HAVE_RSA_SET0_CRT_PARAMS
891-int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
892-#endif /* HAVE_RSA_SET0_CRT_PARAMS */
893-
894-#ifndef HAVE_RSA_GET0_FACTORS
895-void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
896-#endif /* HAVE_RSA_GET0_FACTORS */
897-
898-#ifndef HAVE_RSA_SET0_FACTORS
899-int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
900-#endif /* HAVE_RSA_SET0_FACTORS */
901-
902-#ifndef DSA_SIG_GET0
903-void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
904-#endif /* DSA_SIG_GET0 */
905-
906-#ifndef DSA_SIG_SET0
907-int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
908-#endif /* DSA_SIG_SET0 */
909-
910-#ifdef OPENSSL_HAS_ECC
911-#ifndef HAVE_ECDSA_SIG_GET0
912-void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
913-#endif /* HAVE_ECDSA_SIG_GET0 */
914-
915-#ifndef HAVE_ECDSA_SIG_SET0
916-int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
917-#endif /* HAVE_ECDSA_SIG_SET0 */
918-#endif /* OPENSSL_HAS_ECC */
919-
920-#ifndef HAVE_DH_GET0_PQG
921-void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q,
922- const BIGNUM **g);
923-#endif /* HAVE_DH_GET0_PQG */
924-
925-#ifndef HAVE_DH_SET0_PQG
926-int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
927-#endif /* HAVE_DH_SET0_PQG */
928-
929-#ifndef HAVE_DH_GET0_KEY
930-void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
931-#endif /* HAVE_DH_GET0_KEY */
932-
933-#ifndef HAVE_DH_SET0_KEY
934-int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
935-#endif /* HAVE_DH_SET0_KEY */
936-
937-#ifndef HAVE_DH_SET_LENGTH
938-int DH_set_length(DH *dh, long length);
939-#endif /* HAVE_DH_SET_LENGTH */
940-
941-#ifndef HAVE_RSA_METH_FREE
942-void RSA_meth_free(RSA_METHOD *meth);
943-#endif /* HAVE_RSA_METH_FREE */
944-
945-#ifndef HAVE_RSA_METH_DUP
946-RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
947-#endif /* HAVE_RSA_METH_DUP */
948-
949-#ifndef HAVE_RSA_METH_SET1_NAME
950-int RSA_meth_set1_name(RSA_METHOD *meth, const char *name);
951-#endif /* HAVE_RSA_METH_SET1_NAME */
952-
953-#ifndef HAVE_RSA_METH_GET_FINISH
954-int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa);
955-#endif /* HAVE_RSA_METH_GET_FINISH */
956-
957-#ifndef HAVE_RSA_METH_SET_PRIV_ENC
958-int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen,
959- const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
960-#endif /* HAVE_RSA_METH_SET_PRIV_ENC */
961-
962-#ifndef HAVE_RSA_METH_SET_PRIV_DEC
963-int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen,
964- const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
965-#endif /* HAVE_RSA_METH_SET_PRIV_DEC */
966-
967-#ifndef HAVE_RSA_METH_SET_FINISH
968-int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa));
969-#endif /* HAVE_RSA_METH_SET_FINISH */
970-
971-#ifndef HAVE_EVP_PKEY_GET0_RSA
972-RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey);
973-#endif /* HAVE_EVP_PKEY_GET0_RSA */
974-
975-#ifndef HAVE_EVP_MD_CTX_new
976-EVP_MD_CTX *EVP_MD_CTX_new(void);
977-#endif /* HAVE_EVP_MD_CTX_new */
978-
979-#ifndef HAVE_EVP_MD_CTX_free
980-void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
981-#endif /* HAVE_EVP_MD_CTX_free */
982-
983 #endif /* WITH_OPENSSL */
984 #endif /* _OPENSSL_COMPAT_H */
diff --git a/meta/recipes-connectivity/openssh/openssh_8.9p1.bb b/meta/recipes-connectivity/openssh/openssh_8.9p1.bb
index 6057d055f4..1d53c2488b 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.9p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.9p1.bb
@@ -26,6 +26,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
26 file://add-test-support-for-busybox.patch \ 26 file://add-test-support-for-busybox.patch \
27 file://f107467179428a0e3ea9e4aa9738ac12ff02822d.patch \ 27 file://f107467179428a0e3ea9e4aa9738ac12ff02822d.patch \
28 file://0001-Default-to-not-using-sandbox-when-cross-compiling.patch \ 28 file://0001-Default-to-not-using-sandbox-when-cross-compiling.patch \
29 file://7280401bdd77ca54be6867a154cc01e0d72612e0.patch \
29 " 30 "
30SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7" 31SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7"
31 32