View | Details | Raw Unified | Return to bug 2522 | Differences between
and this patch

Collapse All | Expand All

(-)a/sshkey.c (-1 / +9 lines)
Lines 3777-3782 sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, Link Here
3777
	struct sshkey *prv = NULL;
3777
	struct sshkey *prv = NULL;
3778
	BIO *bio = NULL;
3778
	BIO *bio = NULL;
3779
	int r;
3779
	int r;
3780
	unsigned long e;
3780
3781
3781
	*keyp = NULL;
3782
	*keyp = NULL;
3782
3783
Lines 3790-3796 sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, Link Here
3790
3791
3791
	if ((pk = PEM_read_bio_PrivateKey(bio, NULL, NULL,
3792
	if ((pk = PEM_read_bio_PrivateKey(bio, NULL, NULL,
3792
	    (char *)passphrase)) == NULL) {
3793
	    (char *)passphrase)) == NULL) {
3793
		r = SSH_ERR_KEY_WRONG_PASSPHRASE;
3794
		e = ERR_peek_error();
3795
		ERR_print_errors_fp(stderr);
3796
		if (ERR_GET_REASON(e) == PEM_R_NO_START_LINE ||
3797
		    ERR_GET_REASON(e) == PEM_R_BAD_END_LINE) {
3798
			r = SSH_ERR_INVALID_FORMAT;
3799
		} else {
3800
			r = SSH_ERR_KEY_WRONG_PASSPHRASE;
3801
		}
3794
		goto out;
3802
		goto out;
3795
	}
3803
	}
3796
	if (pk->type == EVP_PKEY_RSA &&
3804
	if (pk->type == EVP_PKEY_RSA &&

Return to bug 2522