fixed: check when RAND_bytes returns 0
RAND_bytes returns 0 when there was not enough entropy