]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: fix test vector for rsa
authorTadeusz Struk <tadeusz.struk@intel.com>
Thu, 14 Jan 2016 04:57:40 +0000 (20:57 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:34 +0000 (14:28 -0800)
commit949d865fff8a6a863216f71df6061cc78cd4cd53
treeca569ced7f94bc6f7d751f42314edc67e8fad75b
parentfedc457a9a6dbe62db206bae1487a1da9bb0d217
crypto: fix test vector for rsa

After the fix to the asn1_decoder in commit: 0d62e9dd
"ASN.1: Fix non-match detection failure on data overrun"
the rsa algorithm is failing to register in 4.3 stable kernels with
error: "alg: rsa: test failed on vector 4, err=-74"

This happens because the asn1 definition for the rsa key that has been
added in 4.2 defined all 3 components of the key as non-optional, as
the asn1_decoder before the fix was working fine for both the private
and public keys.

This patch adds the missing (fake) component to one key vector to allow
the algorithm to successfully register and be used with a valid private
keys later. This is only to make the asn1_decoder successfully parse the
key and the fake component is never used in the test as the vector is
marked as public key.

This patch applies only to 4.3 kernels as the 4.2 version of asn1_decoder
works fine with the asn1 definition.
4.4 is also ok because the akcipher interface has been changed, and
the set_key function has been split into set_public_key and set_priv_key
and there are two separate asn1 definitions for the two key formats
with all the required components correctly defined (commit 22287b0).

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.h