Skip Menu |
 

This queue is for tickets about the Net-SSLeay CPAN distribution.

Report information
The Basics
Id: 115163
Status: open
Priority: 0/
Queue: Net-SSLeay

People
Owner: Nobody in particular
Requestors: logioniz [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: maybe bug when read encrypted private key
Date: Wed, 08 Jun 2016 17:22:12 +0500
To: bug-net-ssleay [...] rt.cpan.org
From: Алексей Ставров <logioniz [...] yandex.ru>
private key from examples (server_key.pem)
 
$ cat 11.pl
#!/usr/bin/perl
use Mojo::Base -strict;
 
use Net::SSLeay;
 
sub provide_password {
#    ($buf,$siz,$rwflag,$pwd)=@_;
    $_[0]="1234";
    return 4;
}
 
my $bio = Net::SSLeay::BIO_new_file('server_key.pem', 'r');
my $pk = Net::SSLeay::PEM_read_bio_PrivateKey($bio, \&provide_password);
if ($pk == 0) {
  warn 'Error';
} else {
  warn 'Success';
}
 
$ cat server_key.pem
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,932256E9ACCDC996
 
wav+t55gSrsCnvgeikRqcQKXuUeXEqEcL6zwNsTMIis6rpGuXkBYH5Ezntm6h/5h
2vZDu2vTOeq7QbNmTbKWbU6Rw0e7hlnWcPFhg3ssLNrh0XW3ynZ56gLCj/TRHj9V
4c7UnozeDTb+XYEAp+1Yj21Bpepectak6j4dZfhhJteEGWMDj9faNTbA08LX87Wn
JiNhlhIWl7ncS/13riwLqsemHcTFlNCaoANaVCUKEGoIFZmz1OoYJvBWLj7HnxDU
+Z/lvf3o1glE1EP3XcCACGhapfZcALlYhz1qGTA6ProZ/sIJGLAYAi8uobJlA1E0
SwGXNm4rtMocR7utO649/g92SFvGZmG715t2P8jBa4MqgV5H3oIIVJK1YiL6Zmk5
jZMPmTDctXD61dLnTFXa+m0vLJMZAMD8UkhtbuCMYzTy0dIHBaxTYNxggSbfbbKJ
6QijHZHn+iygyudCxYWXtZQ1uyBFzU4wpEGqugngf3T0W2TWpiM3PQjh+vymxKRZ
UVY5LGejMuz3HpgFcJ+Hs6DCJYAECUWWjSPhTXvTifNIZq5XdaeCveyLkMnCHQ7y
LW64XcZ9jWzI+FOqRmLMYcUoHh8eZyB6X6ITC3wy2g1ovc5KrD+OuC+HOyLvvb+8
avnSoc1+maBC7su7htE/EPP6X/zvNzLM4Ky4JvmNtFR5+CzD7xnwoS3jY97u6gMz
MHjb7t2pA7rFnVImwivvi/y3sEAL9P5N+mL+q82q9qsmcb58tlkAteUpcrOvlmRk
3kzlM0tz9/Rm4bYttEDBt67Fg4/hZbZ+m+5BMzVWWdtZIdHUIGJjew==
-----END RSA PRIVATE KEY-----
$ perl 11.pl
Error at 11.pl line 15.
$
 
How can i read private key which encrypted with password?
 
--
С уважением, Ставров Алексей.
 
Subject: Re: [rt.cpan.org #115163] maybe bug when read encrypted private key
Date: Thu, 9 Jun 2016 06:34:33 +0900
To: bug-Net-SSLeay [...] rt.cpan.org
From: Mike McCauley <mikem [...] airspayce.com>
Thanks for the report. I am travelling now and will investigate when I return in 3 weeks Cheers Sent from my iPhone Show quoted text
> On 8 Jun 2016, at 9:22 PM, Алексей Ставров via RT <bug-Net-SSLeay@rt.cpan.org> wrote: > > Wed Jun 08 08:22:28 2016: Request 115163 was acted upon. > Transaction: Ticket created by logioniz@yandex.ru > Queue: Net-SSLeay > Subject: maybe bug when read encrypted private key > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: logioniz@yandex.ru > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=115163 > > > > private key from examples (server_key.pem) $ cat 11.pl#!/usr/bin/perluse > Mojo::Base -strict; use Net::SSLeay; sub provide_password {# > ($buf,$siz,$rwflag,$pwd)=@_; $_[0]="1234"; return 4;} my $bio = > Net::SSLeay::BIO_new_file('server_key.pem', 'r');my $pk = > Net::SSLeay::PEM_read_bio_PrivateKey($bio, \&provide_password);if ($pk == 0) { > warn 'Error';} else { warn 'Success';} $ cat server_key.pem-----BEGIN RSA > PRIVATE KEY-----Proc-Type: 4,ENCRYPTEDDEK-Info: DES-EDE3-CBC,932256E9ACCDC996 > wav+t55gSrsCnvgeikRqcQKXuUeXEqEcL6zwNsTMIis6rpGuXkBYH5Ezntm6h/5h2vZDu2vTOeq7QbNmTbKWbU6Rw0e7hlnWcPFhg3ssLNrh0XW3ynZ56gLCj/TRHj9V4c7UnozeDTb+XYEAp+1Yj21Bpepectak6j4dZfhhJteEGWMDj9faNTbA08LX87WnJiNhlhIWl7ncS/13riwLqsemHcTFlNCaoANaVCUKEGoIFZmz1OoYJvBWLj7HnxDU+Z/lvf3o1glE1EP3XcCACGhapfZcALlYhz1qGTA6ProZ/sIJGLAYAi8uobJlA1E0SwGXNm4rtMocR7utO649/g92SFvGZmG715t2P8jBa4MqgV5H3oIIVJK1YiL6Zmk5jZMPmTDctXD61dLnTFXa+m0vLJMZAMD8UkhtbuCMYzTy0dIHBaxTYNxggSbfbbKJ6QijHZHn+iygyudCxYWXtZQ1uyBFzU4wpEGqugngf3T0W2TWpiM3PQjh+vymxKRZUVY5LGejMuz3HpgFcJ+Hs6DCJYAECUWWjSPhTXvTifNIZq5XdaeCveyLkMnCHQ7yLW64XcZ9jWzI+FOqRmLMYcUoHh8eZyB6X6ITC3wy2g1ovc5KrD+OuC+HOyLvvb+8avnSoc1+maBC7su7htE/EPP6X/zvNzLM4Ky4JvmNtFR5+CzD7xnwoS3jY97u6gMzMHjb7t2pA7rFnVImwivvi/y3sEAL9P5N+mL+q82q9qsmcb58tlkAteUpcrOvlmRk3kzlM0tz9/Rm4bYttEDBt67Fg4/hZbZ+m+5BMzVWWdtZIdHUIGJjew==-----END > RSA PRIVATE KEY-----$ perl 11.plError at 11.pl line 15.$ How can i read private > key which encrypted with password? -- > С уважением, Ставров Алексей. >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.