Fix Vagrant::Util::Keypair::Rsa.create
Use of a broken or weak cryptographic algorithm
#13708
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix the problem, replace the use of the weak
des3
cipher with a strong, modern cipher such asaes-256-cbc
when encrypting the private key. This involves changing the argument toOpenSSL::Cipher.new
from'des3'
to'aes-256-cbc'
on line 147. No other changes are required, as OpenSSL supports this cipher natively and the rest of the code does not depend on the specific cipher used. This change is limited to thelib/vagrant/util/keypair.rb
file, specifically within theVagrant::Util::Keypair::Rsa.create
method.References
NIST, FIPS 140 Annex a: Approved Security Functions
NIST, SP 800-131A: Transitions: Recommendation for Transitioning the Use of Cryptographic Algorithms and Key Lengths
OWASP: Rule - Use strong approved cryptographic algorithms