blowfish_endianess
authorDebian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sat, 9 Jul 2016 10:31:10 +0000 (12:31 +0200)
committerSandro Knauß <hefee@debian.org>
Tue, 26 May 2020 21:57:38 +0000 (22:57 +0100)
Gbp-Pq: Name blowfish_endianess.diff

src/runtime/kwalletd/backend/blowfish.cc

index 5d7f55cccf88309771e81b78a9c815ba371275d5..85c4d6f77455c64dc7435baca759e9acbd1533ee 100644 (file)
@@ -33,7 +33,7 @@
 
 // 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 <QtCore/qglobal.h> // for Q_BYTE_ORDER and friends
 
 BlowFish::BlowFish()
 {
@@ -135,7 +135,7 @@ bool BlowFish::setKey(void *key, int bitlength)
     return init();
 }
 
-#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;    \
@@ -154,12 +154,12 @@ int BlowFish::encrypt(void *block, int len)
     }
 
     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
@@ -178,12 +178,12 @@ int BlowFish::decrypt(void *block, int len)
     }
 
     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