From 5cd9a218ba5191435e0dbf47051c6d81f1a39925 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Fri, 18 Sep 2020 11:18:10 +0300 Subject: [PATCH] Endianess bugfix (cherry picked from commit f1f47c6c7710291157aa863768d9048aaeaa9530) --- gost_keyexpimp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gost_keyexpimp.c b/gost_keyexpimp.c index 1f2c0aa..02eac5d 100644 --- a/gost_keyexpimp.c +++ b/gost_keyexpimp.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "gost_lcl.h" #include "e_gost_err.h" @@ -267,7 +268,11 @@ int gost_tlstree(int cipher_nid, const unsigned char *in, unsigned char *out, default: return 0; } +#ifndef L_ENDIAN + BUF_reverse(&seq, tlsseq, 8); +#else memcpy(&seq, tlsseq, 8); +#endif seed1 = seq & c1; seed2 = seq & c2; seed3 = seq & c3; -- 2.39.5