Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 508458 Details for
Bug 639858
=net-vpn/strongswan-5.5.3 - ?
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
user-patch-1
strongswan-4.4.0-5.5.3_gmp_mpz_export.patch (text/plain), 1.53 KB, created by
Andreas Marx
on 2017-12-06 10:57:09 UTC
(
hide
)
Description:
user-patch-1
Filename:
MIME Type:
Creator:
Andreas Marx
Created:
2017-12-06 10:57:09 UTC
Size:
1.53 KB
patch
obsolete
>From ed282e9a463c068146c945984fdea7828e663861 Mon Sep 17 00:00:00 2001 >From: Tobias Brunner <tobias@strongswan.org> >Date: Mon, 29 May 2017 11:59:34 +0200 >Subject: [PATCH] gmp: Fix RSA signature verification for m >= n > >By definition, m must be <= n-1, we didn't enforce that and because >mpz_export() returns NULL if the passed value is zero a crash could have >been triggered with m == n. > >Fixes CVE-2017-11185. >--- > src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c b/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c >index 32a72ac9600b..a741f85d4f62 100644 >--- a/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c >+++ b/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c >@@ -78,11 +78,17 @@ static chunk_t rsaep(private_gmp_rsa_public_key_t *this, chunk_t data) > mpz_t m, c; > chunk_t encrypted; > >- mpz_init(c); > mpz_init(m); >- > mpz_import(m, data.len, 1, 1, 1, 0, data.ptr); > >+ if (mpz_cmp_ui(m, 0) <= 0 || mpz_cmp(m, this->n) >= 0) >+ { /* m must be <= n-1, but 0 is a valid value, doesn't really make sense >+ * here, though */ >+ mpz_clear(m); >+ return chunk_empty; >+ } >+ >+ mpz_init(c); > mpz_powm(c, m, this->e, this->n); > > encrypted.len = this->k; >@@ -150,7 +156,7 @@ static bool verify_emsa_pkcs1_signature(private_gmp_rsa_public_key_t *this, > */ > > /* check magic bytes */ >- if (*(em.ptr) != 0x00 || *(em.ptr+1) != 0x01) >+ if (em.len < 2 || *(em.ptr) != 0x00 || *(em.ptr+1) != 0x01) > { > goto end; > } >-- >2.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 639858
:
508456
| 508458 |
508462