From 5bd7899b98fc4fd9631d08423f5c2fb6918c783d Mon Sep 17 00:00:00 2001 From: emboss Date: Sun, 10 Jun 2012 01:23:21 +0000 Subject: * ext/openssl/ossl.c ext/openssl/ossl_pkey_rsa.c ext/openssl/ossl_pkey_dsa.c ext/openssl/ossl_pkey_ec.c: Forbid export passwords that are less than four characters long, as OpenSSL itself does not allow this. Issue found by Eric Hodel. * ext/openssl/ossl_pkey_ec.c: Add export as an alias of to_pem, following the PKey interface contract. * test/openssl/test_pkey_dsa.rb test/openssl/test_pkey_rsa.rb test/openssl/test_pkey_ec.rb: Add tests that assert correct behaviour when dealing with passwords that are less than four characters long. [ruby-core: 42281][ruby-trunk - Bug #5951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/openssl/ossl.h') diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h index 97095f7d6f..f8023bc8c6 100644 --- a/ext/openssl/ossl.h +++ b/ext/openssl/ossl.h @@ -74,6 +74,11 @@ extern "C" { # include #endif +/* OpenSSL requires passwords for PEM-encoded files to be at least four + * characters long + */ +#define OSSL_MIN_PWD_LEN 4 + /* * Common Module */ -- cgit v1.2.3