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 X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05A98C43381 for ; Thu, 28 Feb 2019 09:01:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D033320842 for ; Thu, 28 Feb 2019 09:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731318AbfB1JBe (ORCPT ); Thu, 28 Feb 2019 04:01:34 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:46662 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfB1JBd (ORCPT ); Thu, 28 Feb 2019 04:01:33 -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 1gzHZI-0000T7-LN; Thu, 28 Feb 2019 17:01:28 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gzHZF-000281-OV; Thu, 28 Feb 2019 17:01:25 +0800 Date: Thu, 28 Feb 2019 17:01:25 +0800 From: Herbert Xu To: David Howells , Mimi Zohar , Dmitry Kasatkin , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher Message-ID: <20190228090125.6n62v4oxpwl5yzv4@gondor.apana.org.au> References: <20190106133608.820-1-vt@altlinux.org> <20190106133608.820-2-vt@altlinux.org> <20190209214240.56gq7ivn3pw3bssf@altlinux.org> <20190210184628.yupsxgjlaicwbxg6@altlinux.org> <20190219043732.x3sbwzqlz4ikntxo@gondor.apana.org.au> <20190224064840.hii4ccjksjdnewae@altlinux.org> <20190228061444.3escryzoit3idtwg@gondor.apana.org.au> <20190228070449.gjwoq4c2b3x5grie@altlinux.org> <20190228075141.s6mftb44yuylbzys@gondor.apana.org.au> <20190228082801.2aofw23r2shzwy4n@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190228082801.2aofw23r2shzwy4n@altlinux.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Thu, Feb 28, 2019 at 11:28:01AM +0300, Vitaly Chikunov wrote: > On Thu, Feb 28, 2019 at 03:51:41PM +0800, Herbert Xu wrote: > > On Thu, Feb 28, 2019 at 10:04:49AM +0300, Vitaly Chikunov wrote: > > > > > > It seems that you insist on set_params to be removed and both key and > > > params to be passed into set_{pub,priv}_key. This means reworking all > > > existing RSA drivers and callers, right? Can you please confirm that > > > huge rework to avoid misunderstanding? > > > > I don't understand why we even need to touch the existing RSA > > drivers. Nothing needs to change as far as they're concerned. > > > > Only the new algorithms would need to decode the extra parameters > > in the key stream. > > int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key, > unsigned int keylen); > int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key, > unsigned int keylen); > > So you want `keylen' not to cover parameters data, but parameters > actually present in key after `keylen' bytes (in come packed format)? > (And if there is no parameters appended, there is still appended some > marker, like 0, to signify that there is no parameters.) > > This looks a bit counter-intuitive usage of arguments (as argument > signifying length does not cover all arguments data), is this ok to you? This is how we handle things in DH as well as other places such as authenc. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt