From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752887AbcELKT2 (ORCPT ); Thu, 12 May 2016 06:19:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40643 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbcELKT0 (ORCPT ); Thu, 12 May 2016 06:19:26 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20160511142152.4743.14414.stgit@warthog.procyon.org.uk> <20160511142230.4743.12500.stgit@warthog.procyon.org.uk> To: Mat Martineau , tadeusz.struk@intel.com Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, dwmw2@infradead.org Subject: Re: [RFC PATCH 5/8] KEYS: Provide software public key query function [ver 3] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25138.1463048363.1@warthog.procyon.org.uk> Date: Thu, 12 May 2016 11:19:23 +0100 Message-ID: <25139.1463048363@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 12 May 2016 10:19:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mat Martineau wrote: > > + len = crypto_akcipher_maxsize(tfm); > > + info->key_size = len * 8; > > + info->max_data_size = len; > > + info->max_sig_size = len; > > + info->max_enc_size = len; > > + info->max_dec_size = len; > > If len > UINT16_MAX, should UINT16_MAX be reported as the max size? Similar > question for len*8 and key_size. key_size is 32 bits, but the other sizes are all 16 bits, so you would need a 524288-bit key to exceed their capacity. I'm not sure that's likely anytime soon, but should I just make all the sizes 32-bit anyway? David