[BACK]Return to rand.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Diff for /src/usr.bin/openssl/rand.c between version 1.4 and 1.5

version 1.4, 2014/10/13 02:46:14 version 1.5, 2014/10/22 13:54:03
Line 61 
Line 61 
   
 #include <openssl/bio.h>  #include <openssl/bio.h>
 #include <openssl/err.h>  #include <openssl/err.h>
 #include <openssl/rand.h>  
   
 struct {  struct {
         int base64;          int base64;
Line 171 
Line 170 
                 chunk = num;                  chunk = num;
                 if (chunk > (int) sizeof(buf))                  if (chunk > (int) sizeof(buf))
                         chunk = sizeof(buf);                          chunk = sizeof(buf);
                 r = RAND_bytes(buf, chunk);                  arc4random_buf(buf, chunk);
                 if (r <= 0)  
                         goto err;  
                 if (rand_config.hex) {                  if (rand_config.hex) {
                         for (i = 0; i < chunk; i++)                          for (i = 0; i < chunk; i++)
                                 BIO_printf(out, "%02x", buf[i]);                                  BIO_printf(out, "%02x", buf[i]);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5