• R
    Remove ambiguity in rand_pool_add[_end] return value · 8e2bec9b
    Richard Levitte 提交于
    When these two functions returned zero, it could mean:
    
    1. that an error occured.  In their case, the error is an overflow of
       the pool, i.e. the correct response from the caller would be to
       stop trying to fill the pool.
    2. that there isn't enought entropy acquired yet, i.e. the correct
       response from the caller would be to try and add more entropy to
       the pool.
    
    Because of this ambiguity, the returned zero turns out to be useless.
    This change makes the returned value more consistent.  1 means the
    addition of new entropy was successful, 0 means it wasn't.  To know if
    the pool has been filled enough, the caller will have to call some
    other function, such as rand_pool_entropy_available().
    
    Fixes #5846
    Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
    (Merged from https://github.com/openssl/openssl/pull/5876)
    8e2bec9b
rand_lib.c 21.8 KB