Project

General

Profile

Actions

Bug #5951

closed

Exported RSA keys allow pass phrases that are too short

Added by drbrain (Eric Hodel) about 12 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0dev (2011-12-20 trunk 34073) [x86_64-darwin11.2.0]
Backport:
[ruby-core:42281]

Description

=begin

Exporting a key with this code:

cipher = OpenSSL::Cipher::Cipher.new 'AES-128-CBC'
pass_phrase = 'woo'

key_secure = key.export cipher, pass_phrase

open 'private.secure.pem', 'w' do |io|
io.write key_secure
end

Is not loadable:

$ ruby20 -v -ropenssl -e 'OpenSSL::PKey::RSA.new File.read "private.secure.pem"'
ruby 2.0.0dev (2011-12-20 trunk 34073) [x86_64-darwin11.2.0]
Enter PEM pass phrase: # I typed woo
phrase is too short, needs to be at least 4 chars

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0