SM2 KAP (Key Agreement Protocol), not tested

This commit is contained in:
Zhi Guan
2016-04-07 22:15:41 +02:00
parent ef74cbd1e5
commit 5cc6cfdf22
55 changed files with 3803 additions and 1028 deletions

View File

@@ -91,6 +91,10 @@
# include <openssl/ecdh.h>
# endif
# ifndef OPENSSL_NO_SM2
# include <openssl/sm2.h>
# endif
# ifndef OPENSSL_NO_DEPRECATED
# ifndef OPENSSL_NO_RSA
# include <openssl/rsa.h>

View File

@@ -90,6 +90,11 @@ int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
case EVP_PKEY_EC:
ret = EVP_PK_EC | EVP_PKT_SIGN | EVP_PKT_EXCH;
break;
#ifndef OPENSSL_NO_SM2
case EVP_PKEY_SM2:
ret = EVP_PK_EC | EVP_PKT_SIGN | EVP_PKT_EXCH;
break;
#endif
case EVP_PKEY_DH:
ret = EVP_PK_DH | EVP_PKT_EXCH;
break;
@@ -116,6 +121,9 @@ int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
case NID_X9_62_id_ecPublicKey:
ret |= EVP_PKS_EC;
break;
#ifndef OPENSSL_NO_SM2
/* what to do ? */
#endif
default:
break;
}