cchandler / certificate_authority

Ruby gem for managing the core functions outlined in RFC-3280 for PKI
https://github.com/cchandler/certificate_authority
194 stars 44 forks source link

LocalJumpError on sign! #3

Closed diogomonica closed 13 years ago

diogomonica commented 13 years ago

When I try to sign any certificate (even when following the steps given in the Readme), I keep getting the following LocalJumpError:

ree-1.8.7-2011.03 :008 > root.sign! LocalJumpError: unexpected return from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/certificate_authority-0.1.2/lib/certificate_authority/certificate.rb:24:in _callback_before_13' from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/certificate_authority-0.1.2/lib/certificate_authority/certificate.rb:23:ineach' from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/certificate_authority-0.1.2/lib/certificate_authority/certificate.rb:23:in _callback_before_13' from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:415:in_run_validate_callbacks' from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/activemodel-3.0.7/lib/active_model/validations.rb:212:in run_validations!' from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/activemodel-3.0.7/lib/active_model/validations.rb:179:invalid?' from /Users/diogo/.rvm/gems/ree-1.8.7-2011.03/gems/certificate_authority-0.1.2/lib/certificate_authority/certificate.rb:43:in `sign!' from (irb):8

I'm using ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.7.3], MBARI 0x6770, Ruby Enterprise Edition 2011.03, and the latest version of certificate_authority.

Is this a known issue?

cchandler commented 13 years ago

Nope, this isn't a known issue :-). Let me see if I can reproduce it. A quick cursory glance at the code makes me think REE doesn't like the return I'm using on line 24.

cchandler commented 13 years ago

OK, the issue should be patched. I released a new version of the gem (0.1.3) that should fix it. All specs pass locally for ree-1.8.7-2011.03. Let me know if it does something weird.

diogomonica commented 13 years ago

It worked. Thanks a lot.

Nice job with this gem btw. Every other way of generating certificates kind of sucks when compared to this.