detunized / lastpass-ruby

LastPass Ruby API
MIT License
70 stars 19 forks source link

OpenSSL::PKey::RSA#n= is deprecated because of OpenSSL 1.1.0 changes #13

Closed ansd closed 5 years ago

ansd commented 5 years ago

Do the same as in https://github.com/nov/json-jwt/commit/aa09a07e4b3939d7a9025ba9db97a861dc0c0817.

Before this change, bundle exec rake spec fails for ruby versions >= 2.4.0 with the following error:

Failures:

  1) LastPass::Parser.parse_private_key parses private key
     Failure/Error: rsa_key.n = asn1_encoded_key.value[1].value

     NoMethodError:
       undefined method `n=' for #<OpenSSL::PKey::RSA:0x007fe089380948>
       Did you mean?  n
     # ./lib/lastpass/parser.rb:103:in `parse_private_key'
     # ./spec/parser_spec.rb:119:in `block (3 levels) in <top (required)>'
     # ./spec/parser_spec.rb:123:in `block (3 levels) in <top (required)>'

After this change, the specs succeed.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.03%) to 94.83% when pulling 5b71c3fe7e9a8f3aceedf46efa94decbaeb27153 on ansd:master into 3212ff17c7dd370807f688a3875a6f21b44dcb2a on detunized:master.