From 15863069c90b1253021981b23d31f154d79f8fe6 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Wed, 13 May 2020 18:15:08 +0900 Subject: [ruby/openssl] digest, hmac, ts, x509: use IO.binread in examples where appropriate IO.read may mangle line separator, which will corrupt binary data including DER-encoded X.509 certificates and such. Fixes: https://github.com/ruby/openssl/issues/243 https://github.com/ruby/openssl/commit/93213b2730 --- ext/openssl/ossl_x509cert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/openssl/ossl_x509cert.c') diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c index e3766b1b16..5376bff08d 100644 --- a/ext/openssl/ossl_x509cert.c +++ b/ext/openssl/ossl_x509cert.c @@ -730,7 +730,7 @@ Init_ossl_x509cert(void) * Certificate is capable of handling DER-encoded certificates and * certificates encoded in OpenSSL's PEM format. * - * raw = File.read "cert.cer" # DER- or PEM-encoded + * raw = File.binread "cert.cer" # DER- or PEM-encoded * certificate = OpenSSL::X509::Certificate.new raw * * === Saving a certificate to a file -- cgit v1.2.3