From: Dmitry Belyavskiy Date: Thu, 30 Aug 2018 09:06:25 +0000 (+0300) Subject: Dealing with new KeyExchange X-Git-Tag: v3.0.0~376 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=d56d9c6b281c09cd37c8fd489d3092d0dc2e1984;p=openssl-gost%2Fengine.git Dealing with new KeyExchange --- diff --git a/gost_lcl.h b/gost_lcl.h index f63f23c..7871eb8 100644 --- a/gost_lcl.h +++ b/gost_lcl.h @@ -69,7 +69,9 @@ struct gost_pmeth_data { * filled */ EVP_MD *md; unsigned char *shared_ukm; + size_t shared_ukm_size; /* XXX temporary use shared_ukm and hash for 2018 CKE*/ int peer_key_used; + int cipher_nid; /* KExp15/KImp15 algs*/ }; struct gost_mac_pmeth_data { diff --git a/gost_pmeth.c b/gost_pmeth.c index 69080bd..92c7bca 100644 --- a/gost_pmeth.c +++ b/gost_pmeth.c @@ -151,6 +151,10 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return 0; } memcpy(pctx->shared_ukm, p2, (int)p1); + pctx->shared_ukm_size = p1; + return 1; + case EVP_PKEY_CTRL_CIPHER: + pctx->cipher_nid = p1; return 1; case EVP_PKEY_CTRL_PEER_KEY: if (p1 == 0 || p1 == 1) /* call from EVP_PKEY_derive_set_peer */