X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_ameth.c;h=b8998417446ecda8c9d64514841e3d00b8454cff;hb=refs%2Fheads%2Fossl_patched;hp=f4f50fabceddb40e2bffc5aa24d5d1df42940ad5;hpb=795f0b415bc5ff73a54ca15a8f4f8be1f56a82c2;p=openssl-gost%2Fengine.git diff --git a/gost_ameth.c b/gost_ameth.c index f4f50fa..b899841 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -229,7 +229,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, const X509_PUBKEY *pub); +static int pub_decode_gost_ec(EVP_PKEY *pk, X509_PUBKEY *pub); static int gost_cms_set_kari_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) { @@ -531,6 +531,12 @@ static int pkey_ctrl_gost(EVP_PKEY *pkey, int op, long arg1, void *arg2) case ASN1_PKEY_CTRL_DEFAULT_MD_NID: *(int *)arg2 = md_nid; return 2; + + case ASN1_PKEY_CTRL_SET1_TLS_ENCPT: + return gost_ec_oct2key((EC_KEY *)EVP_PKEY_get0(pkey), arg2, arg1); + + case ASN1_PKEY_CTRL_GET1_TLS_ENCPT: + return gost_ec_key2buf((EC_KEY *)EVP_PKEY_get0(pkey), arg2); } return -2; @@ -902,7 +908,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, const X509_PUBKEY *pub) +static int pub_decode_gost_ec(EVP_PKEY *pk, X509_PUBKEY *pub) { X509_ALGOR *palg = NULL; const unsigned char *pubkey_buf = NULL;