reidmorrison / symmetric-encryption

Symmetric Encryption for Ruby Projects using OpenSSL
https://logger.rocketjob.github.io/
Apache License 2.0
476 stars 92 forks source link

Fix key generation for development and test enviorement #74

Closed jonatasrancan closed 7 years ago

jonatasrancan commented 7 years ago

The same error that happened here https://github.com/rocketjob/symmetric-encryption/issues/72, happens for development and test enviorement.

Because when the config file got read, the keys: key and iv, which exists under the development and test keys, are loaded and passed to the Chiper.generate_random_keys, but they weren't removed, which causes the exception to be raised.

What I did, is do to delete the keys from the params, if the else happens. This way the generate keys will continue working even if you don't pass any arg.

reidmorrison commented 7 years ago

Cipher.generate_random_keys should probably output the keys according to the encoding rules in the config. I need more time later to research it further. Likely relates to https://github.com/rocketjob/symmetric-encryption/issues/71

reidmorrison commented 7 years ago

Excellent, Thank you :tada: