Просмотр исходного кода

* apt-pkg/contrib/sha256.cc:
The patch below fixes the problem by open-coding the ntohl() call and
combining it with a byte-by-byte load of the 32-bit word.

Michael Vogt лет назад: 20
Родитель
Сommit
4bbffb86b6
2 измененных файлов с 5 добавлено и 2 удалено
  1. 4 1
      apt-pkg/contrib/sha256.cc
  2. 1 1
      debian/compat

+ 4 - 1
apt-pkg/contrib/sha256.cc

@@ -61,7 +61,10 @@ static inline u32 Maj(u32 x, u32 y, u32 z)
 
 
 static inline void LOAD_OP(int I, u32 *W, const u8 *input)
 static inline void LOAD_OP(int I, u32 *W, const u8 *input)
 {
 {
-        W[I] = ntohl( ((u32*)(input))[I] );
+	W[I] = (  ((u32) input[I + 0] << 24)
+		| ((u32) input[I + 1] << 16)
+		| ((u32) input[I + 2] << 8)
+		| ((u32) input[I + 3]));
 }
 }
 
 
 static inline void BLEND_OP(int I, u32 *W)
 static inline void BLEND_OP(int I, u32 *W)

+ 1 - 1
debian/compat

@@ -1 +1 @@
-3
+5