]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Endianess bugfix
authorDmitry Belyavskiy <beldmit@gmail.com>
Fri, 18 Sep 2020 08:18:10 +0000 (11:18 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Fri, 18 Sep 2020 08:18:10 +0000 (11:18 +0300)
gost_keyexpimp.c

index 1f2c0aaf93eb663847afacba54aecbcd417d712f..02eac5d1153581a709f2965a1354f7717b6a0a11 100644 (file)
@@ -13,6 +13,7 @@
 #include <string.h>
 #include <openssl/evp.h>
 #include <openssl/hmac.h>
+#include <openssl/buffer.h>
 
 #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;