Re: [Curdle] Confirming a change to draft-ietf-curdle-rsa-sha2-12

denis bider <denisbider.ietf@gmail.com> Tue, 13 March 2018 04:28 UTC

Return-Path: <denisbider.ietf@gmail.com>
X-Original-To: curdle@ietfa.amsl.com
Delivered-To: curdle@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 258B81243F6 for <curdle@ietfa.amsl.com>; Mon, 12 Mar 2018 21:28:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4rZE0qLlP4JW for <curdle@ietfa.amsl.com>; Mon, 12 Mar 2018 21:28:21 -0700 (PDT)
Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 85BEE124234 for <curdle@ietf.org>; Mon, 12 Mar 2018 21:28:21 -0700 (PDT)
Received: by mail-qk0-x22f.google.com with SMTP id o184so8934962qkd.13 for <curdle@ietf.org>; Mon, 12 Mar 2018 21:28:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CcbyRiEsghLn14o6qhxB1h6MJrRxsIF569tkdrwM9P4=; b=TqFh1FqpuY0VxI9Ss8+IH+GIU+db90/OUSKiVpZaT4TBsRhbrKCOyrhFLckhaFbO6Q DlWe+99/DekCFIUw7g1O/Jw0TJ3lxMKTBbGgEhZQhXs+J11kh3Nf4+vAHSGjZLQcs53j z1itOTRvX4MoKrJfanCkRZQfLQg4pozjf5TB96mpzOXyjBg3DInr+VSITEFjqkLHH5V6 YAAhcPIf9MD10d/XtIGvQ6WEFDnGWZgIZeIFYyG1ztWfJWjN6Ei9SjOEG+cVpuC1UOPt VNx6rsVoPUVWidpfqeV0sjN0DzV6pBa58p11h2CjZ3gB3eLHDkQTIWxzpMXG5Y7JVdd6 aG6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CcbyRiEsghLn14o6qhxB1h6MJrRxsIF569tkdrwM9P4=; b=YNWZVeJgjoaCGR14E14IfFPXEnXM4hujOisRTPKcPb49HmtNTnG1oK7KMqChpXjjnq cSuRO0L/HHik8RQej+bH9pvjEvKngcZg68BEhqz0AN7GpU2RlXjI5nopYv/ApBgClyY6 v7eEe/H3vrcEiGlSV7oDXPaNV7Vnye6pNOHHlRD+STJb8OV2G5XyFY7d0/pGbhm/Hrri QQujzNlaMMxIbmQKfDuR7ZZmr14j5hKqrVrpYQRJIewFXpscaNTpce7FslTkI1gAipoT dDaw/KWTyQd0T2eWp2L1ZOUJmAWOuJ+25t/2oVWJnDN4LDcYNty5BuVtfhe668zUiMml o/rw==
X-Gm-Message-State: AElRT7HijCOggFLKSyG6r7oUOIePv03nZX/E5rGcKTdQHIlJLRDUT1pz q3JTbYgGiqWemWzIRd6gdztj3wwujrtGK5Md0Is=
X-Google-Smtp-Source: AG47ELunMtEtqlzlIUIxjke0sShUGUF5kYfUf4bNIAVabP2OadkeD4P6cS3e9fq3cypQ7VvOokYHhKkhZrAQGyumP5U=
X-Received: by 10.55.78.212 with SMTP id c203mr15602872qkb.351.1520915300549; Mon, 12 Mar 2018 21:28:20 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.12.225.71 with HTTP; Mon, 12 Mar 2018 21:28:20 -0700 (PDT)
In-Reply-To: <40465B0B-FED4-4C16-A5C3-7E2C04E1B666@timeheart.net>
References: <4C40F019-21FB-46AC-95D3-CC94BB976AAB@akamai.com> <12087.1520816187@eng-mail01.juniper.net> <CADPMZDCwRN-GHXhAe=-xPFHMnUBN39UWmENGNUeLbFkneEAgcA@mail.gmail.com> <17856.1520829824@eng-mail01.juniper.net> <CADPMZDBnG1hv5D74vLv2bXqxZjceJgHQ9oYrufKHskLdV7nRSQ@mail.gmail.com> <28093.1520848786@eng-mail01.juniper.net> <40465B0B-FED4-4C16-A5C3-7E2C04E1B666@timeheart.net>
From: denis bider <denisbider.ietf@gmail.com>
Date: Mon, 12 Mar 2018 23:28:20 -0500
Message-ID: <CADPMZDDXi_h1uXzWJy37HXMrogQxJ5+Sd-G7ZZzfZJX_s390TA@mail.gmail.com>
To: Ron Frederick <ronf@timeheart.net>
Cc: "Mark D. Baushke" <mdb@juniper.net>, "Salz, Rich" <rsalz@akamai.com>, "curdle@ietf.org" <curdle@ietf.org>
Content-Type: multipart/alternative; boundary="001a114a9bb2390903056743b032"
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/p9c3ZMQXoFvRIbDZCxSgePSnPug>
Subject: Re: [Curdle] Confirming a change to draft-ietf-curdle-rsa-sha2-12
X-BeenThere: curdle@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "List for discussion of potential new security area wg." <curdle.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/curdle>, <mailto:curdle-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/curdle/>
List-Post: <mailto:curdle@ietf.org>
List-Help: <mailto:curdle-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/curdle>, <mailto:curdle-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Mar 2018 04:28:24 -0000

Yes - this was the "mpint" idea that Mark broached. In SSH, the "mpint"
type is used to encode a signed integer, and prepends the \0 byte if the
value is positive and its high bit is on. This is necessary to distinguish
the positive value from a negative one.

As far as I know, there does NOT exist any SSH implementation that would
require such an erroneous encoding for an RSA signature.

If such an implementation did exist, it would fail to validate a very large
proportion of valid signatures as currently generated by most SSH servers
and clients. Unless my assumptions about RSA are incorrect, a very large
proportion of signatures, e.g. 1/3 - or up to 1/2 depending on the modulus
- will have the high bit set.

An implementation that would incorrectly require a signed encoding (like
"mpint") would be immediately discovered in development. I have not seen it
in practice.

What I cannot say is how many implementations might ACCEPT a signed
encoding if it is sent. If they do, I have no idea how many extra zeros
such implementations might accept. It might be that there exist
implementations (perhaps including ours!) that will accept an arbitrary
number of leading zeros. Perhaps there may be so many zeros as to fill up
to the maximum size of the SSH packet the implementation accepts.

If they do, though, I'm not aware of an attack that could be mounted based
on that, and it won't arise as a compatibility issue. So I think it's not
worthwhile to mention.


On Mon, Mar 12, 2018 at 8:01 PM, Ron Frederick <ronf@timeheart.net> wrote:

> Agreed on MAY here instead of SHOULD.
>
> One of the original e-mails on this thread also mentioned prepending a
> leading 0x00 byte in cases where the high-bit of the first octet is set.
> I’m not sure we want to ever allow that. is anyone aware of any existing
> implementations that do that today, incorrectly thinking this value was
> supposed to follow the rules for encoding an “mpint” instead of a
> fixed-length octet string?
>
> On Mar 12, 2018, at 2:59 AM, Mark D. Baushke <mdb@juniper.net> wrote:
> > Hi denis,
> >
> > Argument #3 works for me.
> >
> > MAY is best. SHOULD lets broken implementations continue to be broken.
> >
> > Thank you for your responses.
> >
> >       Enjoy!
> >       -- Mark
> >
> > _______________________________________________
> > Curdle mailing list
> > Curdle@ietf.org
> > https://www.ietf.org/mailman/listinfo/curdle
>
> --
> Ron Frederick
> ronf@timeheart.net
>
>
>
>