summaryrefslogblamecommitdiff
path: root/user/kwallet/kwallet-5.22.0-blowfish-endianness.patch
blob: 3234cc1051f5200a5ce034c92e76d26183ee1d90 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                                                                   
                  





                                                                              

                                  

                     
                   
                   
                    



                                          
                     












                                             
                     












                                             
--- kwallet-5.29.0/src/runtime/kwalletd/backend/blowfish.cc.old	2016-12-03 21:12:17.000000000 +0000
+++ kwallet-5.29.0/src/runtime/kwalletd/backend/blowfish.cc	2017-01-29 18:02:10.193293280 +0000
@@ -19,12 +19,7 @@
 
 #include "blowfishtables.h"
 
-// DO NOT INCLUDE THIS. IT BREAKS KWALLET.
-// We need to live with -Wundef until someone really figures out the problem.
-//#include <QtCore/qglobal.h> // for Q_BYTE_ORDER and friends
+#include <QtGlobal> // for Q_BYTE_ORDER and friends
-// Workaround for -Wundef
-#define Q_BIG_ENDIAN 1
-#define Q_BYTE_ORDER Q_BIG_ENDIAN
 
 BlowFish::BlowFish()
 {
@@ -126,7 +121,7 @@
     return init();
 }
 // clang-format off
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
 #define shuffle(x) do {             \
         uint32_t r = x;             \
         x  = (r & 0xff000000) >> 24;    \
@@ -146,12 +141,12 @@
     }
 
     for (int i = 0; i < len / _blksz; i++) {
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
         shuffle(*d);
         shuffle(*(d + 1));
 #endif
         encipher(d, d + 1);
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
         shuffle(*d);
         shuffle(*(d + 1));
 #endif
@@ -170,12 +165,12 @@
     }
 
     for (int i = 0; i < len / _blksz; i++) {
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
         shuffle(*d);
         shuffle(*(d + 1));
 #endif
         decipher(d, d + 1);
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
         shuffle(*d);
         shuffle(*(d + 1));
 #endif