RAND_bytes's return values is 0 for an error, not -1.