Re: [sidr] rsaEncryption vs sha256WithRSAEncryption in RPKI certificates

Alberto Leiva <ydahhrk@gmail.com> Thu, 23 May 2019 21:10 UTC

Return-Path: <ydahhrk@gmail.com>
X-Original-To: sidr@ietfa.amsl.com
Delivered-To: sidr@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 37F6A120189 for <sidr@ietfa.amsl.com>; Thu, 23 May 2019 14:10:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 GWxBYGPhBMwq for <sidr@ietfa.amsl.com>; Thu, 23 May 2019 14:10:47 -0700 (PDT)
Received: from mail-it1-x132.google.com (mail-it1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 28A2D120157 for <sidr@ietf.org>; Thu, 23 May 2019 14:10:47 -0700 (PDT)
Received: by mail-it1-x132.google.com with SMTP id e184so10665637ite.1 for <sidr@ietf.org>; Thu, 23 May 2019 14:10:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AScmFBF7GyPI9h5NQtz9d4NIu9pHspxyKxtBvFgdfe0=; b=WsNR/h5O4bKXiShdYg0UsQ6K/49EuUf1hSqCEEUxy9uzp5Up2Gi/c3hHvMFjBkoZlw KQi4V/Ir1YuoykpXjYBPSrEdSJpx+gB8k0vbSpAgG2LFVlTJ1ZEvm/6IUFYIT/+Mhzql LvmxBIfYG1IBBHEuoPgl1+XtURdfK08L4nlc9cCOt53PGtXcOs47zVS9rJdpcD+Jbe13 D/jKfLsiC7Foyoiu4P06dVbI2hCHmrfMA1AE37OManzAAJXVuRbS+rThSJf9TEM6trjz c7ptmK3YWl41uyex3yk5jeoKYkWmRGY6g0tF1YjJPP0hPWTgkNh+gg1czT/Et/xH399o ooJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AScmFBF7GyPI9h5NQtz9d4NIu9pHspxyKxtBvFgdfe0=; b=TIhK8R/rTtcYunqvxP7SoPczSFRWvXXWLm8hehi0UVmGoJw2o5WwFhq0EbTVs2/IOD rnfGBykriT2ottH4Vx33SjMq8mfyDMZwOEsQM1118qs0P9HSRqFhOdIKd/G0xzGLiYX8 r94HqbomHYm2ZE+N4KNGD5C5l6DPB0GuEx4+xis0VJR5/GAR88itldgNVzoZKQm2wupc 4/wzIM6t74qi+bJamR64cURW50Ggk4VdZZk27TkFbWmPbGGsfR7FEO5qjyvKZ6Hz3dDn JfVcFpc/SjaJtajg1cMHfXJAgXSIYid42mU04l01pH9+5uESwz1rRd/cWZiepM643YPL j7qA==
X-Gm-Message-State: APjAAAUqcKFm4UyB4edkAReZSCAzwXlaUK/PfLMXpzCN+uTQzdh8CD81 8OmPMgVl8bSX1zd9n+B6j4E5Qj3oWNu0ICIAEYrTSxdf
X-Google-Smtp-Source: APXvYqz5gapFbNaX1z1TI9ow6ezB7LIXjzLlrfHzTONEALZ9WMVckNagngVQhMN1n5ha7Dc0ZcnBPqsRBeO9t95nTuc=
X-Received: by 2002:a24:4f:: with SMTP id 76mr13996619ita.153.1558645846340; Thu, 23 May 2019 14:10:46 -0700 (PDT)
MIME-Version: 1.0
References: <CAA0dE=VOCvxb_0-pEB8CO=JZ9FShVf=pQ43pCmAeYCf9LRTTcw@mail.gmail.com> <ACD43E1A-5BBC-4710-A3D4-72EA7E1BC79F@vigilsec.com> <CAA0dE=Wzdrr3kQiM98yehFHKeAafPgoRWQXdg1HoO0Ey0caLLQ@mail.gmail.com>
In-Reply-To: <CAA0dE=Wzdrr3kQiM98yehFHKeAafPgoRWQXdg1HoO0Ey0caLLQ@mail.gmail.com>
From: Alberto Leiva <ydahhrk@gmail.com>
Date: Thu, 23 May 2019 16:10:35 -0500
Message-ID: <CAA0dE=WOTHtXROdnor5WK7WzGA_wko42uh3-=TSrRxM4YYqkwA@mail.gmail.com>
To: Russ Housley <housley@vigilsec.com>, martin@opennetlabs.com
Cc: IETF SIDR <sidr@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/sidr/FsvFuUvxfcqx1gRaPHG0kqVl3BQ>
Subject: Re: [sidr] rsaEncryption vs sha256WithRSAEncryption in RPKI certificates
X-BeenThere: sidr@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Secure Interdomain Routing <sidr.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sidr>, <mailto:sidr-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sidr/>
List-Post: <mailto:sidr@ietf.org>
List-Help: <mailto:sidr-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sidr>, <mailto:sidr-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 May 2019 21:10:56 -0000

> Routinator
> does indeed require that. It doesn’t insist on the presence of the NULL,
> though, and allows absent parameters.

Lol. So you struggled with absent vs NULL parameters too?
I wondered whether I should have included that too in this query.

On Thu, May 23, 2019 at 1:16 PM Alberto Leiva <ydahhrk@gmail.com> wrote:
>
> I see. Is this erratum-worthy?
>
> On Thu, May 23, 2019 at 11:23 AM Russ Housley <housley@vigilsec.com> wrote:
> >
> >
> >
> > > On May 22, 2019, at 6:18 PM, Alberto Leiva <ydahhrk@gmail.com> wrote:
> > >
> > > Hello
> > >
> > > Another question.
> > >
> > > RFC 7935 states the following:
> > >
> > > 3.1.  Public Key Format
> > >
> > >   (...)
> > >
> > >   algorithm (which is an AlgorithmIdentifier type):
> > >      The object identifier for RSA PKCS #1 v1.5 with SHA-256 MUST be
> > >      used in the algorithm field, as specified in Section 5 of
> > >      [RFC4055].  The value for the associated parameters from that
> > >      clause MUST also be used for the parameters field.
> > >
> > > I've never seen a certificate that declares sha256WithRSAEncryption ({
> > > pkcs-1 11 }) as its public key algorithm. Every certificate I've come
> > > across labels its algorithm as rsaEncryption ({ pkcs-1 1 }).
> > >
> > > (Certificates always define the signature algorithm as
> > > sha256WithRSAEncryption, but that's a different field.)
> > >
> > > Is everyone doing it wrong, or am I missing something?
> > >
> > > I'm aware that this is likely a triviality--rsaEncryption and
> > > sha256WithRSAEncryption probably mean the same in this context.
> > > There's also a thread in this list in which people seem to have
> > > experienced headaches over this topic. But the thread is talking about
> > > CMS signed objects (which I believe is different from certificates),
> > > and happened before 7935 was released, so it feels like the RFC should
> > > mandate something consistent with reality by now.
> > >
> > > Thanks for any pointers.
> >
> > You are right.
> >
> > In the subjectPublicKeyInfo, the algorithm identifier should be rsaEncryption, which is { 1, 2, 840, 113549, 1, 1, 1 }.  This allow the public key to be used with PKCS#1 v1.5, RSASSA-PSS, and RSAES-OAEP.
> >
> > In the signature, the algorithm identifier should be sha256WithRSAEncryption, which is { 1, 2, 840, 113549, 1, 1, 11 }.  This identifies PKCS#1 v1.5 with SHA-256 as the hash algorithm.
> >
> > Russ
> >
> >