]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
fix typo causing 'bad mac' error in tls 1.3 handshake
authorigrkir <i.kirillov@kryptonite.ru>
Sun, 12 Feb 2023 10:47:54 +0000 (13:47 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sun, 12 Feb 2023 15:59:10 +0000 (16:59 +0100)
gost_crypt.c
gost_grasshopper_cipher.c
gost_keyexpimp.c

index 62da4f23af4bc558737835b79d9410a3527514dd..088ee5905b59027e9dd5280464974d125ea08a03 100644 (file)
@@ -1132,9 +1132,11 @@ static int gost_magma_mgm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
                   > 0) {
                 magma_key(&mctx->ks.g_ks.cctx, newkey);
                 memset(newkey, 0, sizeof(newkey));
+
+                return 1;
             }
         }
-        return 1;
+        return -1;
 
     default:
         return -1;
index d37ae66f9ad20f67544453abd457ed780331c0a6..105fd42192b99a2370767f3a757635a927000f70 100644 (file)
@@ -1097,9 +1097,11 @@ static int gost_grasshopper_mgm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void
                   > 0) {
                gost_grasshopper_cipher_key(&mctx->ks.gh_ks, newkey);
                memset(newkey, 0, sizeof(newkey));
+
+               return 1;
             }
         }
-        return 1;
+        return -1;
 
     default:
         return -1;
index 12e0eaa77bc0d232633edc16b02cb1d9f8b557b3..6cbb342e534a8e356165156981d4444b748b21ac 100644 (file)
@@ -308,6 +308,7 @@ int gost_tlstree(int cipher_nid, const unsigned char *in, unsigned char *out,
             c1 = 0x00000000000000f8;
             c2 = 0x00000000f0ffffff;
             c3 = 0x00e0ffffffffffff;
+            break;
         default:
             return 0;
         }