Don't use RAND_pseudo_bytes for key generation. Instead loop until RAND_bytes succeeds.