Explorar el Código

Unix OSRandom Update.

updated check for insufficient block of data being read for OSRandom on Unix like OS.
Ugochukwu Mmaduekwe hace 7 años
padre
commit
59cef6c922
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      CryptoLib/src/Utils/Randoms/ClpOSRandom.pas

+ 2 - 2
CryptoLib/src/Utils/Randoms/ClpOSRandom.pas

@@ -40,7 +40,7 @@ resourcestring
   SUnixRandomUnavailable =
     '/dev/urandom or /dev/random is not available on this OS.';
   SUnixRandomReadError =
-    '/dev/urandom or /dev/random found but an error occured while reading it.';
+    '/dev/urandom or /dev/random found but an error occured while reading it (probably due to insufficient block of data to be read).';
 {$ENDIF MSWINDOWS}
 
 type
@@ -192,7 +192,7 @@ begin
   if FunixCryptOk = 1 then
   begin
     try
-      FStream.Read(data[0], count);
+      FStream.ReadBuffer(data[0], count);
     except
       raise EAccessCryptoLibException.CreateRes(@SUnixRandomReadError);
     end;