From: Dmitry Belyavskiy Date: Fri, 18 Sep 2020 08:18:10 +0000 (+0300) Subject: Endianess bugfix X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=fc2f9624c3ae1319eb57ba0920f4ffd7069088c8;p=openssl-gost%2Fengine.git Endianess bugfix (cherry picked from commit f1f47c6c7710291157aa863768d9048aaeaa9530) --- diff --git a/gost_keyexpimp.c b/gost_keyexpimp.c index e0961ff..3979b10 100644 --- a/gost_keyexpimp.c +++ b/gost_keyexpimp.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "gost_lcl.h" #include "e_gost_err.h" @@ -260,7 +261,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;