Skip to content

Make ALL cipher string match ECDHE ciphers #91

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

Merged
merged 2 commits into from
May 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/jruby/ext/openssl/CipherStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ private static Collection<Def> matchingPattern(
static {
Definitions = new HashMap<String, Def>( 48, 1 );
// TODO review base on OpenSSL's static const SSL_CIPHER cipher_aliases[] ?!
Definitions.put(SSL_TXT_ALL,new Def(0,SSL_TXT_ALL, 0,SSL_ALL & ~SSL_eNULL & ~SSL_kECDH & ~SSL_kECDHE, SSL_ALL ,0,0,0,SSL_ALL,SSL_ALL));
Definitions.put(SSL_TXT_ALL,new Def(0,SSL_TXT_ALL, 0,SSL_ALL & ~SSL_eNULL, SSL_ALL ,0,0,0,SSL_ALL,SSL_ALL));
Definitions.put(SSL_TXT_CMPALL,new Def(0,SSL_TXT_CMPALL,0,SSL_eNULL,0,0,0,0,SSL_ENC_MASK,0));
Definitions.put(SSL_TXT_CMPDEF,new Def(0,SSL_TXT_CMPDEF,0,SSL_ADH, 0,0,0,0,SSL_AUTH_MASK,0));
Definitions.put(SSL_TXT_kKRB5,new Def(0,SSL_TXT_kKRB5,0,SSL_kKRB5,0,0,0,0,SSL_MKEY_MASK,0));
Expand Down
44 changes: 43 additions & 1 deletion src/test/ruby/ssl/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,46 @@ def test_context_set_ssl_version
assert_raises(TypeError) { context.ssl_version = 12 }
end

end
def test_context_ciphers
context = OpenSSL::SSL::SSLContext.new
context.ciphers = "ALL"

all_ciphers = context.ciphers.map{|cipher_array| cipher_array[0]}

expected_ciphers = ["ECDHE-ECDSA-AES256-SHA",
"ECDHE-RSA-AES256-SHA",
"AES256-SHA",
"ECDH-ECDSA-AES256-SHA",
"ECDH-RSA-AES256-SHA",
"DHE-RSA-AES256-SHA",
"DHE-DSS-AES256-SHA",
"ECDHE-ECDSA-AES128-SHA256",
"ECDHE-RSA-AES128-SHA256",
"ECDH-ECDSA-AES128-SHA256",
"ECDH-RSA-AES128-SHA256",
"ECDHE-ECDSA-AES128-SHA",
"ECDHE-RSA-AES128-SHA",
"AES128-SHA",
"ECDH-ECDSA-AES128-SHA",
"ECDH-RSA-AES128-SHA",
"DHE-RSA-AES128-SHA",
"DHE-DSS-AES128-SHA",
"ECDHE-ECDSA-DES-CBC3-SHA",
"ECDHE-RSA-DES-CBC3-SHA",
"DES-CBC3-SHA",
"ECDH-ECDSA-DES-CBC3-SHA",
"ECDH-RSA-DES-CBC3-SHA",
"EDH-RSA-DES-CBC3-SHA",
"EDH-DSS-DES-CBC3-SHA",
"AECDH-AES256-SHA",
"ADH-AES256-SHA",
"AECDH-AES128-SHA",
"ADH-AES128-SHA",
"AECDH-DES-CBC3-SHA",
"ADH-DES-CBC3-SHA"]

expected_ciphers.each do |cipher|
assert all_ciphers.include?(cipher), "#{cipher} should have been included"
end
end if RUBY_VERSION > '1.9'
end