Check return value of RSA_generate_key_ex().