RAND_bytes() return 1 for cryptographic strong data, check for that.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18479 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-10-16 13:47:59 +00:00
parent 5ae45a4523
commit 5a9e545620

View File

@@ -950,9 +950,9 @@ random_data(void *opt, int argc, char **argv)
}
ret = RAND_bytes(ptr, len);
if (ret != len) {
if (ret != 1) {
free(ptr);
fprintf(stderr, "requested %d bytes, got %d bytes\n", len, ret);
fprintf(stderr, "did not get cryptographic strong random\n");
return 1;
}