From 87fc7b6f8e4989203bb961b1ad4842e259ae3589 Mon Sep 17 00:00:00 2001 From: michal Date: Fri, 12 Sep 2003 13:46:48 +0000 Subject: OpenSSL update git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_pkey_rsa.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'ext/openssl/ossl_pkey_rsa.c') diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c index c3d2366..ce53a89 100644 --- a/ext/openssl/ossl_pkey_rsa.c +++ b/ext/openssl/ossl_pkey_rsa.c @@ -75,30 +75,12 @@ ossl_rsa_new(EVP_PKEY *pkey) /* * Private */ -/* - * CB for yielding when generating RSA data - */ -static void -ossl_rsa_generate_cb(int p, int n, void *arg) -{ - VALUE ary; - - ary = rb_ary_new2(2); - rb_ary_store(ary, 0, INT2NUM(p)); - rb_ary_store(ary, 1, INT2NUM(n)); - - rb_yield(ary); -} - static RSA * rsa_generate(int size, int exp) { - void (*cb)(int, int, void *) = NULL; - - if (rb_block_given_p()) { - cb = ossl_rsa_generate_cb; - } - return RSA_generate_key(size, exp, cb, NULL); + return RSA_generate_key(size, exp, + rb_block_given_p() ? ossl_generate_cb : NULL, + NULL); } static VALUE -- cgit v1.2.3