Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp296646iog; Wed, 15 Jun 2022 02:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRw7wygr+4b96qsmaYgexvxBcOUtArxjB8Vci4Tu48rAq/nztimW90280qXdqClo06DlXw X-Received: by 2002:a05:6402:b25:b0:42d:d14b:6399 with SMTP id bo5-20020a0564020b2500b0042dd14b6399mr11489018edb.38.1655285193771; Wed, 15 Jun 2022 02:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655285193; cv=none; d=google.com; s=arc-20160816; b=CH6Z8ZaUzxH9tkZ38nm5+qVLpvT1O4VEKmR2sJ6jDqsJK4GBNyLilmwF39KcIfE4TI /QEXgiPExM0Qg/G0acSDYMpbMCZBfXypC+4tPqPmVg1axrZA87xIIG+POwZcKbg0EG9u LN/gz2XfXjANqMZZFJ8uuam7dXM7XdUQ7BLP6u7kxUXMCRvZcq9ve0x7M3HVKDx4BlvY lzkGX+T8KX+6Fc4Aq02c793oO1IhMKb8gFQX2jG+TF29RRxAmVWMawa6V3BQQx7fXMmP zefm2lpP9SCzzHZvc7RCBCehFJeldJDDyWsLu2Mj27eexldDtF+HdUBF2vxwxjFW828/ x1bw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=cApAEWtZBNz7UY2lzjb00JFgiaDz9EH6nqt1F0MvTwA=; b=UbYkBBX4GAvHfwvBPPausQGlMzusfaCS6wkOwnHOp7qpbj62aaZ7Or6kEgx5pRXKcA jI+j8jhAcakSFwZc13ymND2pdu8eOGbSiIxH2ifUzgY0zYR53RPFElhl8SZ20KYVZFUR 3/rtMzqf1AxaCL2UjJvB0GdLDJNBlhiFSTRL6mQ1aBYjqvBBMfKoIMDgBOTit6e/zRPg HUA9CcxGTb7DS9RRNmMIXyJhxSodZnrzXvQsbkbx1G8PF4T5NjymeSD35dXhjLVCNGPe +EgtWKP7q94mhbB3P032j8JRKcxdlu6JAAjARDDWp+mJN5hfA7zfitg2riL09RzTpIRf GXsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="11Ue/j2O"; 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 i26-20020a1709067a5a00b0070fac9eaf73si13193133ejo.64.2022.06.15.02.26.01; Wed, 15 Jun 2022 02:26:33 -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="11Ue/j2O"; 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 S1346689AbiFOJOr (ORCPT + 99 others); Wed, 15 Jun 2022 05:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347196AbiFOJNt (ORCPT ); Wed, 15 Jun 2022 05:13:49 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E689393D9 for ; Wed, 15 Jun 2022 02:13:48 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id s37so8203033pfg.11 for ; Wed, 15 Jun 2022 02:13:48 -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:mime-version :content-transfer-encoding; bh=cApAEWtZBNz7UY2lzjb00JFgiaDz9EH6nqt1F0MvTwA=; b=11Ue/j2OxtkuGufH5THsd7RTX2PhW44eGxiMlp4kuhaX8NAQdxItmm+qVby1yX9/8f xZMPptt1Jr6zbWnucp4Fo7rNYJ/L7h2w+wae2kSxNgcmRS8AttRSRZ8lyU83JMK/B102 4VMGvf4jL/ArVxVb4jzUp6zWQg9guosQo+RzXFMu66qJbDYLSHnkEH+W5jt7Y4Myw8LO CbtaMOCJ+K3tv4nmU4qqVHBGP3q1/+9KQWB/ZpbY5TZ2W16kTxACGsGFhX3PEfUlfSas EKF5JkwCrW7uo7ia/Ttgm3fVHUYaUxeDAQH/fwz9aqMjEJmMEGeGnph4MLnjfiD1OHng Tstg== 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:mime-version :content-transfer-encoding; bh=cApAEWtZBNz7UY2lzjb00JFgiaDz9EH6nqt1F0MvTwA=; b=4o8aBwpbdQpHni1fA4Zc6p3rHAiEaTt6bxQmXvf32D3bUq1oWIm9IjJkAA8KJ3uw8z gb0UqRVWyq4vy6dY4oaXSzYuUWVfXlrTNG9TZuAEEMOVTOGzkt2HDc/pJSlMVqc2wQlK tyxm3iBWtjoyPa8jtmukQ9qPM5/biUg9BmgN5iuabUorbuhvDJH+TvDy5rgtqDfLJN+7 PXMO96sOUAmm9k6kLMuGqeUxfmHUwGiKbyRWIi3a9MnXgJ7LJ1FBM7b1f1vUrw6uKYzF otM7z4iWU6xaV4TRNbZ+DjMC00F5RR4GptP9PdoR/ZK67Czix46vfIw9u647BCF6FvlJ Se2Q== X-Gm-Message-State: AOAM530/4zIXJMK51YSEGaklgIkckS+C3OEzRnv6jHep20Gta8+QOybc 0kyu2SQS59q7bW7XLvA0T9EK+A== X-Received: by 2002:a63:cf51:0:b0:408:85f4:fb33 with SMTP id b17-20020a63cf51000000b0040885f4fb33mr8084169pgj.589.1655284427786; Wed, 15 Jun 2022 02:13:47 -0700 (PDT) Received: from FVFDK26JP3YV.bytedance.net ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id l3-20020a17090aaa8300b001e08461ceaesm1188414pjq.37.2022.06.15.02.13.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jun 2022 02:13:47 -0700 (PDT) From: Lei He To: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: helei.sig11@bytedance.com, pizhenwei@bytedance.com Subject: [PATCH] crypto: testmgr - fix version number of RSA tests Date: Wed, 15 Jun 2022 17:13:17 +0800 Message-Id: <20220615091317.36995-1-helei.sig11@bytedance.com> X-Mailer: git-send-email 2.29.2 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