epics icon indicating copy to clipboard operation
epics copied to clipboard

Handling of old keys with `"#USER": {},` raises error

Open leezu opened this issue 4 years ago • 0 comments

Hi railslove team,

I have an ebics key created a couple of years ago with epics. It contains an "#USER": {}, which confuses the current version of epics. Running Epics::Client.new will trigger

NoMethodError: undefined method `unpack1' for {}:Hash
/usr/lib64/ruby/2.6.0/base64.rb:74:in `strict_decode64'
/home/leonard/.gem/ruby/2.6.0/gems/epics-1.8.1/lib/epics/client.rb:280:in `decrypt'
/home/leonard/.gem/ruby/2.6.0/gems/epics-1.8.1/lib/epics/client.rb:260:in `block in extract_keys'
/home/leonard/.gem/ruby/2.6.0/gems/epics-1.8.1/lib/epics/client.rb:259:in `each'
/home/leonard/.gem/ruby/2.6.0/gems/epics-1.8.1/lib/epics/client.rb:259:in `each_with_object'
/home/leonard/.gem/ruby/2.6.0/gems/epics-1.8.1/lib/epics/client.rb:259:in `extract_keys'
/home/leonard/.gem/ruby/2.6.0/gems/epics-1.8.1/lib/epics/client.rb:12:in `initialize'

Deleting the "#USER": {}, field in the key file avoids the error.

leezu avatar Oct 09 '20 03:10 leezu