提交 cf8834e7 编写于 作者: W wangshouping 提交者: Zheng Zengkai

kabi:crypto: reserve space for RSASSA-PSS style certificates

euleros inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4T4W4?from=project-issue
CVE: NA

--------

Reserve some fields beforehand for parsing RSASSA-PSS style certificates

---------
Signed-off-by: Nwangshouping <wangshouping@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: NWang Weiyang <wangweiyang2@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f532b284
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifndef _CRYPTO_AKCIPHER_H #ifndef _CRYPTO_AKCIPHER_H
#define _CRYPTO_AKCIPHER_H #define _CRYPTO_AKCIPHER_H
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/kabi.h>
/** /**
* struct akcipher_request - public key request * struct akcipher_request - public key request
...@@ -101,6 +102,7 @@ struct akcipher_alg { ...@@ -101,6 +102,7 @@ struct akcipher_alg {
unsigned int (*max_size)(struct crypto_akcipher *tfm); unsigned int (*max_size)(struct crypto_akcipher *tfm);
int (*init)(struct crypto_akcipher *tfm); int (*init)(struct crypto_akcipher *tfm);
void (*exit)(struct crypto_akcipher *tfm); void (*exit)(struct crypto_akcipher *tfm);
KABI_RESERVE(1)
unsigned int reqsize; unsigned int reqsize;
struct crypto_alg base; struct crypto_alg base;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/keyctl.h> #include <linux/keyctl.h>
#include <linux/oid_registry.h> #include <linux/oid_registry.h>
#include <crypto/akcipher.h> #include <crypto/akcipher.h>
#include <linux/kabi.h>
/* /*
* Cryptographic data for the public-key subtype of the asymmetric key type. * Cryptographic data for the public-key subtype of the asymmetric key type.
...@@ -29,6 +30,11 @@ struct public_key { ...@@ -29,6 +30,11 @@ struct public_key {
bool key_is_private; bool key_is_private;
const char *id_type; const char *id_type;
const char *pkey_algo; const char *pkey_algo;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
KABI_RESERVE(5)
}; };
extern void public_key_free(struct public_key *key); extern void public_key_free(struct public_key *key);
...@@ -47,6 +53,9 @@ struct public_key_signature { ...@@ -47,6 +53,9 @@ struct public_key_signature {
const char *encoding; const char *encoding;
const void *data; const void *data;
unsigned int data_size; unsigned int data_size;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
}; };
extern void public_key_signature_free(struct public_key_signature *sig); extern void public_key_signature_free(struct public_key_signature *sig);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#define __LINUX_KEYCTL_H #define __LINUX_KEYCTL_H
#include <uapi/linux/keyctl.h> #include <uapi/linux/keyctl.h>
#include <linux/kabi.h>
struct kernel_pkey_query { struct kernel_pkey_query {
__u32 supported_ops; /* Which ops are supported */ __u32 supported_ops; /* Which ops are supported */
...@@ -37,6 +38,8 @@ struct kernel_pkey_params { ...@@ -37,6 +38,8 @@ struct kernel_pkey_params {
__u32 in2_len; /* 2nd input data size (verify) */ __u32 in2_len; /* 2nd input data size (verify) */
}; };
enum kernel_pkey_operation op : 8; enum kernel_pkey_operation op : 8;
KABI_RESERVE(1)
KABI_RESERVE(2)
}; };
#endif /* __LINUX_KEYCTL_H */ #endif /* __LINUX_KEYCTL_H */
...@@ -116,6 +116,8 @@ enum OID { ...@@ -116,6 +116,8 @@ enum OID {
OID_sm3, /* 1.2.156.10197.1.401 */ OID_sm3, /* 1.2.156.10197.1.401 */
OID_SM2_with_SM3, /* 1.2.156.10197.1.501 */ OID_SM2_with_SM3, /* 1.2.156.10197.1.501 */
OID_sm3WithRSAEncryption, /* 1.2.156.10197.1.504 */ OID_sm3WithRSAEncryption, /* 1.2.156.10197.1.504 */
OID_mgf1, /* 1.2.840.113549.1.1.8 */
OID_rsassaPSS, /* 1.2.840.113549.1.1.10 */
OID__NR OID__NR
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册