diff options
author | gotoyuzo <gotoyuzo@ruby-lang.org> | 2003-10-02 08:47:11 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@ruby-lang.org> | 2003-10-02 08:47:11 +0000 |
commit | 90682ffa53b11dc2fb0fba8981e1f3c53681a204 (patch) | |
tree | b858003f63b444a9c6846b8caa5c231b2cea0723 /ext/openssl/ossl_pkey_dsa.c | |
parent | d7506d4e5ffcdae6d75456d182a26e250a43f20e (diff) | |
download | ruby-openssl-history-90682ffa53b11dc2fb0fba8981e1f3c53681a204.tar.gz |
* ext/openssl/ossl_engine.c: add a new module OpenSSL::Engine.
it supports OpenSSL hardware cryptographic engine interface.
* ext/openssl/ossl_engine.h: ditto.
* ext/openssl/MANIFEST: add ossl_engine.c and ossl_engine.h.
* ext/openssl/extconf.rb: add check for openssl/engine.h.
* ext/openssl/ossl.c: call Init_ossl_engine().
* ext/openssl/ossl.h: include openssl/engine.h.
* ext/openssl/ossl_pkey_{rsa,dsa,dh}.c: check if underlying
EVP_PKEY referes engine.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_dsa.c')
-rw-r--r-- | ext/openssl/ossl_pkey_dsa.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c index e20d155..8da71a0 100644 --- a/ext/openssl/ossl_pkey_dsa.c +++ b/ext/openssl/ossl_pkey_dsa.c @@ -19,7 +19,14 @@ } \ } while (0) -#define DSA_PRIVATE(dsa) ((dsa)->priv_key) +#define DSA_HAS_PRIVATE(dsa) ((dsa)->priv_key) + +#ifdef OSSL_ENGINE_ENABLED +# define DSA_PRIVATE(dsa) (DSA_HAS_PRIVATE(dsa) || (dsa)->engine) +#else +# define DSA_PRIVATE(dsa) DSA_HAS_PRIVATE(dsa) +#endif + /* * Classes @@ -203,7 +210,7 @@ ossl_dsa_export(int argc, VALUE *argv, VALUE self) if (!(out = BIO_new(BIO_s_mem()))) { ossl_raise(eDSAError, NULL); } - if (DSA_PRIVATE(pkey->pkey.dsa)) { + if (DSA_HAS_PRIVATE(pkey->pkey.dsa)) { if (!PEM_write_bio_DSAPrivateKey(out, pkey->pkey.dsa, ciph, NULL, 0, ossl_pem_passwd_cb, passwd)){ BIO_free(out); |