]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
MSVC: Fix unreachable code warning
authorVitaly Chikunov <vt@altlinux.org>
Fri, 3 Dec 2021 09:04:06 +0000 (12:04 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 11 Dec 2021 16:45:14 +0000 (19:45 +0300)
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 <vt@altlinux.org>
gost_grasshopper_cipher.c
gost_keyexpimp.c
gost_omac.c
gost_pmeth.c

index 38dd98776d06a3e6a7b7b99b854e4e746a19cd65..6723019e617b8d8ba03fe8daa6e1679ec80f4583 100644 (file)
@@ -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;
 
index e4af4180944cae514cbe334b6b99d85d04c7cea7..eb1033110c1cf7fcc8a4d8d5e297f3fe68b2e0dd 100644 (file)
@@ -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,
index 71dd38df1ee80d93ceb0f266f96ecb0d5807ec74..648cd8f39550bee5a31aa982c118ec71f07f1c43 100644 (file)
@@ -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;
index b83d88dcf74dd03f9d19c30ca8a0790e0763e60c..44bfc75ff9af52c5d6649abf22f15b165fec0ddd 100644 (file)
@@ -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;