static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength)
{
    BIGNUM *bn = NULL;
    static RSA *rsa_tmp = NULL;
    if (!rsa_tmp && ((bn = BN_new()) == NULL))
        BIO_printf(bio_err, "Allocation error in generating RSA key\n");
    if (!rsa_tmp && bn) {
        if (!s_quiet) {
            BIO_printf(bio_err, "Generating temp (%d bit) RSA key...",
                       keylength);
            (void)BIO_flush(bio_err);
        }
        if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) ||
            !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) {
            RSA_free(rsa_tmp);
            rsa_tmp = NULL;
        }
        if (!s_quiet) {
            BIO_printf(bio_err, "\n");
            (void)BIO_flush(bio_err);
        }
        BN_free(bn);
    }
    return (rsa_tmp);
}
['static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength)\n{\n    BIGNUM *bn = NULL;\n    static RSA *rsa_tmp = NULL;\n    if (!rsa_tmp && ((bn = BN_new()) == NULL))\n        BIO_printf(bio_err, "Allocation error in generating RSA key\\n");\n    if (!rsa_tmp && bn) {\n        if (!s_quiet) {\n            BIO_printf(bio_err, "Generating temp (%d bit) RSA key...",\n                       keylength);\n            (void)BIO_flush(bio_err);\n        }\n        if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) ||\n            !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) {\n            RSA_free(rsa_tmp);\n            rsa_tmp = NULL;\n        }\n        if (!s_quiet) {\n            BIO_printf(bio_err, "\\n");\n            (void)BIO_flush(bio_err);\n        }\n        BN_free(bn);\n    }\n    return (rsa_tmp);\n}', 'int BN_set_word(BIGNUM *a, BN_ULONG w)\n{\n    bn_check_top(a);\n    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)\n        return (0);\n    a->neg = 0;\n    a->d[0] = w;\n    a->top = (w ? 1 : 0);\n    bn_check_top(a);\n    return (1);\n}', 'RSA *RSA_new(void)\n{\n    RSA *r = RSA_new_method(NULL);\n    return r;\n}']