diff options
author | michal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-12 13:46:48 +0000 |
---|---|---|
committer | michal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-12 13:46:48 +0000 |
commit | 735834aab3644f158dc6861a11c6ac7ac4c64459 (patch) | |
tree | 7585c4dabc044459b4cfb92230bdff20fb882087 /ext/openssl/ossl_pkey_dh.c | |
parent | 6518ae70252bf7beea8061d47735a4ab3397b066 (diff) | |
download | ruby-735834aab3644f158dc6861a11c6ac7ac4c64459.tar.gz ruby-735834aab3644f158dc6861a11c6ac7ac4c64459.tar.xz ruby-735834aab3644f158dc6861a11c6ac7ac4c64459.zip |
OpenSSL update
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_dh.c')
-rw-r--r-- | ext/openssl/ossl_pkey_dh.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c index 9a6bec15e..84eff16f4 100644 --- a/ext/openssl/ossl_pkey_dh.c +++ b/ext/openssl/ossl_pkey_dh.c @@ -74,34 +74,16 @@ ossl_dh_new(EVP_PKEY *pkey) /* * Private */ -/* - * CB for yielding when generating DH params - */ -static void -ossl_dh_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 DH * dh_generate(int size, int gen) { DH *dh; - void (*cb)(int, int, void *) = NULL; + + dh = DH_generate_parameters(size, gen, + rb_block_given_p() ? ossl_generate_cb : NULL, + NULL); + if (!dh) return 0; - if (rb_block_given_p()) { - cb = ossl_dh_generate_cb; - } - /* arg to cb = NULL */ - if (!(dh = DH_generate_parameters(size, gen, cb, NULL))) { - return 0; - } if (!DH_generate_key(dh)) { DH_free(dh); return 0; |