From 55054497934bb9759aa400ef47042f33b34d0b9a Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Wed, 9 Mar 2005 10:45:42 +0000 Subject: * ext/openssl/ossl_ssl.c: OpenSSL::SSL::SSLContexts suports callbacks: - SSLContext#client_cert_cb is a Proc. it is called when a client certificate is requested by a server and no certificate was yet set for the SSLContext. it must return an Array which includes OpenSSL::X509::Certificate and OpenSSL::PKey::RSA/DSA objects. - SSLContext#tmp_dh_callback is called in key exchange with DH algorithm. it must return an OpenSSL::PKey::DH object. * ext/openssl/ossl_ssl.c: (ossl_sslctx_set_ciphers): ignore the argument if it's nil. (ossl_start_ssl, ossl_ssl_write): call rb_sys_fail if errno isn't 0. [ruby-dev:25831] * ext/openssl/ossl_pkey.c (GetPrivPKeyPtr, ossl_pkey_sign): should call rb_funcall first. (DupPrivPKeyPtr): new function. * ext/openssl/ossl_pkey_dh.c: add default DH parameters. * ext/openssl/ossl_pkey.h: ditto. * ext/openssl/lib/openssl/cipher.rb: fix typo. [ruby-dev:24285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_pkey.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/openssl/ossl_pkey.h') diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h index 189573546e..db4d3cf19d 100644 --- a/ext/openssl/ossl_pkey.h +++ b/ext/openssl/ossl_pkey.h @@ -38,7 +38,7 @@ void ossl_generate_cb(int, int, void *); VALUE ossl_pkey_new(EVP_PKEY *); VALUE ossl_pkey_new_from_file(VALUE); EVP_PKEY *GetPKeyPtr(VALUE); -/*EVP_PKEY *DupPKeyPtr(VALUE);*/ +EVP_PKEY *DupPKeyPtr(VALUE); EVP_PKEY *GetPrivPKeyPtr(VALUE); EVP_PKEY *DupPrivPKeyPtr(VALUE); void Init_ossl_pkey(void); @@ -66,6 +66,8 @@ void Init_ossl_dsa(void); */ extern VALUE cDH; extern VALUE eDHError; +extern DH *OSSL_DEFAULT_DH_512; +extern DH *OSSL_DEFAULT_DH_1024; VALUE ossl_dh_new(EVP_PKEY *); void Init_ossl_dh(void); @@ -104,10 +106,10 @@ static VALUE ossl_##keytype##_set_##name(VALUE self, VALUE bignum) \ return bignum; \ } -#define DEF_OSSL_PKEY_BN(class, keytype, name) \ -do { \ +#define DEF_OSSL_PKEY_BN(class, keytype, name) \ +do { \ rb_define_method(class, #name, ossl_##keytype##_get_##name, 0); \ - rb_define_method(class, #name "=", ossl_##keytype##_set_##name, 1); \ + rb_define_method(class, #name "=", ossl_##keytype##_set_##name, 1);\ } while (0) #endif /* _OSSL_PKEY_H_ */ -- cgit v1.2.3