Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supporting private keys other than RSA #148

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

no6v
Copy link
Contributor

@no6v no6v commented Dec 22, 2022

It is enough to use OpenSSL::PKey.read to handle private keys.
In the case of key or passphrase is invalid, the exception class and the message are changed.
Is this acceptable? Anyway, we should not use File.open without #close (or block) too read a key.

@njh njh closed this Feb 16, 2023
@njh njh reopened this Feb 16, 2023
@no6v
Copy link
Contributor Author

no6v commented Feb 16, 2023

I found that each failing check is caused by the following change:
ruby/openssl@6c09fd3

The simple way to pass a spec is to not specify an exception class.

By the way, is there any plan to drop supporing old versions of ruby?
As you may know, even 2.7 is in security maintainance phase, 2.6 and previous versions have reached an EOL.

@njh
Copy link
Owner

njh commented Feb 17, 2023

By the way, is there any plan to drop supporing old versions of ruby? As you may know, even 2.7 is in security maintainance phase, 2.6 and previous versions have reached an EOL.

Yes, plan is to drop support for some older versions of ruby.
However there are Long Term Support OSes that have old versions of ruby in them (Ubuntu LTS, Red Hat Enterprise Linux). For examples Ubuntu 18 LTS - Bionic Beaver has ruby 2.5.1). And Ubuntu 14 Trusty Tahr doesn't reach EOL until April 2024.

Need to work out which to support in the next release.

@njh
Copy link
Owner

njh commented Feb 17, 2023

Just checked and Redhat Enterprise Linux 7 comes with Ruby version 2.0.0.648-39.el7_9.
Amazingly RHEL7 has maintenance support until 30 June 2024 and Extended
Lifecycle Support until 30 June 2026.

@no6v no6v force-pushed the supporting-pkey-other-than-rsa branch from 8b58063 to 3ca6cea Compare February 21, 2023 10:08
@no6v
Copy link
Contributor Author

no6v commented Feb 21, 2023

Thanks for your informations! I omitted the exception class on the spec.

@njh
Copy link
Owner

njh commented Mar 3, 2023

Would it be possible to add an example key into /spec/fixtures, so that it is possible to test that this works?

* also fixes `File` leakage in `MQTT::Client#key_file=`

Fixes njh#147
@no6v no6v force-pushed the supporting-pkey-other-than-rsa branch from 3ca6cea to bdc9400 Compare April 6, 2023 10:13
@no6v
Copy link
Contributor Author

no6v commented Apr 6, 2023

I'm sorry, I'm late. I prepared the EC keys with and without password encrypted, and added the specs for those EC keys (almostly copied from the specs for RSA keys :).

@njh njh merged commit 52ef5ff into njh:main Apr 2, 2024
@njh
Copy link
Owner

njh commented Apr 2, 2024

Thank you very much for updating this PR to include some tests.
Sorry to not merge it for so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants