Re: [smime] Problems with versions

Russ Housley <housley@vigilsec.com> Thu, 05 May 2022 14:51 UTC

Return-Path: <housley@vigilsec.com>
X-Original-To: smime@ietfa.amsl.com
Delivered-To: smime@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3B94FC15E6FA; Thu, 5 May 2022 07:51:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4S_4wjXkzrPi; Thu, 5 May 2022 07:51:05 -0700 (PDT)
Received: from mail3.g24.pair.com (mail3.g24.pair.com [66.39.134.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7BCF3C15E6FD; Thu, 5 May 2022 07:51:05 -0700 (PDT)
Received: from mail3.g24.pair.com (localhost [127.0.0.1]) by mail3.g24.pair.com (Postfix) with ESMTP id 8CCF814440F; Thu, 5 May 2022 10:51:04 -0400 (EDT)
Received: from [10.0.1.2] (pfs.iad.rg.net [198.180.150.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail3.g24.pair.com (Postfix) with ESMTPSA id 7B773143E8E; Thu, 5 May 2022 10:51:04 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\))
From: Russ Housley <housley@vigilsec.com>
In-Reply-To: <SY4PR01MB62512D541C42E6873562A17CEEC29@SY4PR01MB6251.ausprd01.prod.outlook.com>
Date: Thu, 05 May 2022 10:51:04 -0400
Cc: IETF SMIME <smime@ietf.org>, LAMPS <spasm@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <4447881C-4DEA-48E1-9767-9A6DA2AD07B0@vigilsec.com>
References: <SY4PR01MB6251E381603FAFE558685D86EEFE9@SY4PR01MB6251.ausprd01.prod.outlook.com> <CA16AFE1-CB97-4134-8FC9-4B8B964ACD6E@vigilsec.com> <SY4PR01MB62512D541C42E6873562A17CEEC29@SY4PR01MB6251.ausprd01.prod.outlook.com>
To: Peter Gutmann <pgut001@cs.auckland.ac.nz>
X-Mailer: Apple Mail (2.3445.104.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/smime/3ZOUX7PGzd9d1FPQ0PiBUILxGVA>
Subject: Re: [smime] Problems with versions
X-BeenThere: smime@ietf.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: SMIME Working Group <smime.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/smime>, <mailto:smime-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/smime/>
List-Post: <mailto:smime@ietf.org>
List-Help: <mailto:smime-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/smime>, <mailto:smime-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 05 May 2022 14:51:06 -0000

I realize that your example is hypothetical.  However it cannot happen under RFC 5652.

For SignerInfo, there are only two allowed values:

      version is the syntax version number.  If the SignerIdentifier is
      the CHOICE issuerAndSerialNumber, then the version MUST be 1.  If
      the SignerIdentifier is subjectKeyIdentifier, then the version
      MUST be 3.

Russ

> On May 5, 2022, at 8:34 AM, Peter Gutmann <pgut001@cs.auckland.ac.nz> wrote:
> 
> Russ Housley <housley@vigilsec.com> writes:
> 
>> That is, an unrecognized version can save the recipient for getting a parsing
>> error.
> 
> But they won't be getting a parsing error, see the example I gave:
> 
>> SignedData {
>>   version = 7,
>>   digestAlgorithms,
>>   content,
>>   signerInfos {
>>     signerInfo version = 7,
>>     signerInfo version = 6,
>>     signerInfo version = 1
>>     }
>>   }
> 
> If you change the SignedData version to 1 then an implementation that doesn't
> understand version 6 or 7 signerInfos can still process the message because
> there's a version 1 signerInfo present.  However if you set it at 7 then the
> implementation is being told it can't (or shouldn't) process the message even
> though it can.
> 
> The fact that there's some not-currently-recognised but totally processable
> (meaning read the header and skip the remaining payload) entry somewhere
> further down in the message doesn't mean that the whole message should be
> marked as unprocessable by an implementation.
> 
> If there's any implementers still on the list, what would your code do if it
> encountered the above message?  And what would it do if the SignedData version
> was 1 instead of 7?
> 
> Peter.
>