Преглед изворни кода

* Prevent timing attack, patch by Thaddy De Koning

git-svn-id: trunk@32795 -
michael пре 9 година
родитељ
комит
8e33a70981
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      packages/hash/src/md5.pp

+ 3 - 0
packages/hash/src/md5.pp

@@ -722,7 +722,10 @@ var
   A: array[0..3] of Cardinal absolute Digest1;
   B: array[0..3] of Cardinal absolute Digest2;
 begin
+{$push}
+{$B+}
   Result := (A[0] = B[0]) and (A[1] = B[1]) and (A[2] = B[2]) and (A[3] = B[3]);
+{$pop}
 end;
 
 procedure MD2Init(out Context: TMD2Context);