if ( !(pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) ){ goto clean_up;} if ( (EVP_PKEY_paramgen_init(pctx)) != 1 ){ goto clean_up;} if ( (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_sm2)) <= 0 ){ goto clean_up;} if ( (EVP_PKEY_keygen_init(pctx)) ...
1、SM2实现( 利openssl的evp)加解密#include #include #include #include openssl/ec.h #include openssl/evp.h/* Main function return value:0: main function executes successfully-1: an error occurs*/ int main(void)int ret = -1, i;EVP_PKEY_CTX *pctx = NULL, *ectx = NULL; EVP_PKEY *p...
(pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) ) { goto clean_up; } if ( (EVP_PKEY_paramgen_init(pctx)) != 1 ) { goto clean_up; } if ( (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_sm2)) <= 0 ) { goto clean_up; } if ( (EVP_PKEY_keygen_init(pctx))...
hnid = OBJ_obj2nid(alg1->algorithm);if(hnid == NID_undef)return-1;if(!OBJ_find_sigid_by_algs(&snid, hnid,EVP_PKEY_id(pkey)))return-1; X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF,0); }return1;#ifndefOPENSSL_NO_CMScaseASN1_PKEY_CTRL_CMS_SIGN:if(arg1 ==0)...
const unsigned char *p8_data = NULL; unsigned char *encoded_data = NULL; int encoded_len; int selection; size_t len; OSSL_DECODER_CTX *dctx = NULL; const ASN1_OBJECT *algoid = NULL; char keytype[OSSL_MAX_NAME_SIZE]; if (p8 == NULL || !PKCS8_pkey_get0(&algoid, NULL,...
ok =1; end:EVP_PKEY_CTX_free(ctx); EVP_PKEY_free(pkey); OPENSSL_free(signature); OPENSSL_free(paddedData); OPENSSL_free(dataToSign);returnok; } 开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:88,代码来源:dsa_no_digest_size_test.c ...
Make EVP_PKEY_CTX_[get|set]_ec_paramgen_curve_name more generic mattcaswellcommittedJun 19, 2020 11a1b34 Commits on Jun 8, 2020 EVP: Let EVP_PKEY_gen() initialize ctx->keygen_info levittecommittedJun 9, 2020 4ec1463 Commits on May 8, 2020 EVP: when setting the operatio...
(pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) ) { goto clean_up; } if ( (EVP_PKEY_paramgen_init(pctx)) != 1 ) { goto clean_up; } if ( (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_sm2)) <= 0 ) { goto clean_up; } if ( (EVP_PKEY_keygen_init(pctx))...
c->valid =0;return(1); } 开发者ID:125radheyshyam,项目名称:node,代码行数:60,代码来源:ssl_rsa.c 示例3: ssl_set_pkey ▲点赞 5▼ staticintssl_set_pkey(CERT *c, EVP_PKEY *pkey){inti;/* Special case for DH: check two DH certificate types for a match. ...
{ BIO_B64_CTX *ctx; if (a == NULL) return 0; ctx = BIO_get_data(a); if (ctx == NULL) return 0; EVP_ENCODE_CTX_free(ctx->base64); OPENSSL_free(ctx); BIO_set_data(a, NULL); BIO_set_init(a, 0); return 1; } static int b64_read(BIO *b, char *out, int outl) {...