diff options
| -rw-r--r-- | meta-oe/recipes-crypto/libsodium/libsodium/CVE-2025-69277.patch | 61 | ||||
| -rw-r--r-- | meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb | 4 |
2 files changed, 64 insertions, 1 deletions
diff --git a/meta-oe/recipes-crypto/libsodium/libsodium/CVE-2025-69277.patch b/meta-oe/recipes-crypto/libsodium/libsodium/CVE-2025-69277.patch new file mode 100644 index 0000000000..55fada2a89 --- /dev/null +++ b/meta-oe/recipes-crypto/libsodium/libsodium/CVE-2025-69277.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From ad3004ec8731730e93fcfbbc824e67eadc1c1bae Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Frank Denis <github@pureftpd.org> | ||
| 3 | Date: Mon, 29 Dec 2025 23:22:15 +0100 | ||
| 4 | Subject: [PATCH] core_ed25519_is_valid_point: check Y==Z in addition to X==0 | ||
| 5 | |||
| 6 | CVE: CVE-2025-69277 | ||
| 7 | Upstream-Status: Backport [https://github.com/jedisct1/libsodium/commit/ad3004ec8731730e93fcfbbc824e67eadc1c1bae] | ||
| 8 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 9 | --- | ||
| 10 | src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c | 5 ++++- | ||
| 11 | test/default/core_ed25519.c | 7 ++++++- | ||
| 12 | 2 files changed, 10 insertions(+), 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c | ||
| 15 | index d3020132..4b824f6d 100644 | ||
| 16 | --- a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c | ||
| 17 | +++ b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c | ||
| 18 | @@ -1029,10 +1029,13 @@ int | ||
| 19 | ge25519_is_on_main_subgroup(const ge25519_p3 *p) | ||
| 20 | { | ||
| 21 | ge25519_p3 pl; | ||
| 22 | + fe25519 t; | ||
| 23 | |||
| 24 | ge25519_mul_l(&pl, p); | ||
| 25 | |||
| 26 | - return fe25519_iszero(pl.X); | ||
| 27 | + fe25519_sub(t, pl.Y, pl.Z); | ||
| 28 | + | ||
| 29 | + return fe25519_iszero(pl.X) & fe25519_iszero(t); | ||
| 30 | } | ||
| 31 | |||
| 32 | int | ||
| 33 | diff --git a/test/default/core_ed25519.c b/test/default/core_ed25519.c | ||
| 34 | index bc457493..02f72bd6 100644 | ||
| 35 | --- a/test/default/core_ed25519.c | ||
| 36 | +++ b/test/default/core_ed25519.c | ||
| 37 | @@ -13,6 +13,10 @@ static const unsigned char max_canonical_p[32] = { | ||
| 38 | 0xe4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
| 39 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f | ||
| 40 | }; | ||
| 41 | +static const unsigned char not_main_subgroup_p[32] = { | ||
| 42 | + 0x95, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, | ||
| 43 | + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99 | ||
| 44 | +}; | ||
| 45 | static const unsigned char L_p1[32] = { | ||
| 46 | 0xee, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, | ||
| 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 | ||
| 48 | @@ -142,11 +146,12 @@ main(void) | ||
| 49 | assert(crypto_core_ed25519_is_valid_point(p) == 0); | ||
| 50 | |||
| 51 | p[0] = 9; | ||
| 52 | - assert(crypto_core_ed25519_is_valid_point(p) == 1); | ||
| 53 | + assert(crypto_core_ed25519_is_valid_point(p) == 0); | ||
| 54 | |||
| 55 | assert(crypto_core_ed25519_is_valid_point(max_canonical_p) == 1); | ||
| 56 | assert(crypto_core_ed25519_is_valid_point(non_canonical_invalid_p) == 0); | ||
| 57 | assert(crypto_core_ed25519_is_valid_point(non_canonical_p) == 0); | ||
| 58 | + assert(crypto_core_ed25519_is_valid_point(not_main_subgroup_p) == 0); | ||
| 59 | |||
| 60 | memcpy(p2, p, crypto_core_ed25519_BYTES); | ||
| 61 | add_P(p2); | ||
diff --git a/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb b/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb index 2e678f3f0f..9b60dcc62c 100644 --- a/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb +++ b/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb | |||
| @@ -5,7 +5,9 @@ LICENSE = "ISC" | |||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=49ce3b426e6a002e23a1387248e6dbe9" | 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=49ce3b426e6a002e23a1387248e6dbe9" |
| 6 | 6 | ||
| 7 | SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz \ | 7 | SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz \ |
| 8 | file://0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch" | 8 | file://0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch \ |
| 9 | file://CVE-2025-69277.patch \ | ||
| 10 | " | ||
| 9 | SRC_URI[sha256sum] = "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea" | 11 | SRC_URI[sha256sum] = "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea" |
| 10 | 12 | ||
| 11 | inherit autotools | 13 | inherit autotools |
