[ruby-cvs:62210] rhe:r55047 (trunk): openssl: fix equality test methods of OpenSSL::BN

rhe at ruby-lang.org rhe at ruby-lang.org
Wed May 18 11:55:46 JST 2016


rhe	2016-05-18 11:55:45 +0900 (Wed, 18 May 2016)

  New Revision: 55047

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55047

  Log:
    openssl: fix equality test methods of OpenSSL::BN
    
    * ext/openssl/ossl_bn.c (try_convert_to_bnptr): Extracted from
      GetBNPtr(). This doesn't raise exception but returns NULL on error.
      (GetBNPtr): Raise TypeError if conversion fails.
      (ossl_bn_eq): Implement BN#==.
      (ossl_bn_eql): #eql? should not raise TypeError even if the argument
      is not compatible with BN.
      (ossl_bn_hash): Implement BN#hash.
    
    * ext/openssl/ossl_bn.c (Init_ossl_bn): Define #== and #hash.
    
    * test/openssl/test_bn.rb: Test BN#eql?, #== and #hash

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/ossl_bn.c
    trunk/test/openssl/test_bn.rb


More information about the ruby-cvs mailing list