first step of v2 final release

This commit is contained in:
Zhi Guan
2017-11-05 21:00:36 +08:00
parent 480b9e8d88
commit 27bde477a5
395 changed files with 26341 additions and 31364 deletions

View File

@@ -57,11 +57,15 @@
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/rsa.h>
#ifndef OPENSSL_NO_RSA
# include <openssl/rsa.h>
#endif
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/sm2.h>
#ifndef OPENSSL_NO_SM2
# include <openssl/sm2.h>
#endif
int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
EVP_PKEY *priv)
@@ -80,9 +84,11 @@ int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
#endif
#ifndef OPENSSL_NO_SM2
siz = ekl;
if (!(ctx = EVP_PKEY_CTX_new(priv, NULL))
|| !EVP_PKEY_decrypt_init(ctx)
|| !EVP_PKEY_CTX_set_ec_enc_type(ctx, NID_sm_scheme)
|| !EVP_PKEY_CTX_set_ec_scheme(ctx, NID_sm_scheme)
|| !EVP_PKEY_CTX_set_ec_encrypt_param(ctx, NID_sm3)
|| !EVP_PKEY_decrypt(ctx, key, &siz, ek, ekl)) {
EVPerr(EVP_F_EVP_PKEY_DECRYPT_OLD, ERR_R_EVP_LIB);
goto end;