summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkey_dsa.c
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-02 08:47:11 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-02 08:47:11 +0000
commitd77b606edd788a52e40b27838c6b1b588c1f33cd (patch)
treea68fcc343756e8e9b1473836e6da7d4579f72718 /ext/openssl/ossl_pkey_dsa.c
parent10c4bb29b237ccdbf99cfe8ef44c81de5a4a9018 (diff)
* 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.c11
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);