X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_ameth.c;h=4a95de4b5a203b13c32406abb6df7814f2756493;hb=0c4da90d6605b68fcb1e6e95b3d7eecb2ecb1a80;hp=397dbe8fc771317e6bb4b668e89c10d85594ffb9;hpb=9cf021b8f3cc7b0f49ecd2f165bd1864903c90d0;p=openssl-gost%2Fengine.git diff --git a/gost_ameth.c b/gost_ameth.c index 397dbe8..4a95de4 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -224,7 +224,7 @@ BIGNUM *gost_get0_priv_key(const EVP_PKEY *pkey) * GOST CMS processing functions */ /* FIXME reaarange declarations */ -static int pub_decode_gost_ec(EVP_PKEY *pk, X509_PUBKEY *pub); +static int pub_decode_gost_ec(EVP_PKEY *pk, const X509_PUBKEY *pub); static int gost_cms_set_kari_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) { @@ -896,7 +896,7 @@ static int param_cmp_gost_ec(const EVP_PKEY *a, const EVP_PKEY *b) } /* ---------- Public key functions * --------------------------------------*/ -static int pub_decode_gost_ec(EVP_PKEY *pk, X509_PUBKEY *pub) +static int pub_decode_gost_ec(EVP_PKEY *pk, const X509_PUBKEY *pub) { X509_ALGOR *palg = NULL; const unsigned char *pubkey_buf = NULL; @@ -973,7 +973,7 @@ static int pub_encode_gost_ec(X509_PUBKEY *pub, const EVP_PKEY *pk) pval = params; order = BN_new(); - if (!order) { + if (order == NULL || EC_GROUP_get_order(EC_KEY_get0_group(ec), order, NULL) == 0) { GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, ERR_R_MALLOC_FAILURE); goto err; }