source: packages/lang/ruby/patches/0001-Add-option-which-enable-SSLv2-support.patch @ 26599

Last change on this file since 26599 was 26599, checked in by jow, 6 years ago

[packages] ruby: fix compilation against OpenSSL v1.0.0, thanks russell

File size: 1.7 KB
  • ext/openssl/extconf.rb

    From b983e73adf7a7d3fd07fdf493eee51c22881a6e6 Mon Sep 17 00:00:00 2001
    From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
    Date: Wed, 6 Apr 2011 02:28:09 +0900
    Subject: [PATCH] Add option which enable SSLv2 support
    
    From openssl 1.0, SSLv2 becomes disable by default.
    If you want to use SSLv2 in ruby, you need config with --enable-opensslv2.
    The SSLv2 support is disable by default.
    
    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
    ---
     ext/openssl/extconf.rb |    8 ++++++++
     ext/openssl/ossl_ssl.c |    2 ++
     2 files changed, 10 insertions(+), 0 deletions(-)
    
    diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
    index b1f2d88..89c6f19 100644
    a b if with_config("debug") or enable_config("debug") 
    3333  end 
    3434end 
    3535 
     36##  
     37## From openssl 1.0, SSLv2 becomes disable by default. 
     38## If you want to use SSLv2 in ruby, you need config with --enable-opensslv2. 
     39## 
     40if enable_config("opensslv2") 
     41  $defs << "-DENABLE_OPENSSLV2" 
     42end 
     43 
    3644message "=== Checking for system dependent stuff... ===\n" 
    3745have_library("nsl", "t_open") 
    3846have_library("socket", "socket") 
  • ext/openssl/ossl_ssl.c

    diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
    index d8951fb..d0c9059 100644
    a b struct { 
    107107    OSSL_SSL_METHOD_ENTRY(TLSv1), 
    108108    OSSL_SSL_METHOD_ENTRY(TLSv1_server), 
    109109    OSSL_SSL_METHOD_ENTRY(TLSv1_client), 
     110#if defined(ENABLE_OPENSSLV2) 
    110111    OSSL_SSL_METHOD_ENTRY(SSLv2), 
    111112    OSSL_SSL_METHOD_ENTRY(SSLv2_server), 
    112113    OSSL_SSL_METHOD_ENTRY(SSLv2_client), 
     114#endif 
    113115    OSSL_SSL_METHOD_ENTRY(SSLv3), 
    114116    OSSL_SSL_METHOD_ENTRY(SSLv3_server), 
    115117    OSSL_SSL_METHOD_ENTRY(SSLv3_client), 
Note: See TracBrowser for help on using the repository browser.