Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3020161pxf; Sun, 21 Mar 2021 15:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyv9R7y0s8AQ33lpklQtM0zqoEDfQRov4gc1B3eruzoOrfIPbOcEqyQYszouQSJc+rr5Hm X-Received: by 2002:a05:6402:42c9:: with SMTP id i9mr22683332edc.35.1616366884060; Sun, 21 Mar 2021 15:48:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616366884; cv=pass; d=google.com; s=arc-20160816; b=cB+ukz0E5CCCrQza/06MBHdXq9KL7SEKtoLto+SXUg955RW0SN0K6Vc+UP9QGFhA6D eD3DkhvUi21OpBFzu85NiG/qS1k0L6uoqmqOxVB02bavrdzYSjUCjLDD719Pu+9mRGd1 PctWWkq66I70UV3DKEjohmOKtnX23RgyiZJT2c8oKVwKEkSUufAi/klJqSup/esu+3hc Os/Y+FsXKvy31DuQkkxKWhk+XiKNPtOeddtr+X8lCHHSe0aULCXwqwMHM9lnaPfKw17U phEmwCxjHLgixUtCifsJn0Ryh9gkFfCkICJ7AIJrUSLr2v6CeR4nj6IHQhNPxts/9GDB Qp9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=6YE4Vwd6gHHMEYEh30nRhJnLDc7kEXVY1QZ/PrQS1S4=; b=FPavOzHsuH+uyDpFTW9ihWa3Edgvfrrsqgjxn/JtpsG2fhqH2ojphkaUXZuqGnv02z 0PUYeN03U4BnYx6Lr98amo7Tlth18VnZIcY5CEAlLyoUKE6qTzndyJi4UTT69f/Vh7xk iykG5diZHqR0WkdwaxKsfoGP7+wdfTb3lXyEexgntq9tIq0IZD9GpWvAxebO+vJoqiMp k2k1tLn4IlyUQq4TsHXdhmrM8biBt16OMB94ib3NMl6c8wQNmyfhlrIr0S4qZwT8J6hI jAgTrpPD7x5YdVV05OJYIZhfYFMcer4tne3wmRF2L4N4XHLwmO/aTp+mRVdeQrItR3xd EDzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bjw6Z+8y; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si10103524edz.432.2021.03.21.15.47.40; Sun, 21 Mar 2021 15:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bjw6Z+8y; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbhCUUta (ORCPT + 99 others); Sun, 21 Mar 2021 16:49:30 -0400 Received: from mail-eopbgr20076.outbound.protection.outlook.com ([40.107.2.76]:52302 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229990AbhCUUtF (ORCPT ); Sun, 21 Mar 2021 16:49:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=krlA1lS97XlnBCegX8oJb3rnkQSR2ozwOYN9AbgxWEeuCVWuyeRcSueng40QTXtj/sSwqDqX1bdtM8/ncoykckPDJrPIzoz4ECtbn3wR+AWOq1cR5Djxc2CALGRprup7FjPle3ImSOBgeco2/1R0sh1QU0ib48ZE/Efi0Jif/siixg9JIwAvIaMqqMztfnqnJWo/9aQStTB0WmCoufdiMtZhzxhwehqpqTK0X56i+V66Vjc77FL7f3U06a2e2h5Krx3xsYmnjXAYipev4UebOYczucWQXor8tU1enNoqWkmcJXEBtA9B+NcaXoVnwHzOh6DKWAA2l7GgCGJud/SaGg== 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=6YE4Vwd6gHHMEYEh30nRhJnLDc7kEXVY1QZ/PrQS1S4=; b=aZHb4Vkto9QnazIDQ0RByr4YP1N+xWSubUfu1inBXUv98b5LUpb1ocpKUXINm/56LCQYcvZr82hB0AyIQLilS/tHomtGdl4HbKXILwzcFiVLpyfJhlXZxMRSmrFhf5kWHXEs0yaMB5UDWmJLBmDAygEz/NVN+01PefskpFl4IcR4N6ZxUc+vp1ayf/7jZ+Q1hvykqDsyJjcy0cETLZ/6rZqJ8rujWJAi0o6OPXnX6AoXh2UJlol4D0i7X+AbyuDVwONdUWHRDOy82npay0Orfd5Vz5jxUXL3fMAoMCixzQkCG0geUsxtJbNqkttWqZVIdEyJMayUBu6X0sgtmZpV0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6YE4Vwd6gHHMEYEh30nRhJnLDc7kEXVY1QZ/PrQS1S4=; b=bjw6Z+8yy+bbgAmRyHFBf3zx0CBZsdqn3OthqdFQGxhD9SrIHV0BymKzH+A7tMIWY0fQRBOXDBvTA+NllcpK7XSRASr1m6/Hd4G6UpXRkp8vjEjITPZKhQrxF4/vTp/A/xdwdjwhTMFBGXWYKXN//xFgyVt0oq5XzCu5CZuDbU4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4038.eurprd04.prod.outlook.com (2603:10a6:209:44::24) by AM6PR04MB6182.eurprd04.prod.outlook.com (2603:10a6:20b:bb::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Sun, 21 Mar 2021 20:49:01 +0000 Received: from AM6PR04MB4038.eurprd04.prod.outlook.com ([fe80::ec5b:262e:8c27:c742]) by AM6PR04MB4038.eurprd04.prod.outlook.com ([fe80::ec5b:262e:8c27:c742%3]) with mapi id 15.20.3955.024; Sun, 21 Mar 2021 20:49:01 +0000 Subject: Re: [PATCH v1 3/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys To: Ahmad Fatoum , Jonathan Corbet , David Howells , Jarkko Sakkinen , James Bottomley , Mimi Zohar Cc: "kernel@pengutronix.de" , James Morris , "Serge E. Hallyn" , Aymen Sghaier , Herbert Xu , "David S. Miller" , Udit Agarwal , Jan Luebbe , David Gstir , Franck Lenormand , Sumit Garg , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-integrity@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-security-module@vger.kernel.org" References: <319e558e1bd19b80ad6447c167a2c3942bdafea2.1615914058.git-series.a.fatoum@pengutronix.de> From: =?UTF-8?Q?Horia_Geant=c4=83?= Message-ID: <01e6e13d-2968-0aa5-c4c8-7458b7bde462@nxp.com> Date: Sun, 21 Mar 2021 22:48:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: <319e558e1bd19b80ad6447c167a2c3942bdafea2.1615914058.git-series.a.fatoum@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [78.97.206.147] X-ClientProxiedBy: AM0PR03CA0018.eurprd03.prod.outlook.com (2603:10a6:208:14::31) To AM6PR04MB4038.eurprd04.prod.outlook.com (2603:10a6:209:44::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.213] (78.97.206.147) by AM0PR03CA0018.eurprd03.prod.outlook.com (2603:10a6:208:14::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Sun, 21 Mar 2021 20:49:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0ce46492-767b-4613-fb5d-08d8ecaac1e2 X-MS-TrafficTypeDiagnostic: AM6PR04MB6182: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XAJQAvIbHTIKaz4O+IHRwrNjj/4joRLATDU9N6m6kOjHpMU4Ot+KR6ix14VvebhxXe5oauC+kKHndihXa+ia1S1LdNqRna9fe5w4o5/EVBZxNRvjA2B3Wk5hvXXvuo3iCKLiRdXcwPNMqJNs7LXVQrzzqpAo/puhZPcpyiLSwvtsHXnC/a3RvF63uYQvHRRFXbOcpaQCoR8x0ThxplqaLFMBWPuifdYLd2Pr/f1Vk6JcQbrgVfLEgJwQOBUoyeh00A6REKNVKTfuo/DnxAVisGfp6w4kuxEJ/nIjQ2QVfosYF5d5D1cbyXZt2PoRTk89baRuydu6t9hdGkbenpwaguy87SAyNG9nFIWTKBYV103SeZf/i04LUJ7ZHNwiczVRxcsO1aSsyobtkK5KkARtecm6zluMcANxYUx881voZqL91xpTTWxkeJQ8po2jBPh32l9mXzey8nnygZiC8RSYfCK4xlxiCnmDv+r1sdrAeAleW8f7inxEH3+HUCfRCQ+ls4pqs+sKe9VyzXjH4ykwnf5xhKOJffgtRvd7XxmXt0SNTQyucpgv1yCDZRfdHkHD/WcvWxm9z8GSTT32OzYuW/qE8mS4L1Ruejbn2TWZlUzyaDC0FG76okty9nvjWw+T4siSt8ylE3muJ4lTJoDLAwAqWxadxTIvZrz7gtQMLeWISe6MpGMdyOwTodJuRrlAig/p+KBQupHSHC1DPJyQvw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4038.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(86362001)(110136005)(6486002)(956004)(2616005)(38100700001)(5660300002)(54906003)(186003)(66556008)(16526019)(66946007)(66476007)(316002)(8936002)(52116002)(26005)(31696002)(16576012)(2906002)(7416002)(31686004)(8676002)(36756003)(4326008)(478600001)(4744005)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?N2drYzlYcWRrcGJrM0EyYjZOWjlDdFh4SlBwQjEwTlVhU0xTUDRHK0lVQ3ps?= =?utf-8?B?YStkbVlQNG5MaGEwL3ZpbS9aZVBqL0YrcVdRa1M0TjNUWTllOE1iTExCaGR2?= =?utf-8?B?VVRoazFJdDdRK2VvY1pYRERZMDdaTnYva255NVFDSm4yMWVyUENITlorTjJI?= =?utf-8?B?MitwUE5GaHd3T0NhVWxPeU82ZHpYMEtqM2pyK2VsODYwaG9RK2tITnRLSlNK?= =?utf-8?B?Z2hmZXNVYjRYbDJCSzZ6andOSXlUS2kwYW00MW9RRERiUVJrL0JSNVFrMlM4?= =?utf-8?B?TzB5ZVJSbmhNU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DdwSGo0TjdTS3dMbVpqa2xVNDJKd2JoR0dXSWUyNEd4SjRFUnRsdEU4ZUVP?= =?utf-8?B?VHB4NGZxa0d3RDRjTFZtb3VDQWdnbVhITnc3ZndUN0xNUEFOcDA4c3ZoYWhk?= =?utf-8?B?Z0E4T1dhNFVkcDZlTWVuWUpJSFBHY3BwOFFmaTlTMFRhWWNXa1NRS29Eb0Rz?= =?utf-8?B?SUhBb2l2VWhHdFFWdDZtbktURkwwZUJ0TWJvcVZzMFFQOUNaVU9CSFlxeFhw?= =?utf-8?B?cmdvZHBZelZkUkdrNnFUamZiMmU0ejR6WElMdWpCbTE0UlUreHA2eHFNL2pS?= =?utf-8?B?akxUOGUzcUM3RW5JYnFMNnhuZ3dFM21WNEFmOVRBVndXVVl3VUZ2cjhuZWVm?= =?utf-8?B?VCtvNjNKdTA5RGttV0pMNWhuYkdJR2dqa2ZlU3loUlEvaXU0TitUd1dVZ3RR?= =?utf-8?B?VllhNUw2dUJWVTNUNmNBb3RVeXY0b1QxZ01KZWZOUnF5WXlhd0o5UXU0U2Rv?= =?utf-8?B?eUFYRHVqenA2SitTUFU1QWt3ZzRuNDVlZjl3REQwenN2ZlpQb05LMHZUZ2hD?= =?utf-8?Q?HaUgxmmdv6DiOGLmufcqyj+hCNGdSuLsRqQnufF?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce46492-767b-4613-fb5d-08d8ecaac1e2 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4038.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2021 20:49:01.6827 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OITSzcuoxSyoMpb8yf4axE6pMidWR4qyts7RAIFSEim8TkdYMr79ZslMrQ3sHQ83E/lkzDzBc1ix0SJ0pzDiaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6182 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 3/16/2021 7:02 PM, Ahmad Fatoum wrote: [...] > +struct trusted_key_ops caam_trusted_key_ops = { > + .migratable = 0, /* non-migratable */ > + .init = trusted_caam_init, > + .seal = trusted_caam_seal, > + .unseal = trusted_caam_unseal, > + .exit = trusted_caam_exit, > +}; caam has random number generation capabilities, so it's worth using that by implementing .get_random. Horia