lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1209121333031.4482@tundra.namei.org>
Date:	Wed, 12 Sep 2012 13:34:38 +1000 (EST)
From:	James Morris <jmorris@...ei.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
cc:	linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [GIT] Digital signature library bugfix

Please apply for v3.6.

The following changes since commit 0bd1189e239c76eb3a50e458548fbe7e4a5dfff1:
  Linus Torvalds (1):
        Merge branch 'for-3.6-fixes' of git://git.kernel.org/.../tj/wq

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git for-linus

Dmitry Kasatkin (1):
      digsig: add hash size comparision on signature verification

 lib/digsig.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

commit 83e7c8fb4347186f6723f4c7d176999becbb3830
Author: Dmitry Kasatkin <dmitry.kasatkin@...el.com>
Date:   Thu Sep 6 01:06:49 2012 +0300

    digsig: add hash size comparision on signature verification
    
    Commit b35e286a640f31d619a637332972498b51f3fd90 introduced the bug.
    
    When pkcs_1_v1_5_decode_emsa() returns without error and hash sizes do not
    match, hash comparision is not done and digsig_verify_rsa() returns no error.
    This is a bug and this patch fixes it.
    
    Cc: stable@...r.kernel.org
    Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@...el.com>
    Signed-off-by: James Morris <james.l.morris@...cle.com>

diff --git a/lib/digsig.c b/lib/digsig.c
index 286d558..77b1848 100644
--- a/lib/digsig.c
+++ b/lib/digsig.c
@@ -164,8 +164,12 @@ static int digsig_verify_rsa(struct key *key,
 
 	err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len);
 
-	if (!err && len == hlen)
-		err = memcmp(out2, h, hlen);
+	if (err || len != hlen) {
+		err = -EINVAL;
+		goto err;
+	}
+
+	err = memcmp(out2, h, hlen);
 
 err:
 	mpi_free(in);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ