]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_ameth.c
Delete .travis.yml
[openssl-gost/engine.git] / gost_ameth.c
index f4f50fabceddb40e2bffc5aa24d5d1df42940ad5..b8998417446ecda8c9d64514841e3d00b8454cff 100644 (file)
@@ -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;