From d56d9c6b281c09cd37c8fd489d3092d0dc2e1984 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Thu, 30 Aug 2018 12:06:25 +0300 Subject: [PATCH] Dealing with new KeyExchange --- gost_lcl.h | 2 ++ gost_pmeth.c | 4 ++++ 2 files changed, 6 insertions(+) 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 */ -- 2.39.5