summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_rsa.c
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@ruby-lang.org>2004-06-21 16:36:19 +0000
committergotoyuzo <gotoyuzo@ruby-lang.org>2004-06-21 16:36:19 +0000
commit6bf538294146c0f4c3ec1951d0dd878f0449e7c6 (patch)
tree8869230ca8b43d542abc4c9c4d32d33630e2c8c0 /ext/openssl/ossl_pkey_rsa.c
parent696751d9ad0f3fe37e95e9c9057a50de72b4f507 (diff)
downloadruby-openssl-history-6bf538294146c0f4c3ec1951d0dd878f0449e7c6.tar.gz
* ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize): should create
empty pkey object if no argument is passed. [ruby-talk:103328] * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): ditto. * ext/openssl/ossl_pkey_dh.c: add new methods: OpenSSL::PKey::DH#p, OpenSSL::PKey::DH#p=, OpenSSL::PKey::DH#g, OpenSSL::PKey::DH#g=, OpenSSL::PKey::DH#pub_key, OpenSSL::PKey::DH#pub_key=, OpenSSL::PKey::DH#priv_key and OpenSSL::PKey::DH#priv_key=. * ext/openssl/ossl_pkey_dsa.c: add new methods: OpenSSL::PKey::DSA#p, OpenSSL::PKey::DSA#p=, OpenSSL::PKey::DSA#q, OpenSSL::PKey::DSA#q=, OpenSSL::PKey::DSA#g, OpenSSL::PKey::DSA#g=, OpenSSL::PKey::DSA#pub_key, OpenSSL::PKey::DSA#pub_key=, OpenSSL::PKey::DSA#priv_key and OpenSSL::PKey::DSA#priv_key=. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_rsa.c')
-rw-r--r--ext/openssl/ossl_pkey_rsa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 8a21354..f8b3ae1 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -119,8 +119,10 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
VALUE arg, pass;
GetPKey(self, pkey);
- rb_scan_args(argc, argv, "11", &arg, &pass);
- if (FIXNUM_P(arg)) {
+ if(rb_scan_args(argc, argv, "02", &arg, &pass) == 0) {
+ rsa = RSA_new();
+ }
+ else if (FIXNUM_P(arg)) {
rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2INT(pass));
if (!rsa) ossl_raise(eRSAError, NULL);
}