0001-openssl-add-OP_NO_COMPRESSION-constant.patch

Eric Wong, 08/11/2011 05:52 AM

Download (3.29 KB)

View differences:

ext/openssl/ossl_ssl.c
1997 1997
#if defined(SSL_OP_NO_TICKET)
1998 1998
    ossl_ssl_def_const(OP_NO_TICKET);
1999 1999
#endif
2000
#if defined(SSL_OP_NO_COMPRESSION)
2001
    ossl_ssl_def_const(OP_NO_COMPRESSION);
2002
#endif
2000 2003
    ossl_ssl_def_const(OP_PKCS1_CHECK_1);
2001 2004
    ossl_ssl_def_const(OP_PKCS1_CHECK_2);
2002 2005
    ossl_ssl_def_const(OP_NETSCAPE_CA_DN_BUG);
test/openssl/test_ssl.rb
9 9
    assert_equal(ctx.setup, nil)
10 10
  end
11 11

  
12
  def test_ctx_setup_no_compression
13
    ctx = OpenSSL::SSL::SSLContext.new
14
    ctx.options = OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_COMPRESSION
15
    assert_equal(ctx.setup, true)
16
    assert_equal(ctx.setup, nil)
17
    assert_equal(OpenSSL::SSL::OP_NO_COMPRESSION,
18
                 ctx.options & OpenSSL::SSL::OP_NO_COMPRESSION)
19
  end if defined?(OpenSSL::SSL::OP_NO_COMPRESSION)
20

  
12 21
  def test_not_started_session
13 22
    skip "non socket argument of SSLSocket.new is not supported on this platform" if /mswin|mingw/ =~ RUBY_PLATFORM
14 23
    open(__FILE__) do |f|