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

denis bider <denisbider.ietf@gmail.com> Tue, 13 March 2018 08:15 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 BDD431270AB for <curdle@ietfa.amsl.com>; Tue, 13 Mar 2018 01:15:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 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_NONE=-0.0001, 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 HnTQHufb2TWg for <curdle@ietfa.amsl.com>; Tue, 13 Mar 2018 01:15:52 -0700 (PDT)
Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (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 8D8C2126CB6 for <curdle@ietf.org>; Tue, 13 Mar 2018 01:15:52 -0700 (PDT)
Received: by mail-qt0-x235.google.com with SMTP id a26so3132760qtj.6 for <curdle@ietf.org>; Tue, 13 Mar 2018 01:15:52 -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=lfhngdqp4pGB4GoAWLACdQ3yekX80NCf85siK778lhg=; b=lwj5payGpHqxUWDfHM1aVZvdpnsETeVMYq09BI1IxIzw1qGUURCbUU86DY14TNSNSa 3RaMwwPB8ZjcvAy8D1miU3XDsnFa+MlG19WspqtvUxR1/LSKE+4fzCuEcLMLmdN10f2N wNM+ht/7m8+utYOiwHKFhPaPN81QrZrpdzW6OEQiUaFOYfQzVU6jcKiDn1EWK44tH1TS W2I8QxUwWcmu3x8d64HZAYkmnjnmT1F6GfZw+tfMWHf7DXJjLd9nrJenh4lNDCJ8l2sR oe1HGigQtGoFWtCcwCw+5fb43kfWhwXoXlZr1dgkOFw2X+m1IlEmxe/lY8Y7/8+hbgnf vEQw==
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=lfhngdqp4pGB4GoAWLACdQ3yekX80NCf85siK778lhg=; b=LDtvsRng9FY3XWpgrgiDEhBx/1ZA3VP9cp9YLbrffKj0S8zZ674D6zPpOHhYMAZOmm SpYCVdZQHC06yWzRnTbFR6HozWaULEuzmGI4dLEaTD1TuMx29zbUVYljBP9EgMKKDhL5 NWaO3on1NTFinJ4zpe9URD+pOtu/WDRgHiqhBzN23CXfpkwcbGZr3TIeFRC2NuJ79OBS nvrGixYvo3tiRTijAtmjMMlikD+x4D4MdeyXiNSKqmq3ZinWwz7r2D5ydl/zgePRz9wG 1Sb0Rk2vK1VtZSNJsHDc9zizJISXtqGv5k3U+DCtP6UQRvPlUWA/cuhJPx/YVJWOFOij byHQ==
X-Gm-Message-State: AElRT7EcI/L+RUunI4dkxXmM7xG4IkGKaKZ5gt9Ra5uCFWa9eBGWh7Wk PoOxWWttnWtswW0sDUPFECNV08MDVmj0WTB+t20=
X-Google-Smtp-Source: AG47ELvE2OIvIbiY6XfT7tr+oTB684JRGl3pkPjWvWsjFjhi/gMJeiOl3y3xZPxmrc/vyC44Ff01+IztIVxYaEE9eBA=
X-Received: by 10.200.11.70 with SMTP id m6mr16553700qti.95.1520928951722; Tue, 13 Mar 2018 01:15:51 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.12.225.71 with HTTP; Tue, 13 Mar 2018 01:15:51 -0700 (PDT)
In-Reply-To: <1520927373727.37109@cs.auckland.ac.nz>
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> <CADPMZDDXi_h1uXzWJy37HXMrogQxJ5+Sd-G7ZZzfZJX_s390TA@mail.gmail.com> <1520924499970.11406@cs.auckland.ac.nz> <CADPMZDBF1bZez7aV=rUoUFyW2t_e7jRuKfz1F8P06ajaawpnDQ@mail.gmail.com> <1520927373727.37109@cs.auckland.ac.nz>
From: denis bider <denisbider.ietf@gmail.com>
Date: Tue, 13 Mar 2018 03:15:51 -0500
Message-ID: <CADPMZDBXUjTSDj7V6m0EvAJveEuU_TswPOL0+cuHsQaew9cA6Q@mail.gmail.com>
To: Peter Gutmann <pgut001@cs.auckland.ac.nz>
Cc: Ron Frederick <ronf@timeheart.net>, "Salz, Rich" <rsalz@akamai.com>, "curdle@ietf.org" <curdle@ietf.org>, "Mark D. Baushke" <mdb@juniper.net>
Content-Type: multipart/alternative; boundary="089e0822920ce56555056746dd9c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/SjTScx_eTpARxZyPxdGcvbKN5WI>
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 08:15:56 -0000

RFC 8017:

8.2 <https://tools.ietf.org/html/rfc8017#section-8.2>.  RSASSA-PKCS1-v1_5 [...]


8.2.1 <https://tools.ietf.org/html/rfc8017#section-8.2.1>.  Signature
Generation Operation [...]

  Output:

  S   signature, an octet string of length k, where k is the
      length in octets of the RSA modulus n


  [...]

  c.  Convert the signature representative s to a signature S of
      length k octets (see Section 4.1
<https://tools.ietf.org/html/rfc8017#section-4.1>):

      S = I2OSP (s, k).


S is fixed size. It is exactly the size of the modulus.



On Tue, Mar 13, 2018 at 2:49 AM, Peter Gutmann <pgut001@cs.auckland.ac.nz>
wrote:

> denis bider <denisbider.ietf@gmail.com> writes:
>
> >> My read-integer code accepts leading zeroes and strips them,
> >> based on implementations that assume e.g. a 1024-bit RSA key
> >> always produces 128 bytes of output
> >
> >It does. :)
>
> No it doesn't, it can produce shorter lengths with increasingly smaller
> probabilities.
>
> >> and memcpy() the result into a zero-filled 128-byte field.
> >
> >That's actually the correct encoding according to RFC 8017.
>
> D'you mean I2OSP?  That takes a variable length as a parameter, it's not
> fixed
> at any particular size.
>
> The only format I know of that requires a fixed-length field, for no known
> reason, is X9.62 and everything derived from it, which in practice means
> everything that does ECC except for Curve25519/X25519/Ed25519/etc, which
> does
> whatever it was djb felt like doing at the time.
>
> Peter.
>