X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_pmeth.c;h=92c7bca399e1b18cc6064abdfcb8b90a1190f4fe;hb=a430c355a1d2eff5df6c96c7b6f928a609c2dd73;hp=e615d012936c29bd4ec75319ae9a2a7473af9ff1;hpb=6ee305aa55f793269627735081a1133265e91bfb;p=openssl-gost%2Fengine.git diff --git a/gost_pmeth.c b/gost_pmeth.c index e615d01..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 */ @@ -556,8 +560,7 @@ static int pkey_gost_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) case EVP_PKEY_CTRL_MD: { int nid = EVP_MD_type((const EVP_MD *)p2); - if (nid != NID_id_Gost28147_89_MAC && nid != NID_gost_mac_12 - && nid != NID_magma_mac && nid != NID_grasshopper_mac) { + if (nid != NID_id_Gost28147_89_MAC && nid != NID_gost_mac_12) { GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL, GOST_R_INVALID_DIGEST_TYPE); return 0; @@ -615,7 +618,6 @@ static int pkey_gost_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) } case EVP_PKEY_CTRL_MAC_LEN: { - /*TODO*/ if (p1 < 1 || p1 > 8) { GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL, GOST_R_INVALID_MAC_SIZE); @@ -747,8 +749,7 @@ static int pkey_gost_omac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2, si } case EVP_PKEY_CTRL_MAC_LEN: { - /*TODO*/ - if (p1 < 1 || p1 > 8) { + if (p1 < 1 || p1 > max_size) { GOSTerr(GOST_F_PKEY_GOST_OMAC_CTRL, GOST_R_INVALID_MAC_SIZE); return 0;