Skip to content
Closed
6 changes: 3 additions & 3 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,9 @@ Generates cryptographically strong pseudo-random data. Usage:
}

NOTE: This will block if there is insufficient entropy, although it should
normally never take longer than a few milliseconds. The only time when this
may conceivably block is right after boot, when the whole system is still
low on entropy.
normally never take longer than a few milliseconds.
Under normal circumstances, the only error thrown from this is from RAND_bytes(), which throws when it doesn't have enough entropy.
However, with CheckEntropy, this will block until the system has enough entropy for the OpenSSL pool.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's very enlightening for people not familiar with openssl or the code base. I don't really have suggestions on how to reword it, just that it's not very helpful now (and the part about CheckEntropy() is arguably wrong in a nuanced way.)

Also, please wrap lines at 80 columns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, @JungMinu, you could update the code block instead? The note is mostly correct about the current behavior. Maybe remove the try / catch block in the example?


## Class: Certificate

Expand Down