From 8c1d2e3926c483551c5a2b0e356d300ad2908d9e Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 18 Jun 2003 20:29:01 +1000 Subject: [PATCH] - markus@cvs.openbsd.org 2003/06/16 08:22:35 [ssh-rsa.c] make sure the signature has at least the expected length (don't insist on len == hlen + oidlen, since this breaks some smartcards) bugzilla #592; ok djm@ --- ChangeLog | 7 ++++++- ssh-rsa.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ccd501ab..93aaeb033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,11 @@ - markus@cvs.openbsd.org 2003/06/12 19:12:03 [scard.c scard.h ssh-agent.c ssh.c] add sc_get_key_label; larsch at trustcenter.de; bugzilla#591 + - markus@cvs.openbsd.org 2003/06/16 08:22:35 + [ssh-rsa.c] + make sure the signature has at least the expected length (don't + insist on len == hlen + oidlen, since this breaks some smartcards) + bugzilla #592; ok djm@ 20030614 - (djm) Update license on fake-rfc2553.[ch]; ok itojun@ @@ -527,4 +532,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2805 2003/06/18 10:28:40 djm Exp $ +$Id: ChangeLog,v 1.2806 2003/06/18 10:29:01 djm Exp $ diff --git a/ssh-rsa.c b/ssh-rsa.c index efbc9e664..db8e5e359 100644 --- a/ssh-rsa.c +++ b/ssh-rsa.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-rsa.c,v 1.28 2003/02/12 09:33:04 markus Exp $"); +RCSID("$OpenBSD: ssh-rsa.c,v 1.29 2003/06/16 08:22:35 markus Exp $"); #include #include @@ -247,8 +247,8 @@ openssh_RSA_verify(int type, u_char *hash, u_int hashlen, ERR_error_string(ERR_get_error(), NULL)); goto done; } - if (len != hlen + oidlen) { - error("bad decrypted len: %d != %d + %d", len, hlen, oidlen); + if (len < hlen + oidlen) { + error("bad decrypted len: %d < %d + %d", len, hlen, oidlen); goto done; } if (memcmp(decrypted, oid, oidlen) != 0) {