Commit Graph

8 Commits

Author SHA1 Message Date
gotoyuzo 0d23cc25c2 * ext/openssl/ossl_pkey_dh.c (ossl_create_dh): fix typo.
patch from IWATSUKI Hiroyuki. [ruby-dev:25867]

* ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto.
  (ossl_call_tmp_dh_callback): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-12 17:15:29 +00:00
gotoyuzo 5505449793 * 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
2005-03-09 10:45:42 +00:00
gotoyuzo 17cb00b6e5 * 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
2004-06-21 16:36:19 +00:00
gotoyuzo 54d29aaba9 * ext/openssl/ossl_pkey.c (ossl_pkey_to_der): removed; it returns
public key only.

* ext/openssl/ossl_pkey_dh.c (ossl_dh_to_der): new function for
  OpenSSL::PKey::DH#to_der.

* ext/openssl/ossl_pkey_dsa.c (ossl_dsa_to_der): new function for
  OpenSSL::PKey::DSA#to_der.

* ext/openssl/ossl_pkey_rsa.c (ossl_rsa_to_der): new function for
  OpenSSL::PKey::RSA#to_der.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-08 12:24:22 +00:00
gotoyuzo d77b606edd * 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
2003-10-02 08:47:11 +00:00
gotoyuzo 30103702c3 * ext/openssl: all files are reviewed to simplify and avoid memory leak.
* ext/openssl/extconf.rb: add check for assert.h.

* ext/openssl/ossl.c (ossl_buf2str): new function to convert
  C buffer to String and free buffer.

* ext/openssl/ossl.c (ossl_x509_ary2sk): new function to convert
  Array of OpenSSL::X509 to STACK_OF(X509) with exception safe.

* ext/openssl/ossl.c (ossl_to_der, ossl_to_der_if_possible): new
  functions to convert object to DER string.

* ext/openssl/ossl.h: ditto.

* ext/openssl/ossl_bio.c (ossl_membio2str): new function to convert
  BIO to String object and free BIO.

* ext/openssl/ossl_bio.h: ditto.

* ext/openssl/ossl_pkcs7.c (ossl_pkcs7_to_der): add for "to_der".

* ext/openssl/ossl_x509name.c (ossl_x509name_to_der): ditto.

* ext/openssl/ossl_x509ext.c (ossl_x509ext_to_der): ditto.

* ext/openssl/ossl_x509ext.c (create_ext_from_array): removed
  and reimplement in openssl/x509.rb.

* ext/openssl/ossl_x509attr.c: reimplemented and disable some
  method temporarily. this class doesn't work fine without ASN.1
  data support;-) I'll rewrite in near future.

* ext/openssl/lib/openssl/x509.c (X509::Attribute): get rid off
  unused code.

* ext/openssl/lib/openssl/x509.c (X509::ExtensionFactory): refine all.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-17 09:05:02 +00:00
michal bd96b4c8cc OpenSSL update
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-12 13:46:48 +00:00
gotoyuzo 231247c010 * ext/openssl: imported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-23 16:12:24 +00:00