2023-12-23 16:56:36 +08:00
|
|
|
From 52325495900f1bd9e1f228f24c81c0746520dc85 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: hanxinke <hanxinke@huawei.com>
|
|
|
|
|
Date: Tue, 3 Aug 2021 10:45:22 +0800
|
2023-05-19 16:04:53 +08:00
|
|
|
Subject: [PATCH] provide openssl apis related to SM for python
|
|
|
|
|
|
2023-12-23 16:56:36 +08:00
|
|
|
Signed-off-by: hanxinke <hanxinke@huawei.com>
|
2023-05-19 16:04:53 +08:00
|
|
|
---
|
|
|
|
|
src/_cffi_src/openssl/evp.py | 7 +++++++
|
|
|
|
|
1 file changed, 7 insertions(+)
|
|
|
|
|
|
2022-07-01 14:26:16 +08:00
|
|
|
diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py
|
2023-05-19 16:04:53 +08:00
|
|
|
index b8a3899..0797d59 100644
|
2022-07-01 14:26:16 +08:00
|
|
|
--- a/src/_cffi_src/openssl/evp.py
|
|
|
|
|
+++ b/src/_cffi_src/openssl/evp.py
|
2023-05-19 16:04:53 +08:00
|
|
|
@@ -35,6 +35,7 @@ static const int Cryptography_HAS_SCRYPT;
|
|
|
|
|
static const int Cryptography_HAS_EVP_PKEY_DHX;
|
2022-07-01 14:26:16 +08:00
|
|
|
static const long Cryptography_HAS_RAW_KEY;
|
|
|
|
|
static const long Cryptography_HAS_EVP_DIGESTFINAL_XOF;
|
|
|
|
|
+static const int EVP_PKEY_SM2;
|
2022-07-19 10:33:05 +08:00
|
|
|
static const long Cryptography_HAS_300_FIPS;
|
2023-05-19 16:04:53 +08:00
|
|
|
static const long Cryptography_HAS_300_EVP_CIPHER;
|
2022-07-19 10:33:05 +08:00
|
|
|
static const long Cryptography_HAS_EVP_PKEY_DH;
|
2023-05-19 16:04:53 +08:00
|
|
|
@@ -93,6 +94,9 @@ int EVP_DigestSignFinal(EVP_MD_CTX *, unsigned char *, size_t *);
|
2022-07-01 14:26:16 +08:00
|
|
|
int EVP_DigestVerifyInit(EVP_MD_CTX *, EVP_PKEY_CTX **, const EVP_MD *,
|
|
|
|
|
ENGINE *, EVP_PKEY *);
|
|
|
|
|
|
|
|
|
|
+int EVP_DigestVerifyUpdate(EVP_MD_CTX *, const void *, size_t);
|
|
|
|
|
+int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
|
2022-07-19 10:33:05 +08:00
|
|
|
+ size_t siglen);
|
2022-07-01 14:26:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *, ENGINE *);
|
2023-05-19 16:04:53 +08:00
|
|
|
@@ -158,6 +162,9 @@ EVP_PKEY *EVP_PKEY_new_raw_public_key(int, ENGINE *, const unsigned char *,
|
2022-07-01 14:26:16 +08:00
|
|
|
int EVP_PKEY_get_raw_private_key(const EVP_PKEY *, unsigned char *, size_t *);
|
|
|
|
|
int EVP_PKEY_get_raw_public_key(const EVP_PKEY *, unsigned char *, size_t *);
|
2022-07-19 10:33:05 +08:00
|
|
|
|
2022-07-01 14:26:16 +08:00
|
|
|
+void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
|
|
|
|
|
+const EVP_MD *EVP_sm3(void);
|
2022-07-19 10:33:05 +08:00
|
|
|
+
|
|
|
|
|
int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *);
|
|
|
|
|
int EVP_default_properties_enable_fips(OSSL_LIB_CTX *, int);
|
2022-07-01 14:26:16 +08:00
|
|
|
"""
|
2023-05-19 16:04:53 +08:00
|
|
|
--
|
|
|
|
|
2.33.0
|
|
|
|
|
|