Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1002987rdb; Sat, 7 Oct 2023 07:46:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3UqhC4wZ98gl5SS7sty544dNrnbuzG5Pzmh8xyHJ1o+pezwCSNTXQQtTWAGegrrFFnuxi X-Received: by 2002:a17:90a:2cc4:b0:271:7cd6:165d with SMTP id n62-20020a17090a2cc400b002717cd6165dmr10204068pjd.26.1696690018413; Sat, 07 Oct 2023 07:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696690018; cv=none; d=google.com; s=arc-20160816; b=QqDvPKGHf3+jqBnlX7PGOMU/4ZrhnzTW6VA8NO92r0xxL11BByWQ148s0uyp9AYFAW VnRZa5mpxFzwTWtO5xuYGhv6Q/WAh6Of9jSnoxZiD3o+YjkiDjavlz8cVagpChqTQIRF ZCpxQ7z27SjLV5mBgPT2ct7rfQfWAs8yv1fkzPJg8qjTSY4MyfmMyENsbQp7vwg4te4w RYGgdnoomhwWxWKs7a2NC8rmYyrY2dBjQvT0lxkZ5byqcyxwVsfJTRWrScfFeYzB7JrC +ezvTXTz5OqJuglYXhPU6GF9FoqE5DHd0v+H3JR6VY+sR0AklJzCg4oG/TjEgnixNaeo 850Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=au9umtApjsJmGg//KcICyZDAx9TAvA+YBb9SJPc1R2U=; fh=vFP1ju1V3xr29GshN4DbO6w0T3mfP1mELPn2Pv6xpM8=; b=VXdG5HYgxPOpW9aNana5gnVb/e9cy1nsU7wHDHSQViE5n0Wm7QrGcPGwenpYYcvZzD Wvrx2sG6cjRibTP6hNhYFvMjGFWl0draJzBx7+X36qtrXtQn0yrD5Y0AkmIinnKROERA YSzM3L0jfHzNXgQYZR2bC9xeFpoKk3s0Xq6JCGG0v8JUIjRrwc4THh6rA5E80UWfcxrg YPnLwk+RhygncbthJmTq1e0zpjPl/n20odn36XmqGmbxp0nRl/e80GhIyHBPYtKGZZ9R m+EETPcrBAD//s3Hk2Vroj6x1Y3nsWj3WpRWkBAzNzgWPz7c/QL16/+p4mWTE3SxXYT3 lLkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e8-20020a636908000000b00577a083624csi5907252pgc.89.2023.10.07.07.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 07:46:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D9626805191D; Sat, 7 Oct 2023 07:46:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233967AbjJGOql (ORCPT + 99 others); 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) X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 07 Oct 2023 07:46:56 -0700 (PDT) X-Spam-Level: ** 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