summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-29 06:49:11 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-29 06:49:11 +0000
commitd097999e44e3f8016a490aa7f231685654060be4 (patch)
tree74fd91ad5e65b85f3666f07681d4f7025a541ea9 /sample
parentcc002887e3a40446ce42f6e4082361a1d09ec1fb (diff)
backport from Ruby-1.9.
* ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change second argument. it expected to be a Hash not an Integer. * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new function for OpenSSL::X509::Name#add_entry. * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): append ASN.1 tag number to each element of return value. * ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE. * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize): second argument takes OBJECT_TYPE_TEMPLATE by default. * sample/openssl/gen_csr.rb: use OpenSSL::X509::Name.parse. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/openssl/gen_csr.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/sample/openssl/gen_csr.rb b/sample/openssl/gen_csr.rb
index 5d6a654..3daf5ee 100644
--- a/sample/openssl/gen_csr.rb
+++ b/sample/openssl/gen_csr.rb
@@ -19,13 +19,9 @@ keypair_file = $OPT_key
csrout = $OPT_csrout || "csr.pem"
keyout = $OPT_keyout || "keypair.pem"
-name_str = ARGV.shift or usage()
-
$stdout.sync = true
-
-name_ary = name_str.scan(/\s*([^\/,]+)\s*/).collect { |i| i[0].split("=") }
-p name_ary
-name = X509::Name.new(name_ary, OpenSSL::ASN1::PRINTABLESTRING)
+name_str = ARGV.shift or usage()
+name = X509::Name.parse(name_str)
keypair = nil
if keypair_file