Re: [Suit] Value of COSE_Mac_Tagged/COSE_Sign_Tagged/COSE_Mac0_Tagged/COSE_Sign1_Tagged

Akira Tsukamoto <akira.tsukamoto@aist.go.jp> Thu, 09 April 2020 06:53 UTC

Return-Path: <akira.tsukamoto@aist.go.jp>
X-Original-To: suit@ietfa.amsl.com
Delivered-To: suit@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D60183A0CE7 for <suit@ietfa.amsl.com>; Wed, 8 Apr 2020 23:53:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=aist.go.jp
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 0Qegc4HusfWw for <suit@ietfa.amsl.com>; Wed, 8 Apr 2020 23:53:50 -0700 (PDT)
Received: from JPN01-TY1-obe.outbound.protection.outlook.com (mail-eopbgr1400052.outbound.protection.outlook.com [40.107.140.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CE9E73A0CE6 for <suit@ietf.org>; Wed, 8 Apr 2020 23:53:49 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nPJPHHmmtPoTcFA0ikS6NeAeMm86w5K9k5o88KCvguzDsuntvYMH5HClB1Ln6ldQc03FqnonqtqRTjgCzHtlbt+lcc0CK9zyqbLLbEOSR1dVa9oB078U98iRMVnKKjhXPtLP4BEN8uulSfihZAY5H0pPWGlWxw0FgTgQOcLpJxq3Z7DPcleHGSJkgoAyXWq1orapKYazYJdPcHjSj3gkHGQa67FbF4JSWeMRFH0Fjap6ziKY3DleBAignB6ew/1aO7+ZJex/658Yp8Kb3ljVvO1ic58pYJw1dLO2fKGDkhhMujVTmzzUIfJ+0fuhNPPdWAlhqrO/1ljlqLCfS17Xcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q/N5TKmSIUFp5hO/asJ/l34Lqqmn0vYPQjiXyAHm3w8=; b=aHTzWedc6uRkOIX163yARj7Nl3F2o9EDgn3R1yQdNXQNvDYpRoLVkj8IrB2JY9AceOsHJxyub7IblkAB+COD4Rx4U/bhY+RDo8ZVJU9Lk7xf9jU1Hyldzw95b10nf9Pzg1BTB0syg4gTVph4PpSL91//CcKfEXf14qifLDg0s1dS88L/r5tJ+cJvBJFiLUKp2ns2Y7jtACEjm0Ex+sns8DGJGsyoa7DtuuTCUJtejmM9+Y1btk9zpqLP4FJSFQksaSuxAM6zcUVF8XblICFUW7wcoZGTPFcmyFNVK+quazmj9YwhBNBk9JEBaS3o0RjS5N4eXtuj1Su9udjgq+xJeQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aist.go.jp; dmarc=pass action=none header.from=aist.go.jp; dkim=pass header.d=aist.go.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aist.go.jp; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q/N5TKmSIUFp5hO/asJ/l34Lqqmn0vYPQjiXyAHm3w8=; b=Kv5IQv/Il71FnZopN04B9J0leRsC44VmiH2PvXlh79RMaR8fE2XcvieQ86yV0J4adOVDpr4vX0PCeLGgpef+vXr8u+NMGhJS9Yu8f3vNdWWcIy2MXG7jz4H0MCeXP6LnejofrY/51KhuEIIzJs7JFLrRRFMS5AZyJbMcDxxjgx0=
Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akira.tsukamoto@aist.go.jp;
Received: from TYAPR01MB3406.jpnprd01.prod.outlook.com (20.178.140.147) by TYAPR01MB2365.jpnprd01.prod.outlook.com (20.177.102.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.17; Thu, 9 Apr 2020 06:53:47 +0000
Received: from TYAPR01MB3406.jpnprd01.prod.outlook.com ([fe80::df1:d999:dc75:cdf2]) by TYAPR01MB3406.jpnprd01.prod.outlook.com ([fe80::df1:d999:dc75:cdf2%7]) with mapi id 15.20.2878.018; Thu, 9 Apr 2020 06:53:47 +0000
To: Jim Schaad <ietf@augustcellars.com>, suit@ietf.org
References: <4e6db9fe-c0c7-7ca0-95c7-843ebc164a4c@aist.go.jp> <05ef01d60e21$4bdd1ce0$e39756a0$@augustcellars.com>
From: Akira Tsukamoto <akira.tsukamoto@aist.go.jp>
Message-ID: <e40771d1-e2bb-15b8-d00d-563ce022499a@aist.go.jp>
Date: Thu, 9 Apr 2020 15:53:46 +0900
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
In-Reply-To: <05ef01d60e21$4bdd1ce0$e39756a0$@augustcellars.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: TYCPR01CA0071.jpnprd01.prod.outlook.com (2603:1096:405:2::35) To TYAPR01MB3406.jpnprd01.prod.outlook.com (2603:1096:404:cc::19)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from [192.168.100.200] (153.231.217.65) by TYCPR01CA0071.jpnprd01.prod.outlook.com (2603:1096:405:2::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.21 via Frontend Transport; Thu, 9 Apr 2020 06:53:46 +0000
X-Originating-IP: [153.231.217.65]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: 05cc1f9e-b26f-4c24-20cc-08d7dc52c04f
X-MS-TrafficTypeDiagnostic: TYAPR01MB2365:
X-Microsoft-Antispam-PRVS: <TYAPR01MB2365DF5FD66927801D26D177D8C10@TYAPR01MB2365.jpnprd01.prod.outlook.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:10000;
X-Forefront-PRVS: 0368E78B5B
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYAPR01MB3406.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(376002)(39860400002)(136003)(346002)(366004)(478600001)(2906002)(44832011)(86362001)(36756003)(8936002)(5660300002)(316002)(16576012)(66476007)(81156014)(45080400002)(66946007)(66556008)(31696002)(53546011)(8676002)(186003)(31686004)(966005)(52116002)(956004)(81166007)(26005)(16526019)(2616005)(6486002)(275744002); DIR:OUT; SFP:1101;
Received-SPF: None (protection.outlook.com: aist.go.jp does not designate permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: Ci5MjyyzUn+I5nn33hqkNqKPmTnYt04tsLQ3MQAld5mblflUjKJ8uZ0QrOVOv7S7uzQEh1u8WvQK/Ae9UEEZjj9G2DBq92rv4oEwiKuMi8gQu3I1aPkBO16TSGR3yR0wBWOqud2s7ojjRBOQTBZIamRbYAYqTzUIheD670OUz0w4ZLgj5bx8JWUtMLNk99OvWg6Dg1HpuYvNKKiba38AmCmNQKdDPd0T0g+ggGOEMMib84KXmaPceX/ZjCxrltvPqxxcsfae62GueeAsYloze3v6HxHmcSVbbTfJY2qG7yolk57nFb2TOJJeLFZFJ7Zk2wafS2a8/6lEeW4UUfHhrIsHaDjKmQ6KrwW0od8caRRn3+evsbDZFqhST6p7FOeh7ZPrX9cQlzcKblUyS8DQDJCFDPZIMnh63c7o7NI9B7OyFmoEDEim2lov4cOm4JCtgry+N9IOm+V2pSHyHyQuoHoh8two8JGEfcCGTMHBrHyz2E6Ld/t9uahKqi+3hxR8dBqq2oLf8kJhykvH2L8mZZTR0IOAJ4DiAGsOn3WS2SoE3YTiVfY2NM+ABZK0d87J
X-MS-Exchange-AntiSpam-MessageData: q7HbcnPzdDCaGToNLWK+n28hTJhwaD9CurMC5a3vkjJ3Ui5nion0CROFEerazyKj/W1DkKHzGuIBhqG8CIOWa8TY3YiivPJKllvgBuAXSQMNNYeKsGZ9gsoHHJw3VlL9gpiGfhuXxbNv8sCv58TEmQ==
X-OriginatorOrg: aist.go.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 05cc1f9e-b26f-4c24-20cc-08d7dc52c04f
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2020 06:53:47.4251 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 18a7fec8-652f-409b-8369-272d9ce80620
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 06ftggFa/jqVfLHioK6oERJZDStn1pvtpg7w/AqmD0IlwyLwawdnXgEPQTIXLSKzK+o7CNRPlcjT0qH/VJv1Z/GyrkB3mh2U1UKpWaNcje4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2365
Archived-At: <https://mailarchive.ietf.org/arch/msg/suit/jbOeVdQze3iUM5pkPy2hfNZG4zk>
Subject: Re: [Suit] Value of COSE_Mac_Tagged/COSE_Sign_Tagged/COSE_Mac0_Tagged/COSE_Sign1_Tagged
X-BeenThere: suit@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Software Updates for Internet of Things <suit.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/suit>, <mailto:suit-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/suit/>
List-Post: <mailto:suit@ietf.org>
List-Help: <mailto:suit-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/suit>, <mailto:suit-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Apr 2020 06:53:52 -0000

Hi Jim,

I think I started figure out what was going on.

The RFC8152 describes as:
  COSE_Mac_Tagged   = #6.97(COSE_Mac)
  COSE_Sign_Tagged  = #6.98(COSE_Sign)
  COSE_Mac0_Tagged  = #6.17(COSE_Mac0)
  COSE_Sign1_Tagged = #6.18(COSE_Sign1)

and I was confused with the #6 and the brackets on the right side.
After reading the implementation of tinycbor and IANA,

Tinycbor
https://github.com/intel/tinycbor/blob/master/src/tags.txt
IANA
https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml

probably it is

  COSE_Mac_Tagged   = #6.97(COSE_Mac)

means that

  CBOR Tag is 97

and uses

COSE_Mac = [
    Headers,
    payload : bstr / nil,
    tag : bstr,
    recipients :[+COSE_recipient]
]

and the examples is,

    97(
      [
        / protected / h'a1010f' / {
            \ alg \ 1:15 \ AES-CBC-MAC-256//64 \
          } / ,
        / unprotected / {},
        / payload / 'This is the content.',
        / tag / h'9e1226ba1f81b848',
        / recipients / [
          [
            / protected / h'',
            / unprotected / {
              / alg / 1:-6 / direct /,
              / kid / 4:'our-secret'
            },
            / ciphertext / h''
          ]
        ]
      ]
    )


Thanks,

-Akira


On 4/9/20 12:45, Jim Schaad wrote:
> These values are defined in RFC 8152,  draft-ietf-cose-rfc8152bis-struct or
> in the IANA registry.
> 
> Jim
> 
> 
> -----Original Message-----
> From: Suit <suit-bounces@ietf.org> On Behalf Of Akira Tsukamoto
> Sent: Wednesday, April 8, 2020 6:59 PM
> To: suit@ietf.org
> Subject: [Suit] Value of
> COSE_Mac_Tagged/COSE_Sign_Tagged/COSE_Mac0_Tagged/COSE_Sign1_Tagged
> 
> Hi all,
> 
> I am not sure this is the right place to ask.
> 
> This is the feedback from the TEEP-wg after the virtual hackathon and
> interim meeting.
> 
> TEEP was using
> COSE_Mac_Tagged/COSE_Sign_Tagged/COSE_Mac0_Tagged/COSE_Sign1_Tagged.
> Are these tags defined the value in some drafts or iana?
> When we were trying to implement the teep, we could not put the bstr or
> int/uint for the tags.
> 
> I the draft-ietf-suit-manifest-01, it also using these tags in page 43,
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftools.ietf.org%2Fhtml%2Fdraft-ietf-suit-manifest-01&amp;data=02%7C01%7Cakira.tsukamoto%40aist.go.jp%7Cdddac6fb0a33483c20b308d7dc387820%7C18a7fec8652f409b8369272d9ce80620%7C0%7C0%7C637220007412654750&amp;sdata=knhFlGCBf5M1hwal1kdnGXinEa2ROXc7cxau7GN5uOs%3D&amp;reserved=0
> 
> as
> 
> SUIT_Authentication_Wrapper = [ + (
>       COSE_Mac_Tagged /
>       COSE_Sign_Tagged /
>       COSE_Mac0_Tagged /
>       COSE_Sign1_Tagged)
> ]
> 
> COSE_Mac_Tagged = any
> COSE_Sign_Tagged = any
> COSE_Mac0_Tagged = any
> COSE_Sign1_Tagged = any
> 
> It was deleted in teep at the link bellow of the pull request after the
> discussion from the hackathon,
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fietf-teep%2Fteep-protocol%2Fcommit%2F151e72b0ea3ab8ff8f59ea4200&amp;data=02%7C01%7Cakira.tsukamoto%40aist.go.jp%7Cdddac6fb0a33483c20b308d7dc387820%7C18a7fec8652f409b8369272d9ce80620%7C0%7C0%7C637220007412654750&amp;sdata=QDJd5wiBo6p2c3Z0qc9eWvKbVBkO0kA%2FhmwCcxf1O%2FU%3D&amp;reserved=0
> 4180d90006f8c9
> but would be nice to know if it was OK with similar bellow,
> 
> COSE_Mac_Tagged = 1
> COSE_Sign_Tagged = 2
> COSE_Mac0_Tagged = 3
> COSE_Sign1_Tagged = 4
> 
> Thanks,
> -Akira
> 
> _______________________________________________
> Suit mailing list
> Suit@ietf.org
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fsuit&amp;data=02%7C01%7Cakira.tsukamoto%40aist.go.jp%7Cdddac6fb0a33483c20b308d7dc387820%7C18a7fec8652f409b8369272d9ce80620%7C0%7C0%7C637220007412654750&amp;sdata=e3YPByN13RYRMDIturl6CD5D3wue1cFaHntsxh115RQ%3D&amp;reserved=0
>