aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Stowers <5009837+stowersjoshua@users.noreply.github.com>2019-12-13 16:56:42 -0600
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-12-14 12:11:59 +1300
commit3e48c7ac3dcb8318815577f22cf4e40820e85f43 (patch)
treec54c40ed5a836ada539747df2f7af71acfd7369a
parent62287bede47e34561279901758ff5a8195cc8a9d (diff)
downloadruby-openssl-3e48c7ac3dcb8318815577f22cf4e40820e85f43.tar.gz
Prepend slashes to X509::Name.parse argument in examples
Addresses [issue 15882](https://bugs.ruby-lang.org/issues/15882) with [Zach Rowe's patch.](https://bugs.ruby-lang.org/attachments/7810) The #parse_openssl method [expects a forward slash at the beginning of the argument](https://github.com/ruby/openssl/blob/master/lib/openssl/x509.rb#L302) if used as the delimiter.
-rw-r--r--ext/openssl/ossl.c4
-rw-r--r--ext/openssl/ossl_x509name.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index c8a2cef7..3fc31452 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -862,7 +862,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
* signature.
*
* key = OpenSSL::PKey::RSA.new 2048
- * name = OpenSSL::X509::Name.parse 'CN=nobody/DC=example'
+ * name = OpenSSL::X509::Name.parse '/CN=nobody/DC=example'
*
* cert = OpenSSL::X509::Certificate.new
* cert.version = 2
@@ -944,7 +944,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
* A CA certificate is created the same way we created a certificate above, but
* with different extensions.
*
- * ca_name = OpenSSL::X509::Name.parse 'CN=ca/DC=example'
+ * ca_name = OpenSSL::X509::Name.parse '/CN=ca/DC=example'
*
* ca_cert = OpenSSL::X509::Certificate.new
* ca_cert.serial = 0
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index f72b1ec0..1522c3d8 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -498,7 +498,7 @@ ossl_x509name_to_der(VALUE self)
* You can create a Name by parsing a distinguished name String or by
* supplying the distinguished name as an Array.
*
- * name = OpenSSL::X509::Name.parse 'CN=nobody/DC=example'
+ * name = OpenSSL::X509::Name.parse '/CN=nobody/DC=example'
*
* name = OpenSSL::X509::Name.new [['CN', 'nobody'], ['DC', 'example']]
*/