Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp7889img; Wed, 27 Feb 2019 15:31:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IagMl0QWbvGoYsQp7FMIvXw9TvZrKHgCNeLFZk4ugd89DAxhJIOn9e8R6WgQktr22ZD6fD2 X-Received: by 2002:a62:f20d:: with SMTP id m13mr4248277pfh.174.1551310270210; Wed, 27 Feb 2019 15:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551310270; cv=none; d=google.com; s=arc-20160816; b=qvYZkML/eaGbGQODxynzFdXyKzfvJFPamFweQFlrahpKDmINHEAjgKPFHoLE63Aaww a9hWSTndl3Bus5Cllqp30lFgnLFAW8KWB/u7LkhEU13+UA/FWHczZTFCSOl1OgfTzk9A BOFJRcoqs/bozlvhK+sjjTDgKr8C2v6tVdN8GoCLRl7CJUTU5QiDHInXUIaNlTy1JKHL XtF8PwjuJSSUiFJw/Z9N1LXHNkpzWvBm10EG7207uXu9MdfQfMUv7/JeL4bTYXegaXz+ 2f6Pmoqy2hytsERvWB0szrIBhwenfv5F4EAqQ233CNNVM5r/TPecP6QGIoH4r3zUXuAo 0s7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:to:from:subject; bh=FFVHKalWxhxehXmgfVJeIX51fuBLl7lflPvgb5VDBxY=; b=eaYLuVOG6iTNWfL7q4leuCEE4bvvirsCzkZ3nLa2LKbI8sYgOB5+QhD8ean6NnpV7u zBvPD4C0bwAl5bhzVITVraOuTP+c+ChKLR+QjjBERbtqQa8kgTJ/cn3BrK6RSFikkC2e HtlN7tmLo3NB/OV7i3z64cyMyVxoX2slFwlsztJhtbfe70jidudJoxI3av+IKiPZ8/rD XiLZu6GVe2u0CqqXBDzE1rrkgvUVebnzJvE0vxBJ/2UGidH4P1Kvfj/PCJXvj3QSQchO /22PZhX20z4KvC2rzQGCjuZqYtcEZjuxXkznEkUNV2n5R9XVbReeND0IJzsvfWFb4Aub gn2g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h64si2130003pfd.74.2019.02.27.15.30.54; Wed, 27 Feb 2019 15:31:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730340AbfB0X3A (ORCPT + 99 others); Wed, 27 Feb 2019 18:29:00 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39374 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728397AbfB0X3A (ORCPT ); Wed, 27 Feb 2019 18:29:00 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1RNJZi3088255 for ; Wed, 27 Feb 2019 18:28:55 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qx1qhe4an-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Feb 2019 18:28:55 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Feb 2019 23:28:53 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 27 Feb 2019 23:28:50 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1RNSnQ058195990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Feb 2019 23:28:49 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5008D4278B; Wed, 27 Feb 2019 23:28:49 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EE3842790; Wed, 27 Feb 2019 23:28:48 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.106.105]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 27 Feb 2019 23:28:48 +0000 (GMT) Subject: Re: [PATCH v5 04/10] crypto: akcipher - new verify API for public key algorithms From: Mimi Zohar To: Vitaly Chikunov , Herbert Xu , David Howells , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 27 Feb 2019 18:28:37 -0500 In-Reply-To: <20190224060828.2527-5-vt@altlinux.org> References: <20190224060828.2527-1-vt@altlinux.org> <20190224060828.2527-5-vt@altlinux.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19022723-0020-0000-0000-0000031C18FD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19022723-0021-0000-0000-0000216D87D5 Message-Id: <1551310117.10911.108.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-27_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902270151 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vitaly, On Sun, 2019-02-24 at 09:08 +0300, Vitaly Chikunov wrote: > Previous akcipher .verify() just `decrypts' (using RSA encrypt which is > using public key) signature to uncover message hash, which was then > compared in upper level public_key_verify_signature() with the expected > hash value, which itself was never passed into verify(). > > This approach was incompatible with EC-DSA family of algorithms, > because, to verify a signature EC-DSA algorithm also needs a hash value > as input; then it's used (together with a signature divided into halves > `r||s') to produce a witness value, which is then compared with `r' to > determine if the signature is correct. Thus, for EC-DSA, nor > requirements of .verify() itself, nor its output expectations in > public_key_verify_signature() wasn't sufficient. > > Make improved .verify() call which gets hash value as input and produce > complete signature check without any output besides status. > > Now for the top level verification only crypto_akcipher_verify() needs > to be called. All but this patch apply.  Which branch is this patch based against? Mimi