From e5f72468b89e2e3c0bfa718cbef0b423b2906cbc Mon Sep 17 00:00:00 2001 From: Norbert Pocs Date: Thu, 29 Sep 2022 11:14:51 +0200 Subject: [PATCH] pki.c: Add missing function documentation Signed-off-by: Norbert Pocs Reviewed-by: Jakub Jelen (cherry picked from commit 27e223ba224bb3c58cd38805e485b64e0d5b653f) --- src/pki.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/pki.c b/src/pki.c index 8f62ce2b..b59339af 100644 --- a/src/pki.c +++ b/src/pki.c @@ -137,6 +137,13 @@ ssh_key ssh_key_new (void) return ptr; } +/** + * @brief duplicates the key + * + * @param key An ssh_key to duplicate + * + * @return A duplicated ssh_key key + */ ssh_key ssh_key_dup(const ssh_key key) { if (key == NULL) { @@ -2147,6 +2154,18 @@ int ssh_pki_export_pubkey_base64(const ssh_key key, return SSH_OK; } +/** + * @brief Export public key to file + * + * Exports the public key in AuthorizedKeysFile acceptable format. + * For more information see `man sshd` + * + * @param key A key to export + * + * @param filename The name of the output file + * + * @returns SSH_OK on success, SSH_ERROR otherwise. + */ int ssh_pki_export_pubkey_file(const ssh_key key, const char *filename) {