]> 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:19:06 +0000 (11:19 +0300)
(cherry picked from commit f1f47c6c7710291157aa863768d9048aaeaa9530)

gost_keyexpimp.c

index e0961ff5f0bba2cc421f4716dc11af3f8b0b2486..3979b1083badb00505a21be41f7f93b119da3dc7 100644 (file)
@@ -6,6 +6,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"
@@ -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;