Skip to content

Commit 3f07a81

Browse files
committed
security.rb: Reorder case branches in create_key to match help text
The following help text and error message in lib/rubygems/security.rb show that the order of algorithms is RSA, DSA, EC. Align the case branches in create_key with this order. ``` -A, --key-algorithm ALGORITHM Select key algorithm for --build from RSA, DSA, or EC. Defaults to RSA. ``` ``` "#{algorithm} algorithm not found. RSA, DSA, and EC algorithms are supported." ``` Assisted-by: Claude:Opus 4.6
1 parent fb54bfe commit 3f07a81

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/rubygems/security.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,10 @@ def self.create_digest(algorithm = DIGEST_NAME)
470470
def self.create_key(algorithm)
471471
if defined?(OpenSSL::PKey)
472472
case algorithm.downcase
473-
when "dsa"
474-
OpenSSL::PKey::DSA.new(RSA_DSA_KEY_LENGTH)
475473
when "rsa"
476474
OpenSSL::PKey::RSA.new(RSA_DSA_KEY_LENGTH)
475+
when "dsa"
476+
OpenSSL::PKey::DSA.new(RSA_DSA_KEY_LENGTH)
477477
when "ec"
478478
OpenSSL::PKey::EC.generate(EC_NAME)
479479
else

0 commit comments

Comments
 (0)