version 1.31, 2015/12/11 04:21:12 |
version 1.32, 2016/04/09 12:39:30 |
|
|
#ifdef DEBUG_PK /* XXX */ |
#ifdef DEBUG_PK /* XXX */ |
sshbuf_dump(b, stderr); |
sshbuf_dump(b, stderr); |
#endif |
#endif |
*keyp = NULL; |
if (keyp != NULL) |
|
*keyp = NULL; |
if ((copy = sshbuf_fromb(b)) == NULL) { |
if ((copy = sshbuf_fromb(b)) == NULL) { |
ret = SSH_ERR_ALLOC_FAIL; |
ret = SSH_ERR_ALLOC_FAIL; |
goto out; |
goto out; |
|
|
goto out; |
goto out; |
} |
} |
ret = 0; |
ret = 0; |
*keyp = key; |
if (keyp != NULL) { |
key = NULL; |
*keyp = key; |
|
key = NULL; |
|
} |
out: |
out: |
sshbuf_free(copy); |
sshbuf_free(copy); |
sshkey_free(key); |
sshkey_free(key); |
|
|
/* The encrypted private part is not parsed by this function. */ |
/* The encrypted private part is not parsed by this function. */ |
|
|
r = 0; |
r = 0; |
if (keyp != NULL) |
if (keyp != NULL) { |
*keyp = pub; |
*keyp = pub; |
else |
pub = NULL; |
sshkey_free(pub); |
} |
pub = NULL; |
|
|
|
out: |
out: |
sshbuf_free(copy); |
sshbuf_free(copy); |
sshkey_free(pub); |
sshkey_free(pub); |
|
|
const struct sshcipher *cipher; |
const struct sshcipher *cipher; |
struct sshkey *prv = NULL; |
struct sshkey *prv = NULL; |
|
|
*keyp = NULL; |
if (keyp != NULL) |
|
*keyp = NULL; |
if (commentp != NULL) |
if (commentp != NULL) |
*commentp = NULL; |
*commentp = NULL; |
|
|
|
|
goto out; |
goto out; |
} |
} |
r = 0; |
r = 0; |
*keyp = prv; |
if (keyp != NULL) { |
prv = NULL; |
*keyp = prv; |
|
prv = NULL; |
|
} |
if (commentp != NULL) { |
if (commentp != NULL) { |
*commentp = comment; |
*commentp = comment; |
comment = NULL; |
comment = NULL; |
|
|
BIO *bio = NULL; |
BIO *bio = NULL; |
int r; |
int r; |
|
|
*keyp = NULL; |
if (keyp != NULL) |
|
*keyp = NULL; |
|
|
if ((bio = BIO_new(BIO_s_mem())) == NULL || sshbuf_len(blob) > INT_MAX) |
if ((bio = BIO_new(BIO_s_mem())) == NULL || sshbuf_len(blob) > INT_MAX) |
return SSH_ERR_ALLOC_FAIL; |
return SSH_ERR_ALLOC_FAIL; |
|
|
goto out; |
goto out; |
} |
} |
r = 0; |
r = 0; |
*keyp = prv; |
if (keyp != NULL) { |
prv = NULL; |
*keyp = prv; |
|
prv = NULL; |
|
} |
out: |
out: |
BIO_free(bio); |
BIO_free(bio); |
if (pk != NULL) |
if (pk != NULL) |
|
|
sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type, |
sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type, |
const char *passphrase, struct sshkey **keyp, char **commentp) |
const char *passphrase, struct sshkey **keyp, char **commentp) |
{ |
{ |
*keyp = NULL; |
if (keyp != NULL) |
|
*keyp = NULL; |
if (commentp != NULL) |
if (commentp != NULL) |
*commentp = NULL; |
*commentp = NULL; |
|
|