Project

General

Profile

Bug #6094 ยป openssl.diff

nobu (Nobuyoshi Nakada), 02/27/2012 05:50 PM

View differences:

w/ext/openssl/ossl_pkey_rsa.c
95 95
#endif
96 96

  
97 97
static RSA *
98
rsa_generate(int size, int exp)
98
rsa_generate(int size, unsigned long exp)
99 99
{
100 100
#if defined(HAVE_RSA_GENERATE_KEY_EX) && HAVE_BN_GENCB
101 101
    int i;
......
168 168

  
169 169
    rb_scan_args(argc, argv, "11", &size, &exp);
170 170

  
171
    rsa = rsa_generate(NUM2INT(size), NIL_P(exp) ? RSA_F4 : NUM2INT(exp)); /* err handled by rsa_instance */
171
    rsa = rsa_generate(NUM2INT(size), NIL_P(exp) ? RSA_F4 : NUM2ULONG(exp)); /* err handled by rsa_instance */
172 172
    obj = rsa_instance(klass, rsa);
173 173

  
174 174
    if (obj == Qfalse) {
......
213 213
	rsa = RSA_new();
214 214
    }
215 215
    else if (FIXNUM_P(arg)) {
216
	rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2INT(pass));
216
	rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2ULONG(pass));
217 217
	if (!rsa) ossl_raise(eRSAError, NULL);
218 218
    }
219 219
    else {