Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp664115imu; Thu, 13 Dec 2018 02:15:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/XuJu5op0prdiC3VHT13/WUi7cwXFDfkQpQlnecthzG7hTQMgIxbrFX34o0EJL7te8kXWux X-Received: by 2002:a17:902:4225:: with SMTP id g34mr23687319pld.152.1544696123904; Thu, 13 Dec 2018 02:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544696123; cv=none; d=google.com; s=arc-20160816; b=HNNxtfpKpz7Jt3aECR6917UnE5gNANymKYLZmdfpVZvXC7RCsObrI9PAvaP/NIukvt Y64QRA0RVFcIF/ZC+L1cfikq7YMddLy9562ml9vQ6UggOIxAi6InkDcG+KN+hsYfYU0T GMZAmIQUIA6W4qOu/08BNjNgJQlvE+nlJfCrVwVhSaUu3B1BqEQH6kZKLG/oYAodlmKI xu+6+VevKm2tYKKgM5JredRTMP35CNtp+gu3WQ1egCbMo7kFC86qPSXkDrl6mRypd/Ax 8DnAT3mQZQ8YKeAWODR0pB64BL+xHsmSpmuPmZusqx0UzQxWYUKGbzH+Q8KuvVZlepZ9 8WqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=725Mks+hpiEbL4NIQTD+vmxZnTCekHc4dJvu0lOTHzQ=; b=WMowJ/otKLqKqR0YYBD7pQxxXmAIclr/p4nUpR7TfD6BF3KoqVYhlMN8gXgzWMuS5f 1TEAhMre9n3P0QyTeNUt0+lo4tNhViexAjaHkyTYt20tLxK88V8MEPF8KYlfrWOiH86Q MJWuQTfcZyqSnwP7vOBi9bqiqK4H0YzQXL3ETIpOH0n4+V0iEWe5CzgZvVqy5/Wuf8Iw QORoUGOPn1Rxruw7kyumh7TWNas30pS/Ow26HS0AXI5v2Vw5pvg6ohiKXlCkBttA3DDi AUZm76ts9iSvSAmDEaHrHAfESwEItXJPOqhh11kyZXVjDB/TuhUROk/pbe+lPr1JiIO6 lliQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si1213994pgk.265.2018.12.13.02.15.09; Thu, 13 Dec 2018 02:15:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728099AbeLMKOI (ORCPT + 99 others); Thu, 13 Dec 2018 05:14:08 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:50402 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727720AbeLMKOH (ORCPT ); Thu, 13 Dec 2018 05:14:07 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1gXO0I-0002vt-36; Thu, 13 Dec 2018 18:14:02 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gXO0H-0004Xs-H3; Thu, 13 Dec 2018 18:14:01 +0800 Date: Thu, 13 Dec 2018 18:14:01 +0800 From: Herbert Xu To: Vitaly Chikunov Cc: dhowells@redhat.com, davem@davemloft.net, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] X.509: Parse public key parameters from x509 for akcipher Message-ID: <20181213101401.zsmpkz6okgkjmbw3@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181209135548.26232-1-vt@altlinux.org> X-Newsgroups: apana.lists.os.linux.cryptoapi,apana.lists.os.linux.kernel Organization: Core User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Chikunov wrote: > Some public key algorithms (like ECDSA) keep in parameters field > important data such as digest and curve OIDs (possibly more for > different ECDSA variants). Thus, just setting a public key (as > for RSA) is not enough. > > Introduce set_params() callback for akcipher which will be used to > pass BER encoded parameters array, with additional argument of > algorithm OID. > > This is done with the intent of adding support for EC-RDSA (ISO/IEC > 14888-3:2018, RFC 7091, and basically ECDSA variant) public keys (which > will be finally used in IMA subsystem). Thus, also oid_registry.h is > updated. > > Rationale: > > - For such keys just setting public key without parameters is > meaningless, so it would be possible to add parameters in > crypto_akcipher_set_pub_key (and .set_pub_key) calls. But, this will > needlessly change API for RSA akcipher. Also, additional callback > making it possible to pass parameters after > crypto_akcipher_set_priv_key (and .set_priv_key) in the future. > > - Algorithm OID is passed to be validated in .set_params callback, > otherwise, it could have the wrong value. > > - Particular algorithm OIDs are checked in x509_note_params, (because > this is called from AlgorithmIdentifier (ASN.1) parser, which is > called multiple times, as it's used multiple times in X.509 > certificate), to distinguish a public key call from a signature call. > > Signed-off-by: Vitaly Chikunov Please post this with a patch that actually uses the set_params callback. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt