From: Vitaly Chikunov Date: Fri, 3 Dec 2021 09:04:06 +0000 (+0300) Subject: MSVC: Fix unreachable code warning X-Git-Tag: v3.0.1~34 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=b5613a2844470fd983cc3681633681a02ef6b44e;p=openssl-gost%2Fengine.git MSVC: Fix unreachable code warning Errors are like this: gost_pmeth.c(188): warning C4702: unreachable code gost_grasshopper_cipher.c(909): warning C4702: unreachable code Signed-off-by: Vitaly Chikunov --- diff --git a/gost_grasshopper_cipher.c b/gost_grasshopper_cipher.c index 38dd987..6723019 100644 --- a/gost_grasshopper_cipher.c +++ b/gost_grasshopper_cipher.c @@ -906,7 +906,6 @@ static int gost_grasshopper_cipher_ctl(EVP_CIPHER_CTX *ctx, int type, int arg, v return gost2015_process_unprotected_attributes(x, arg, KUZNYECHIK_MAC_MAX_SIZE, c->tag); } - return 1; case EVP_CTRL_COPY: { EVP_CIPHER_CTX *out = ptr; diff --git a/gost_keyexpimp.c b/gost_keyexpimp.c index e4af418..eb10331 100644 --- a/gost_keyexpimp.c +++ b/gost_keyexpimp.c @@ -364,7 +364,6 @@ static int magma_wrap_do(EVP_CIPHER_CTX *ctx, unsigned char *out, return gost_kimp15(cctx->wrapped, cctx->wrap_count, NID_magma_ctr, cctx->key+GOSTKEYLEN, NID_magma_mac, cctx->key, cctx->iv, 4, out) > 0 ? GOSTKEYLEN : 0; } - return 1; } static int kuznyechik_wrap_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/gost_omac.c b/gost_omac.c index 71dd38d..648cd8f 100644 --- a/gost_omac.c +++ b/gost_omac.c @@ -255,7 +255,6 @@ int omac_imit_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr) GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_BAD_ORDER); return 0; } - return 0; #endif default: return 0; diff --git a/gost_pmeth.c b/gost_pmeth.c index b83d88d..44bfc75 100644 --- a/gost_pmeth.c +++ b/gost_pmeth.c @@ -185,7 +185,6 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) pctx->cipher_nid = p1; return 1; } - return 1; case EVP_PKEY_CTRL_PEER_KEY: if (p1 == 0 || p1 == 1) /* call from EVP_PKEY_derive_set_peer */ return 1;