Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2243372ybd; Mon, 24 Jun 2019 03:11:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1aGiaByOeMsPHxclIPXryk73A/6Kjeq2RV8yUAWKzefZmojCmrPJtz1HF2apu5DTxNYXJ X-Received: by 2002:a65:62c2:: with SMTP id m2mr8431536pgv.413.1561371071385; Mon, 24 Jun 2019 03:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371071; cv=none; d=google.com; s=arc-20160816; b=GTNmDJ4hkMiUenstAIFpv++sEYyN57GFo1UTun0ro7IIn2x6517dzYtfVUE0eXy4Ep JPgflKhYqtpQlN10uQQDwYOfemPdmqdUXCpyTakr4i7uq7lJvSGptrOjf6bvwApcRZW4 +jv4VhXP5BLq0koIJ53gVzopPhDY5yo83oknwCjdBbJMuUHuZHavqIh4zux2eEWAm+5T /phUmon++/IQuos2U0vXq7u+sZDQvuO82YHv1nMl2hJatAIjAuFuqZ27xZ8ol0Lg24xj 3Xjzb+EY4CuYwWReNKuYOk9YyLAP2UQPPmb6d8Kp3erdQkEAHCgSD1elyyaRe3TGUc53 k2Ew== 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-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject; bh=fYiWFdiD50a93lRIgdQ6V8uZua6yfUfhQOyfoDJRyso=; b=OBQ179doq1iAK+RzFFCn36bFk0AbVjxY+EC7nhDuwTJo1rU9dTWyoTBUvHRIRs14r6 VufEo66nK9VOblQDZBkDYkybEwsKMxoATIg/oVRDPUdBqw0S76uTGR7cWzwapLiodahD 0UZx8/3YQwVO+cgzUh+n9G5x0CR0MLLiZqLyXm8jgYbmkibTLCUGpD4iQrwzSI+tatdX SbYnbb3dS/m8vdHoDrDOISCyOwTD65SCXR8Xz8d3fuZ7mvlst1EhmcmQBsUUdi7twzEH sJFF30Us+Sm/5EDiXeLPSXnv/t4tXI34cS2L21T1NF+2NPi9yFu3bSglQHTABgZfpB7S OVhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 e14si11027035pfd.141.2019.06.24.03.10.50; Mon, 24 Jun 2019 03:11:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 S1729027AbfFXKKG (ORCPT + 99 others); Mon, 24 Jun 2019 06:10:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:8776 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730384AbfFXKKG (ORCPT ); Mon, 24 Jun 2019 06:10:06 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5OA79ir026073 for ; Mon, 24 Jun 2019 06:10:05 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tasms02bn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Jun 2019 06:10:04 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Jun 2019 11:10:03 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 24 Jun 2019 11:10:01 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5OAA0L742074156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jun 2019 10:10:00 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 19CCB42054; Mon, 24 Jun 2019 10:10:00 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E05EC42047; Mon, 24 Jun 2019 10:09:59 +0000 (GMT) Received: from [10.0.2.15] (unknown [9.152.224.114]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Jun 2019 10:09:59 +0000 (GMT) Subject: Re: [RFC PATCH 02/30] crypto: s390/des - switch to new verification routines To: Ard Biesheuvel , linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@google.com References: <20190622003112.31033-1-ard.biesheuvel@linaro.org> <20190622003112.31033-3-ard.biesheuvel@linaro.org> From: Harald Freudenberger Date: Mon, 24 Jun 2019 12:10:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190622003112.31033-3-ard.biesheuvel@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 19062410-0016-0000-0000-0000028BD53A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19062410-0017-0000-0000-000032E94087 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-24_08:,, 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-1906240085 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 22.06.19 02:30, Ard Biesheuvel wrote: > Signed-off-by: Ard Biesheuvel > --- > arch/s390/crypto/des_s390.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c > index 1f9ab24dc048..4e4061885b0d 100644 > --- a/arch/s390/crypto/des_s390.c > +++ b/arch/s390/crypto/des_s390.c > @@ -15,7 +15,7 @@ > #include > #include > #include > -#include > +#include > #include > > #define DES3_KEY_SIZE (3 * DES_KEY_SIZE) > @@ -34,14 +34,11 @@ static int des_setkey(struct crypto_tfm *tfm, const u8 *key, > unsigned int key_len) > { > struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm); > - u32 tmp[DES_EXPKEY_WORDS]; > + int err; > > - /* check for weak keys */ > - if (!des_ekey(tmp, key) && > - (tfm->crt_flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS)) { > - tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY; > - return -EINVAL; > - } > + err = des_verify_key(tfm, key, key_len); > + if (unlikely(err)) > + return err; > > memcpy(ctx->key, key, key_len); > return 0; > @@ -226,7 +223,7 @@ static int des3_setkey(struct crypto_tfm *tfm, const u8 *key, > struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm); > int err; > > - err = __des3_verify_key(&tfm->crt_flags, key); > + err = crypto_des3_ede_verify_key(tfm, key, key_len); > if (unlikely(err)) > return err; > Fine with me, Thanks, Acked-by: Harald Freudenberger