diff options
| author | Stefan Ghinea <stefan.ghinea@windriver.com> | 2021-04-23 20:18:26 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-24 17:53:05 +0100 |
| commit | 01bd2843392160c4656ad6ee6cc12c40c06631fb (patch) | |
| tree | 4beef37d5d3819e2f67b2165f9bd9b710f2c6f95 | |
| parent | 35d6da6fe5410419fd2f7028073aa41b05c0c984 (diff) | |
| download | poky-01bd2843392160c4656ad6ee6cc12c40c06631fb.tar.gz | |
libssh2: fix build failure with option no-ecdsa
libssh2 fails at do_compile if
DEPRECATED_CRYPTO_FLAGS = "no-ecdsa" is set in recipe:
../src/.libs/libssh2.so: undefined reference to
`LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY'
References:
https://github.com/libssh2/libssh2/issues/549
Upstream patches:
https://github.com/libssh2/libssh2/commit/1f76151c92e1b52e9c24ebf06adc77fbd6c062bc
(From OE-Core rev: 2bb146e7315f8080cb49a95212231ccb76a4a822)
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch | 112 | ||||
| -rw-r--r-- | meta/recipes-support/libssh2/libssh2_1.9.0.bb | 1 |
2 files changed, 113 insertions, 0 deletions
diff --git a/meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch b/meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch new file mode 100644 index 0000000000..b331c1bf81 --- /dev/null +++ b/meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | From 1f76151c92e1b52e9c24ebf06adc77fbd6c062bc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Will Cosgrove <will@panic.com> | ||
| 3 | Date: Tue, 26 Jan 2021 11:41:21 -0800 | ||
| 4 | Subject: [PATCH] kex.c: move EC macro outside of if check #549 (#550) | ||
| 5 | |||
| 6 | File: kex.c | ||
| 7 | |||
| 8 | Notes: | ||
| 9 | Moved the macro LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY outside of the LIBSSH2_ECDSA since it's also now used by the ED25519 code. | ||
| 10 | |||
| 11 | Sha 256, 384 and 512 need to be defined for all backends now even if they aren't used directly. I believe this is already the case, but just a heads up. | ||
| 12 | |||
| 13 | Credit: | ||
| 14 | Stefan-Ghinea | ||
| 15 | |||
| 16 | Upstream-Status: Backport | ||
| 17 | |||
| 18 | Reference to upstream patch: | ||
| 19 | https://github.com/libssh2/libssh2/commit/1f76151c92e1b52e9c24ebf06adc77fbd6c062bc | ||
| 20 | |||
| 21 | Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com> | ||
| 22 | --- | ||
| 23 | src/kex.c | 66 +++++++++++++++++++++++++++---------------------------- | ||
| 24 | 1 file changed, 33 insertions(+), 33 deletions(-) | ||
| 25 | |||
| 26 | diff --git a/src/kex.c b/src/kex.c | ||
| 27 | index cb16639..19ab6ec 100644 | ||
| 28 | --- a/src/kex.c | ||
| 29 | +++ b/src/kex.c | ||
| 30 | @@ -1885,39 +1885,6 @@ kex_method_diffie_hellman_group_exchange_sha256_key_exchange | ||
| 31 | } | ||
| 32 | |||
| 33 | |||
| 34 | -#if LIBSSH2_ECDSA | ||
| 35 | - | ||
| 36 | -/* kex_session_ecdh_curve_type | ||
| 37 | - * returns the EC curve type by name used in key exchange | ||
| 38 | - */ | ||
| 39 | - | ||
| 40 | -static int | ||
| 41 | -kex_session_ecdh_curve_type(const char *name, libssh2_curve_type *out_type) | ||
| 42 | -{ | ||
| 43 | - int ret = 0; | ||
| 44 | - libssh2_curve_type type; | ||
| 45 | - | ||
| 46 | - if(name == NULL) | ||
| 47 | - return -1; | ||
| 48 | - | ||
| 49 | - if(strcmp(name, "ecdh-sha2-nistp256") == 0) | ||
| 50 | - type = LIBSSH2_EC_CURVE_NISTP256; | ||
| 51 | - else if(strcmp(name, "ecdh-sha2-nistp384") == 0) | ||
| 52 | - type = LIBSSH2_EC_CURVE_NISTP384; | ||
| 53 | - else if(strcmp(name, "ecdh-sha2-nistp521") == 0) | ||
| 54 | - type = LIBSSH2_EC_CURVE_NISTP521; | ||
| 55 | - else { | ||
| 56 | - ret = -1; | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - if(ret == 0 && out_type) { | ||
| 60 | - *out_type = type; | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - return ret; | ||
| 64 | -} | ||
| 65 | - | ||
| 66 | - | ||
| 67 | /* LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY | ||
| 68 | * | ||
| 69 | * Macro that create and verifies EC SHA hash with a given digest bytes | ||
| 70 | @@ -2027,6 +1994,39 @@ kex_session_ecdh_curve_type(const char *name, libssh2_curve_type *out_type) | ||
| 71 | } \ | ||
| 72 | |||
| 73 | |||
| 74 | +#if LIBSSH2_ECDSA | ||
| 75 | + | ||
| 76 | +/* kex_session_ecdh_curve_type | ||
| 77 | + * returns the EC curve type by name used in key exchange | ||
| 78 | + */ | ||
| 79 | + | ||
| 80 | +static int | ||
| 81 | +kex_session_ecdh_curve_type(const char *name, libssh2_curve_type *out_type) | ||
| 82 | +{ | ||
| 83 | + int ret = 0; | ||
| 84 | + libssh2_curve_type type; | ||
| 85 | + | ||
| 86 | + if(name == NULL) | ||
| 87 | + return -1; | ||
| 88 | + | ||
| 89 | + if(strcmp(name, "ecdh-sha2-nistp256") == 0) | ||
| 90 | + type = LIBSSH2_EC_CURVE_NISTP256; | ||
| 91 | + else if(strcmp(name, "ecdh-sha2-nistp384") == 0) | ||
| 92 | + type = LIBSSH2_EC_CURVE_NISTP384; | ||
| 93 | + else if(strcmp(name, "ecdh-sha2-nistp521") == 0) | ||
| 94 | + type = LIBSSH2_EC_CURVE_NISTP521; | ||
| 95 | + else { | ||
| 96 | + ret = -1; | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + if(ret == 0 && out_type) { | ||
| 100 | + *out_type = type; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + return ret; | ||
| 104 | +} | ||
| 105 | + | ||
| 106 | + | ||
| 107 | /* ecdh_sha2_nistp | ||
| 108 | * Elliptic Curve Diffie Hellman Key Exchange | ||
| 109 | */ | ||
| 110 | -- | ||
| 111 | 2.17.1 | ||
| 112 | |||
diff --git a/meta/recipes-support/libssh2/libssh2_1.9.0.bb b/meta/recipes-support/libssh2/libssh2_1.9.0.bb index 0b8ccbd217..a5451628e7 100644 --- a/meta/recipes-support/libssh2/libssh2_1.9.0.bb +++ b/meta/recipes-support/libssh2/libssh2_1.9.0.bb | |||
| @@ -11,6 +11,7 @@ SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \ | |||
| 11 | file://CVE-2019-17498.patch \ | 11 | file://CVE-2019-17498.patch \ |
| 12 | file://0001-configure-Conditionally-undefine-backend-m4-macro.patch \ | 12 | file://0001-configure-Conditionally-undefine-backend-m4-macro.patch \ |
| 13 | file://run-ptest \ | 13 | file://run-ptest \ |
| 14 | file://0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch \ | ||
| 14 | " | 15 | " |
| 15 | 16 | ||
| 16 | SRC_URI_append_ptest = " file://0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch" | 17 | SRC_URI_append_ptest = " file://0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch" |
