rand.c (312826) | rand.c (331638) |
---|---|
1/* apps/rand.c */ 2/* ==================================================================== 3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 184 unchanged lines hidden (view full) --- 193 } 194 195 while (num > 0) { 196 unsigned char buf[4096]; 197 int chunk; 198 199 chunk = num; 200 if (chunk > (int)sizeof(buf)) | 1/* apps/rand.c */ 2/* ==================================================================== 3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 184 unchanged lines hidden (view full) --- 193 } 194 195 while (num > 0) { 196 unsigned char buf[4096]; 197 int chunk; 198 199 chunk = num; 200 if (chunk > (int)sizeof(buf)) |
201 chunk = sizeof buf; | 201 chunk = sizeof(buf); |
202 r = RAND_bytes(buf, chunk); 203 if (r <= 0) 204 goto err; 205 if (!hex) 206 BIO_write(out, buf, chunk); 207 else { 208 for (i = 0; i < chunk; i++) 209 BIO_printf(out, "%02x", buf[i]); --- 18 unchanged lines hidden --- | 202 r = RAND_bytes(buf, chunk); 203 if (r <= 0) 204 goto err; 205 if (!hex) 206 BIO_write(out, buf, chunk); 207 else { 208 for (i = 0; i < chunk; i++) 209 BIO_printf(out, "%02x", buf[i]); --- 18 unchanged lines hidden --- |