Project

General

Profile

Bug #12381

ext/openssl classes' dup/clone don't work well

Added by rhenium (Kazuki Yamaguchi) about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
openssl
Target version:
-
[ruby-core:75504]

Description

They don't copy the underlying C level structures.

ssl_ctx = OpenSSL::SSL::SSLContext.new
ssl_ctx.ciphers = "aNULL"
p ssl_ctx.ciphers
# => [["ADH-AES256-GCM-SHA384", "TLSv1.2", 256, 256], .. aNULL cipher suites ..]

new_ctx = ssl_ctx.dup
p new_ctx.ciphers
# => [["ECDHE-ECDSA-AES256-GCM-SHA384", "TLSv1.2", 256, 256], .. the default cipher suites ..]

Files

0001-Implement-missing-initialize_copy.patch (16.2 KB) 0001-Implement-missing-initialize_copy.patch rhenium (Kazuki Yamaguchi), 08/04/2016 01:55 PM

Associated revisions

Revision be1baf4a
Added by rhe almost 3 years ago

openssl: implement initialize_copy method for PKey classes

  • ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
    ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
    initialize_copy method for OpenSSL::PKey::*.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
    test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
    actually copy the OpenSSL objects, and modifications to cloned object
    don't affect the original object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55454
Added by rhenium (Kazuki Yamaguchi) almost 3 years ago

openssl: implement initialize_copy method for PKey classes

  • ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
    ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
    initialize_copy method for OpenSSL::PKey::*.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
    test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
    actually copy the OpenSSL objects, and modifications to cloned object
    don't affect the original object.

Revision 55454
Added by rhe almost 3 years ago

openssl: implement initialize_copy method for PKey classes

  • ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
    ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
    initialize_copy method for OpenSSL::PKey::*.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
    test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
    actually copy the OpenSSL objects, and modifications to cloned object
    don't affect the original object.

Revision 55454
Added by rhe almost 3 years ago

openssl: implement initialize_copy method for PKey classes

  • ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
    ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
    initialize_copy method for OpenSSL::PKey::*.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
    test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
    actually copy the OpenSSL objects, and modifications to cloned object
    don't affect the original object.

Revision 55454
Added by rhe almost 3 years ago

openssl: implement initialize_copy method for PKey classes

  • ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
    ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
    initialize_copy method for OpenSSL::PKey::*.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
    test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
    actually copy the OpenSSL objects, and modifications to cloned object
    don't affect the original object.

Revision f31f1f1a
Added by rhe almost 3 years ago

openssl: implement initialize_copy for OpenSSL::OCSP::*

  • ext/openssl/ossl_ocsp.c: Implement OCSP::{CertificateId,Request,
    BasicResponse,Response}#initialize_copy.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_ocsp.rb: Test them.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55455
Added by rhenium (Kazuki Yamaguchi) almost 3 years ago

openssl: implement initialize_copy for OpenSSL::OCSP::*

  • ext/openssl/ossl_ocsp.c: Implement OCSP::{CertificateId,Request,
    BasicResponse,Response}#initialize_copy.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_ocsp.rb: Test them.

Revision 55455
Added by rhe almost 3 years ago

openssl: implement initialize_copy for OpenSSL::OCSP::*

  • ext/openssl/ossl_ocsp.c: Implement OCSP::{CertificateId,Request,
    BasicResponse,Response}#initialize_copy.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_ocsp.rb: Test them.

Revision 55455
Added by rhe almost 3 years ago

openssl: implement initialize_copy for OpenSSL::OCSP::*

  • ext/openssl/ossl_ocsp.c: Implement OCSP::{CertificateId,Request,
    BasicResponse,Response}#initialize_copy.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_ocsp.rb: Test them.

Revision 55455
Added by rhe almost 3 years ago

openssl: implement initialize_copy for OpenSSL::OCSP::*

  • ext/openssl/ossl_ocsp.c: Implement OCSP::{CertificateId,Request,
    BasicResponse,Response}#initialize_copy.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_ocsp.rb: Test them.

History

#1

Updated by Anonymous almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset r55454.


openssl: implement initialize_copy method for PKey classes

  • ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
    ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
    initialize_copy method for OpenSSL::PKey::*.
    [ruby-core:75504] [Bug #12381]

  • test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
    test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
    actually copy the OpenSSL objects, and modifications to cloned object
    don't affect the original object.

Updated by usa (Usaku NAKAMURA) almost 3 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED

Updated by Tietew (Toru Iwase) almost 3 years ago

SSLContext#dup is not fixed yet?

$ RBENV_VERSION=2.4.0-dev ruby -v -ropenssl -e 'c = OpenSSL::SSL::SSLContext.new; c.ciphers = "aNULL"; p c.ciphers == c.dup.ciphers'
ruby 2.4.0dev (2016-08-03 trunk 55810) [x86_64-linux]
false

Updated by rhenium (Kazuki Yamaguchi) almost 3 years ago

Thanks for reminding me.

I've just fixed the remaining at ruby/openssl (GitHub):

https://github.com/ruby/openssl/commit/6dc9b914cae52c8af6e1b4d1156613bcd914eaf5

Attached is the patch against 2.3 branch.

Also available in: Atom PDF