Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp139750iog; Fri, 17 Jun 2022 00:09:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uj6cvs36KWQg4tAiFTIp3IV8j1xhbkRWmaVh3b/ncmZjWfaREDtHrHzJc/E2ogNfZtBNIb X-Received: by 2002:a62:7cca:0:b0:4fd:e594:fac0 with SMTP id x193-20020a627cca000000b004fde594fac0mr8622338pfc.79.1655449743879; Fri, 17 Jun 2022 00:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655449743; cv=none; d=google.com; s=arc-20160816; b=vzXnQoB+ghl1WaAEcCEVFi9kcJLR+Dbt+ELPIzGLXsmBLyNjnq4RMGs4UO+blxkmBo vUSl7zDoHSoGJ5lGbiT5I+nJiwt0PQ7jbBwI/0i+yXxQ6PrxY8UtCHaZ+tKKkoW2CRJn AcGE7oS5daN+EHvD3uT2339xtStD40YBYEIexizYaW5j1uW32StK1fY2jPKfBfblWvku 05yUWoua55MHyvGT1vKZf1KjEp+IxKLOD7Sc+c56kQFagUve5+BbkmDVjPY6Kh8+W+Yn z0K6Vo46bgrZx1rae7/tW3KLdA8c506zoUIoHWT2zdYA2XvDyewWNcS4A4V2Fr24kv57 DmSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cApAEWtZBNz7UY2lzjb00JFgiaDz9EH6nqt1F0MvTwA=; b=OB66x58m1ez+ba55/dv1r7Y7vSoTw/h/1Oiu0D7CnCuA4xjb0QwsPXsclFV8+IXsf8 W78xxi3MKzbO5fQJp+hv2xhO03d//qBg2lWmIBZN3XQ8MiK0UXYDUPK6p0mJdiKpQz4u Jl42lZ5RxLfU+1vrbZxUHj40NoKA50DFhDU9nX0zR/vyhyXRmBk9m9FV1RV9NkEulH2c SoUmcluRbIW/e0X3y02LyPVBMyKycDvgeQFWfOzw3ygGVOgxGcqbmTPwK7B3X0wZ3Ied ab0HQwgnkMnPXt5x7ItagG+W/KP1X21c/jrLvAYDWVZAEiY5Xq7NlLtdWJnUyIPeu4H+ SbhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=dR9rWk3w; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a634503000000b003fdb97d8757si5095884pga.378.2022.06.17.00.08.35; Fri, 17 Jun 2022 00:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=dR9rWk3w; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232524AbiFQHI3 (ORCPT + 99 others); Fri, 17 Jun 2022 03:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380398AbiFQHIY (ORCPT ); Fri, 17 Jun 2022 03:08:24 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685F162CDE for ; Fri, 17 Jun 2022 00:08:22 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id gd1so3295313pjb.2 for ; Fri, 17 Jun 2022 00:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cApAEWtZBNz7UY2lzjb00JFgiaDz9EH6nqt1F0MvTwA=; b=dR9rWk3waDmeKxQcyL8H0k64uqciC8n0wtkRXIZxFhuK2nVsmOkbK6xOoiGhpHSJyw WLIkpsrdUUJVIV9bKUPgx3Qzq5YEPZOFTq1kJ1lGppP5YDCSiJoqzJzKw+TLrPCsMDGQ 1nQbKEVRuNmjys9xN1xWtJsfN6+ukvj3WxfLIg2rtYrdDH9Oppe37V68QYA4t2l6wlCi InL4SP1zVFATQHq/6qDpdv2z2UnzwsjSDIkjbFJYV82BxTnotaHH80gY4XgIg4jM06Zw EXVra94ehrosHdxx5zBJL3O3jOGfDi3rs8v3rrwvqEvEIGQ5vn8fT844DhQDqBiiBT5O 4/zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cApAEWtZBNz7UY2lzjb00JFgiaDz9EH6nqt1F0MvTwA=; b=bwsmExxgUEDf7eYh78392RmxRtgahLHMJTeCyESv6QwcfPnfueDL3qIVmbc5kw0H8y 0zOC5jLKfdazKq0yRe58yDAOzeZcx+RekygWayyfad+UNSM6l5G+NSgrzxKIP8+Dwh5S rFfChmiu6Y5NwkE4U//aTN/a3BMda9qVvoH8xeU9B2AdNsAU9n7Oyd3LykcPFlWe7WvU F5AuR9xL0Qr42GHOLVF/i4KbWrAdYgJkcwi80gAT+pmY9IVDqzkI+gnYL+BUYmVRh2Wa 3Hrwv0SYgeB7rPrZWE/iAvXNYJjp4FHauZOZiQI4FyJfnOq0/p4mi0P2/mDqp7n0gvZY aZPw== X-Gm-Message-State: AJIora8FLoPPoBfDzcnJ/4pyzWWjcOE3p948WG0wKAq3FUNZYu36MgMm ZpyV65zrCvm0JrxYfbe8p50flfoF8Ib+QPsA X-Received: by 2002:a17:902:e751:b0:163:d8d9:8440 with SMTP id p17-20020a170902e75100b00163d8d98440mr8417293plf.12.1655449702093; Fri, 17 Jun 2022 00:08:22 -0700 (PDT) Received: from FVFDK26JP3YV.bytedance.net ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id j1-20020a170903028100b00163d4c3ffabsm2757868plr.304.2022.06.17.00.08.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2022 00:08:21 -0700 (PDT) From: Lei He To: herbert@gondor.apana.org.au, davem@davemloft.net, dhowells@redhat.com, mst@redhat.com Cc: arei.gonglei@huawei.com, jasowang@redhat.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, pizhenwei@bytedance.com, helei.sig11@bytedance.com, f4bug@amsat.org, berrange@redhat.com Subject: [PATCH] crypto: testmgr - fix version number of RSA tests Date: Fri, 17 Jun 2022 15:07:51 +0800 Message-Id: <20220617070754.73667-3-helei.sig11@bytedance.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220617070754.73667-1-helei.sig11@bytedance.com> References: <20220617070754.73667-1-helei.sig11@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: lei he According to PKCS#1 standard, the 'otherPrimeInfos' field contains the information for the additional primes r_3, ..., r_u, in order. It shall be omitted if the version is 0 and shall contain at least one instance of OtherPrimeInfo if the version is 1, see: https://www.rfc-editor.org/rfc/rfc3447#page-44 Replace the version number '1' with 0, otherwise, some drivers may not pass the run-time tests. Signed-off-by: lei he --- crypto/testmgr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 4d7449fc6a65..d57f24b906f1 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -186,7 +186,7 @@ static const struct akcipher_testvec rsa_tv_template[] = { #ifndef CONFIG_CRYPTO_FIPS .key = "\x30\x81\x9A" /* sequence of 154 bytes */ - "\x02\x01\x01" /* version - integer of 1 byte */ + "\x02\x01\x00" /* version - integer of 1 byte */ "\x02\x41" /* modulus - integer of 65 bytes */ "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F" "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5" @@ -216,7 +216,7 @@ static const struct akcipher_testvec rsa_tv_template[] = { }, { .key = "\x30\x82\x01\x1D" /* sequence of 285 bytes */ - "\x02\x01\x01" /* version - integer of 1 byte */ + "\x02\x01\x00" /* version - integer of 1 byte */ "\x02\x81\x81" /* modulus - integer of 129 bytes */ "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71" "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5" @@ -260,7 +260,7 @@ static const struct akcipher_testvec rsa_tv_template[] = { #endif .key = "\x30\x82\x02\x20" /* sequence of 544 bytes */ - "\x02\x01\x01" /* version - integer of 1 byte */ + "\x02\x01\x00" /* version - integer of 1 byte */ "\x02\x82\x01\x01\x00" /* modulus - integer of 256 bytes */ "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D" "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA" -- 2.20.1