OpenSSH
[Top] [All Lists]

Re: PEM_read_PrivateKey failed issue

To: openssh-unix-dev@mindrot.org
Subject: Re: PEM_read_PrivateKey failed issue
From: Peter Stuge <stuge-openssh-unix-dev@cdy.org>
Date: Sun, 19 Nov 2006 07:07:31 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: openssh-unix-dev-list1@securepoint.com
Delivered-to: openssh-unix-dev-tmda@mindrot.org
Delivered-to: openssh-unix-dev@mindrot.org
In-reply-to: <20061118170414.GA45903@ducati-748.3rdrock.kicks-ass.net>
List-archive: <http://lists.mindrot.org/pipermail/openssh-unix-dev>
List-help: <mailto:openssh-unix-dev-request@mindrot.org?subject=help>
List-id: Development of portable OpenSSH <openssh-unix-dev.mindrot.org>
List-post: <mailto:openssh-unix-dev@mindrot.org>
List-subscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=subscribe>
List-unsubscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=unsubscribe>
Mail-followup-to: openssh-unix-dev@mindrot.org
References: <20061118170414.GA45903@ducati-748.3rdrock.kicks-ass.net>
Sender: openssh-unix-dev-bounces+openssh-unix-dev-list1=securepoint.com@mindrot.org
On Sat, Nov 18, 2006 at 06:04:14PM +0100, Alain G. Fabry wrote:
> When I try to change the password on the key it give me the
> 'PEM_read_PrivateKey failed' problem, this also prevents me from
> connecting to another host.

[..]

> 2. Changing the password
> 
> afabry@ducati-748 21:20 % ssh-keygen -v -p -f .ssh/test.pub

-f takes the private key file as argument. Drop .pub


> debug1: PEM_read_PrivateKey failed
> debug1: read PEM private key done: type <unknown>
> Enter old passphrase:
> debug1: PEM_read_PrivateKey failed
> debug1: read PEM private key done: type <unknown>
> Bad passphrase.

The error message could be more informative I suppose.

ssh-keygen tries to do what you told it - read a private key from
test.pub, and it reads a key of type <unknown>.

It asks for the passphrase and tries to use the passphrase to decrypt
the private key read from the file, in order to get a key of a known
type.

Since decrypting with the passphrase produced a key of type <unknown>
ssh-keygen assumes that the incorrect passphrase was given.

Needless to say this does not work when the input is not a key of the
correct format. I don't think it is possible to recognize an
encrypted private key, hence ssh-keygen can't tell when it gets the
wrong input. (Or can it?)


//Peter
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

<Prev in Thread] Current Thread [Next in Thread>