Re: [sidr] rsaEncryption vs sha256WithRSAEncryption in RPKI certificates

Alberto Leiva <ydahhrk@gmail.com> Thu, 23 May 2019 18:17 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 77AAA12006A for <sidr@ietfa.amsl.com>; Thu, 23 May 2019 11:17:06 -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 tydWPi9UI7Q9 for <sidr@ietfa.amsl.com>; Thu, 23 May 2019 11:17:04 -0700 (PDT)
Received: from mail-it1-x12f.google.com (mail-it1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 A02AC120043 for <sidr@ietf.org>; Thu, 23 May 2019 11:17:04 -0700 (PDT)
Received: by mail-it1-x12f.google.com with SMTP id g24so4448627iti.5 for <sidr@ietf.org>; Thu, 23 May 2019 11:17:04 -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; bh=gjfXbSW4EHobWZ56Vje1ZsImz+ntJoAiMycVokYfJEA=; b=XlJzKiIbjRh1JGnEScPWwPtTmZuEr8f/FdeYsJ5t78+lgdYsEHPsoajsX1gYTbeb+0 ivjpD4SfIniH/SAZpxgzNLIUa8p3xBQPLL6ghzEuh9MW5SLzJO6qhRlAWq81wA9WBWJ3 JLgK9ksJfjzzsrWtWaFtHUpM/tk+NPvDSyHZCZeiXjjn54l8ClW6MyT+AxyoKM2vDzPK h+vEZ0jOMQo1ZAEuMQWE6E7d1qrzOy4QxVFm1b/5loJ99O3AOXuCTNm9llevDjoN5KAB ZbxOYer/Grqj/k2u+uIr/TQbzekBJVAOPZ95rRcVKNNUu3kL9W9kOdUxD0a+utxyzSNk jd9Q==
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; bh=gjfXbSW4EHobWZ56Vje1ZsImz+ntJoAiMycVokYfJEA=; b=ZFx5XXfk2RkfetgQnAQyAXESgEQdYkQ+ytQRPanjBpljb6KYev+ruMptJ88iA9e9XE CvjKuaAWzpdETLKnEuhWpgCsUsRAYU6/cyd3Bp2tVMYFi9fJAKKrx76uCVAibbZ4dWv1 lReNx9dx+WeXMaD1qS5nuk8dGaYze/eS8XZG7+gInMS/h4TiG0lLrVod7icLUoUmA5DS uLXBwj6Axiu7Jv1YRJQPsevUJd3vFAAHbBrXKJq2c53GtmkhEpByyjwbglJRU5wzEQWj zfEepNHy8x+ia4AmJZMKPoZAKZvCDbHi3TI+y9b84FomtJEqWI/B9mURkzgzSpH0dUeE cUiQ==
X-Gm-Message-State: APjAAAXCzS9qCfu19MgTd9F4k0uG8vIMpLR20eVL4f7RlBGea4jxVZVD /X+LZWOs2Xr1iDRff+pS3J+d+jziSmh8LvrsZFuPFQ==
X-Google-Smtp-Source: APXvYqztQhtCAibT3z5musAVU+IA73n0EU0GNc1lXW5RaphIAOo7B4ku3bVh5ZzVpSaAoL0qcpJ8LL/PlO61mVt2rUQ=
X-Received: by 2002:a24:149:: with SMTP id 70mr14302222itk.79.1558635423785; Thu, 23 May 2019 11:17:03 -0700 (PDT)
MIME-Version: 1.0
References: <CAA0dE=VOCvxb_0-pEB8CO=JZ9FShVf=pQ43pCmAeYCf9LRTTcw@mail.gmail.com> <ACD43E1A-5BBC-4710-A3D4-72EA7E1BC79F@vigilsec.com>
In-Reply-To: <ACD43E1A-5BBC-4710-A3D4-72EA7E1BC79F@vigilsec.com>
From: Alberto Leiva <ydahhrk@gmail.com>
Date: Thu, 23 May 2019 13:16:53 -0500
Message-ID: <CAA0dE=Wzdrr3kQiM98yehFHKeAafPgoRWQXdg1HoO0Ey0caLLQ@mail.gmail.com>
To: Russ Housley <housley@vigilsec.com>
Cc: IETF SIDR <sidr@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/sidr/D-dCNp6E0WPDixvVR7DF5pvaky0>
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 18:17:07 -0000

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
>
>