Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37F67C76196 for ; Sun, 2 Apr 2023 12:30:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E6EA9859DE; Sun, 2 Apr 2023 14:30:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="mUYxtJkJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 918C085A33; Sun, 2 Apr 2023 14:30:42 +0200 (CEST) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0962785967 for ; Sun, 2 Apr 2023 14:30:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-francis@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 332CUNP6028837; Sun, 2 Apr 2023 07:30:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1680438623; bh=txfu55Ko8q3KPXxWtgHQ+/NcPgCssaUtwzekzVc6ln8=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=mUYxtJkJld5BkHPH+IpBLemZKw/skMBuAsETYR0pU5iNVkm07csMtz+tEvpUb833U LCE3lGrZZuBxHY8Y6gpsnPbmRWaDn6NhN+L4/TjkC/sChoUKII0Tg9W/BLsxDXjWUU 23XYkXRZkDTQkGZtD3ZhmitgVlxalKIXL+b4dPrY= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 332CUNi3053498 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 2 Apr 2023 07:30:23 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Sun, 2 Apr 2023 07:30:23 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Sun, 2 Apr 2023 07:30:23 -0500 Received: from [10.249.131.16] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 332CUKSZ119713; Sun, 2 Apr 2023 07:30:20 -0500 Message-ID: <02e62255-1766-563f-4b59-50f33295dcc9@ti.com> Date: Sun, 2 Apr 2023 18:00:19 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: WIP: Signing TI x509 certificates using binman To: Simon Glass CC: Vignesh Raghavendra , "Andrew F. Davis" , Roger Quadros , , Nishanth Menon , "Kumar, Udit" References: <5109d7ad-3d98-289f-9c2d-e8aafb9ab7f8@ti.com> <6461874e-4c95-038d-ee3f-0176759d25d4@ti.com> Content-Language: en-US From: Neha Malcom Francis In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Simon On 01/04/23 12:02, Simon Glass wrote: > Hi Neha, > > On Sat, 1 Apr 2023 at 00:14, Neha Malcom Francis wrote: >> >> Hi Simon >> >> On 31/03/23 02:01, Simon Glass wrote: >>> Hi Neha, >>> >>> On Fri, 24 Mar 2023 at 22:28, Neha Malcom Francis wrote: >>>> >>>> Hi Simon, >>>> >>>> Before I roll out the entire series that works for packaging K3 >>>> bootloader images, wanted to get some reviews and comments regarding the >>>> implementation of the signing etype [1] . I believe I've taken into >>>> consideration what we've discussed earlier [2]. >>>> >>>> Let me know your thoughts. The tree is also WIP, and was mainly designed >>>> for testing the signing etype on two of the devices. I will add the >>>> remaining and refine the series based on the next comments. >>> >>> Yes this looks reasonable to me. For the openssl method, can you >>> create a new 'real' method and put the cert stuff in there instead of >>> using a 'custom' one? It seems to have a lot in common with what is >>> there. We should really have an internal cert-generator method in that >>> class, with other functions in that class doing appropriate things. I >>> am looking for code reuse here, as well as clear indication of what >>> the cert is for or does. >> >> So you're suggesting to include the config creation within the openssl >> btool, am I right? For example methods to generate a config, add section >> to a config, add extension to a section of a config... etc? I can take a >> look at implementing this if this is what you have suggested. > > I am more thinking that your use case could be a new method in that > file, with arguments that suit your case, but with common code to > create a cert of the correct type. That means pulling out the existing > cert creation into a new (internal) function in that btool that does > both types of cert. For the CN args I think a dict would be suitable > to pass in the settings. > > I'm trying to avoid people passing in a cert every time, since that is > going to create a lot of code duplication and it will be hard to take > advantage of common algos. > Okay I think I get it, let me respin with this in mind. >> >> If most of the cert is the same, you could >>> pass a dict for the CN stuff, perhaps? >>> >>> What is the taml for? It is hard to tell, from the example provided. >> Did you mean YAML? If so in the patch I linked, I don't think I had a >> example for that. Could you point out what exactly you're asking about? > > Well I am wondering why it is in the code...is there a yaml file that > you need to ingest and process? What is it for? > > ...actually I see the yaml files in your tree mentioned below. Does > this come out of some other tool? > Right, so currently we have certain board specific configurations in YAML. This is input to our board configuration binary entry type [6], which converts YAML into binary blobs prepended with certain headers needed. >> >>> >>> Do you have a .dts which shows the full image for a board? I think the >>> cert stuff looks right, but it's a bit hard to tell. >> >> Yes, in the same github link I have the whole tree [3] that contains >> DTBs for couple of the devices [4] and [5], please have a look and let >> me know (I might force push a few changes in the next couple of days, so >> better to look from the tree) > > OK I see. Yes it looks pretty good to me. > >> >>> >>> When sending the patches please do do follow the function-commenting >>> style and make sure that it is clear what each arg means. E.g. I saw a >>> hash integer which I assume is used to pass 256 or 384 or 512 for sha >>> hashing. It should indicate the possible values / meaning in the arg. >>> In fact, in that case, it might be better to pass a string like >>> 'sha256'. >> >> Yes, you're right. Will address that when sending the patch series >> completely. > > OK > >> >>> >>> Anyway, apart from my questions it seems good. >>> >>> Regards, >>> Simon >>> >>>> >>>> [1] >>>> https://github.com/nehamalcom/u-boot/commit/ea7413ed5864340bd6f01e704e8bdcc073a7896b#diff-efb03d61a324724c4f86bf42b45c4e4e614cab18e1b3184f63721d62280a11b5 >>>> >>>> [2] >>>> https://patchwork.ozlabs.org/project/uboot/patch/20230224120340.587786-1-n-francis@ti.com/ >>>> >>>> -- >>>> Thanking You >>>> Neha Malcom Francis >> >> [3] https://github.com/nehamalcom/u-boot/commits/ti-secure-functionality >> [4] >> https://github.com/nehamalcom/u-boot/commit/dda1f9caf436df59c576466f35262df90aa1c0af >> > > Regards, > Simon [6] https://github.com/nehamalcom/u-boot/commit/3ca258562c374e553a7005a5b6d6441358801e78 -- Thanking You Neha Malcom Francis