Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp623074img; Thu, 28 Feb 2019 05:20:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbjU7k6mI8+eWiHnd+68THvbRxE61quwFLFuvn6JDqscJwru6svJXVr0QvYhI5r35vqE8Qm X-Received: by 2002:a62:e910:: with SMTP id j16mr7411442pfh.44.1551360016594; Thu, 28 Feb 2019 05:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551360016; cv=none; d=google.com; s=arc-20160816; b=uoLwR0xhh61EvNRn6DD1Ru6vbAmOZJfP/9+vTQzuepGLax2rY0LW+L6kCY5JfJODLE MOWpv651XBiu/wteQ28dZPgqOrNzlk3zUg30wojpzKADQq4Uz+Q2aXPmAZEQi/a9JSFY S3cjr4ERlOWm80gwYsKp44+PmI4vOkk/OrALU4ZrMoiFqbUZ4HLeNGRpIOYgJDiSFHzw HGkbfIgtEt6c6LVlJRX114teLJJncSRMnl8rqwJEyRFPpZDu0I2JwWqRIr1bDcdq6nlN 2RsCvNUgOMdq5DchTojn8UBbIx+Tsd7VANK7zL/F35QdDcfBIPTc5PHyQKZeWlxrN1gq Mtlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=CodjIpKMYNwIaQnkCFNVXpy6JFN5gvc7Kk32q88IPAs=; b=xEwuH5n76/6LMnaC3YQoN/AREx0AMaR1J0af4rwz/7wgy4AGgrEFdGJVm6kPr+4kRC dqxJs4nLSdXO0LJ4xs6pTbq0iKNMh0YEaY3VfUPyc+tkenTlF42E4lpNcduiGLCstQ7D sXBGIp0n8/uFe+KgMJ2nMH2eU2282hRm1fthhZpWxAHMdHOig7Irfw1/bQFtTbSgXy5p bjFDy8h0DflxBh2ARMfLUXN1Ve06kOP1jcZdiKfuTKmCZY1pcwLN7onht0GCim7kjiAk nG6fl3Nz3vhV37MnZLtlOrrUkOzorPzhsIDvTfZu0rOPVtUzDnJTfC1KbKglKgONLphM iXtg== 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 y10si17730968pgh.577.2019.02.28.05.20.01; Thu, 28 Feb 2019 05:20:16 -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 S1731388AbfB1Kdl (ORCPT + 99 others); Thu, 28 Feb 2019 05:33:41 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:54348 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbfB1Kdl (ORCPT ); Thu, 28 Feb 2019 05:33:41 -0500 Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id 5E13F72CC53; Thu, 28 Feb 2019 13:33:38 +0300 (MSK) Received: from altlinux.org (sole.flsd.net [185.75.180.6]) by imap.altlinux.org (Postfix) with ESMTPSA id 30C434A4AE7; Thu, 28 Feb 2019 13:33:38 +0300 (MSK) Date: Thu, 28 Feb 2019 13:33:37 +0300 From: Vitaly Chikunov To: Herbert Xu Cc: 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: <20190228103337.sbjujn27qkkgxqt2@altlinux.org> Mail-Followup-To: Herbert Xu , 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 References: <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> <20190228090125.6n62v4oxpwl5yzv4@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20190228090125.6n62v4oxpwl5yzv4@gondor.apana.org.au> User-Agent: NeoMutt/20171215-106-ac61c7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 28, 2019 at 05:01:25PM +0800, Herbert Xu wrote: > 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. dh.c (set_secret) is getting buf, len arguments and then parameters are unpacked from that buffer. I think you want me to do this. To make the same for set_{pub,priv}_key it will require patching RSA drivers anyway, since length of the key is stored just once as keylen argument. Drivers will be changed to interpret key, keylen as buf, len and actual keylen will be stored into the buf, and will be unpacked from there. Thanks, > > Cheers, > -- > Email: Herbert Xu > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt