version 1.80, 2019/07/15 13:16:29 |
version 1.81, 2019/07/16 13:18:39 |
|
|
return SSH_ERR_ALLOC_FAIL; |
return SSH_ERR_ALLOC_FAIL; |
if ((r = sshkey_putb(key, b)) != 0) |
if ((r = sshkey_putb(key, b)) != 0) |
goto out; |
goto out; |
if ((uu = sshbuf_dtob64(b)) == NULL) { |
if ((uu = sshbuf_dtob64_string(b, 0)) == NULL) { |
r = SSH_ERR_ALLOC_FAIL; |
r = SSH_ERR_ALLOC_FAIL; |
goto out; |
goto out; |
} |
} |
|
|
sshbuf_ptr(encrypted), sshbuf_len(encrypted), 0, authlen)) != 0) |
sshbuf_ptr(encrypted), sshbuf_len(encrypted), 0, authlen)) != 0) |
goto out; |
goto out; |
|
|
/* uuencode */ |
|
if ((b64 = sshbuf_dtob64(encoded)) == NULL) { |
|
r = SSH_ERR_ALLOC_FAIL; |
|
goto out; |
|
} |
|
|
|
sshbuf_reset(blob); |
sshbuf_reset(blob); |
if ((r = sshbuf_put(blob, MARK_BEGIN, MARK_BEGIN_LEN)) != 0) |
|
goto out; |
/* assemble uuencoded key */ |
for (i = 0; i < strlen(b64); i++) { |
if ((r = sshbuf_put(blob, MARK_BEGIN, MARK_BEGIN_LEN)) != 0 || |
if ((r = sshbuf_put_u8(blob, b64[i])) != 0) |
(r = sshbuf_dtob64(encoded, blob, 1)) != 0 || |
goto out; |
(r = sshbuf_put(blob, MARK_END, MARK_END_LEN)) != 0) |
/* insert line breaks */ |
|
if (i % 70 == 69 && (r = sshbuf_put_u8(blob, '\n')) != 0) |
|
goto out; |
|
} |
|
if (i % 70 != 69 && (r = sshbuf_put_u8(blob, '\n')) != 0) |
|
goto out; |
|
if ((r = sshbuf_put(blob, MARK_END, MARK_END_LEN)) != 0) |
|
goto out; |
goto out; |
|
|
/* success */ |
/* success */ |