summary refs log tree commit diff
path: root/crypto/sm2.c
diff options
context:
space:
mode:
authorLei He <helei.sig11@bytedance.com>2021-11-05 20:25:31 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-11-20 15:02:08 +1100
commita9887010ed2da3fddaff83ceec80e2b71be8a966 (patch)
treeeb3921e5754aa9dd3cf8afd16300c7194cea060b /crypto/sm2.c
parente9c195aaeed1b45c9012adbe29dedb6031e85aa8 (diff)
downloadlinux-a9887010ed2da3fddaff83ceec80e2b71be8a966.tar.gz
crypto: testmgr - Fix wrong test case of RSA
According to the BER encoding rules, integer value should be encoded
as two's complement, and if the highest bit of a positive integer
is 1, should add a leading zero-octet.

The kernel's built-in RSA algorithm cannot recognize negative numbers
when parsing keys, so it can pass this test case.

Export the key to file and run the following command to verify the
fix result:

  openssl asn1parse -inform DER -in /path/to/key/file

Signed-off-by: Lei He <helei.sig11@bytedance.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/sm2.c')
0 files changed, 0 insertions, 0 deletions