From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754134AbcEPOYy (ORCPT ); Mon, 16 May 2016 10:24:54 -0400 Received: from mga04.intel.com ([192.55.52.120]:33124 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751977AbcEPOYv (ORCPT ); Mon, 16 May 2016 10:24:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,627,1455004800"; d="scan'208";a="104688697" Subject: Re: [PATCH RESEND v5 6/6] crypto: AF_ALG - add support for key_id To: Mat Martineau References: <20160505195048.1843.7817.stgit@tstruk-mobl1> <20160505195120.1843.35821.stgit@tstruk-mobl1> Cc: dhowells@redhat.com, herbert@gondor.apana.org.au, smueller@chronox.de, linux-api@vger.kernel.org, marcel@holtmann.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, dwmw2@infradead.org, davem@davemloft.net From: Tadeusz Struk Message-ID: Date: Mon, 16 May 2016 07:23:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mat, On 05/13/2016 04:32 PM, Mat Martineau wrote: > >> + params.data_len = req->src_len; >> + params.enc_len = req->dst_len; Thanks for info. I have sent an update for this. > > The params member names have changed (now in_len and out_len). >> + ret = encrypt_blob(¶ms, in, out); > > The encrypt function for the key can now be called with params.key->type->asym_eds_op(). This also allows you to factor out the duplication in asym_key_encrypt, asym_key_decrypt, and asym_key_sign. See keyctl_pkey_e_d_s() in keyctl_pkey.c > >> +static int asym_key_verify(const struct key *key, struct akcipher_request *req) > ... >> + ret = verify_signature(key, NULL, &sig); > > key->type->asym_verify_signature() is available as well. Since these operation will be triggered from userspace I think it's better to use the official interface as defined in crypto/public_key.h instead of direct calls. Some operation may not be implemented for a given key type and the official interface performs necessary checks. Thanks, -- TS