From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC4A6E95A63 for ; Sat, 7 Oct 2023 14:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233614AbjJGOql (ORCPT ); Sat, 7 Oct 2023 10:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjJGOql (ORCPT ); Sat, 7 Oct 2023 10:46:41 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BAEABD; Sat, 7 Oct 2023 07:46:39 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 1E54D30008A16; Sat, 7 Oct 2023 16:46:37 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0FB56323E8; Sat, 7 Oct 2023 16:46:37 +0200 (CEST) Date: Sat, 7 Oct 2023 16:46:37 +0200 From: Lukas Wunner To: Dan Williams Cc: Bjorn Helgaas , David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Alex Williamson , linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org, linux-coco@lists.linux.dev, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, kvm@vger.kernel.org, Jonathan Cameron , linuxarm@huawei.com, David Box , Dave Jiang , "Li, Ming" , Zhi Wang , Alistair Francis , Wilfred Mallawa , Alexey Kardashevskiy , Tom Lendacky , Sean Christopherson , Alexander Graf Subject: Re: [PATCH 05/12] crypto: akcipher - Support more than one signature encoding Message-ID: <20231007144637.GA11302@wunner.de> References: <65205ecfaf11a_ae7e729414@dwillia2-xfh.jf.intel.com.notmuch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65205ecfaf11a_ae7e729414@dwillia2-xfh.jf.intel.com.notmuch> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, Oct 06, 2023 at 12:23:59PM -0700, Dan Williams wrote: > Lukas Wunner wrote: > > Currently only a single default signature encoding is supported per > > akcipher. > > > > A subsequent commit will allow a second encoding for ecdsa, namely P1363 > > alternatively to X9.62. > > > > To accommodate for that, amend struct akcipher_request and struct > > crypto_akcipher_sync_data to store the desired signature encoding for > > verify and sign ops. > > > > Amend akcipher_request_set_crypt(), crypto_sig_verify() and > > crypto_sig_sign() with an additional parameter which specifies the > > desired signature encoding. Adjust all callers. > > I can only review this in generic terms, I just wonder why this decided to > pass a string rather than an enum? The keyctl user space interface passes strings and crypto/algapi.c likewise uses strings to identify algorithms. It appears to be the commonly used style in the crypto and keys subsystems. In particular, security/keys/keyctl_pkey.c already uses strings for the signature encoding. I just tried to blend in with the existing code. Happy to make adjustments if Herbert or David say so. Thanks, Lukas