diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2021-03-16 17:07:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-03-26 19:41:58 +1100 |
commit | d1a303e8616c5ba1260722bb9068bbc0d1704847 (patch) | |
tree | a8e974831956a7c1b73b2cb8022ee8f448cab386 /include | |
parent | c12d448ba939cafc5fe04ae93bc3f4c27b5d213c (diff) | |
download | linux-d1a303e8616c5ba1260722bb9068bbc0d1704847.tar.bz2 |
x509: Detect sm2 keys by their parameters OID
Detect whether a key is an sm2 type of key by its OID in the parameters
array rather than assuming that everything under OID_id_ecPublicKey
is sm2, which is not the case.
Cc: David Howells <dhowells@redhat.com>
Cc: keyrings@vger.kernel.org
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tested-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/oid_registry.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h index b504e2f36b25..f32d91895e4d 100644 --- a/include/linux/oid_registry.h +++ b/include/linux/oid_registry.h @@ -121,6 +121,7 @@ enum OID { }; extern enum OID look_up_OID(const void *data, size_t datasize); +extern int parse_OID(const void *data, size_t datasize, enum OID *oid); extern int sprint_oid(const void *, size_t, char *, size_t); extern int sprint_OID(enum OID, char *, size_t); |