From 1d734f16cf6bb8561e9f3f987bae4178b7e81560 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 26 Aug 2011 21:46:56 +0200 Subject: [PATCH] legacy: Remove privatekey_from_base64(). This function has been introduced for libssh 0.6. So we can remove it completely. --- include/libssh/keyfiles.h | 3 --- include/libssh/libssh.h | 3 --- src/legacy.c | 34 ---------------------------------- 3 files changed, 40 deletions(-) diff --git a/include/libssh/keyfiles.h b/include/libssh/keyfiles.h index ac5feb0d..80e989f4 100644 --- a/include/libssh/keyfiles.h +++ b/include/libssh/keyfiles.h @@ -30,7 +30,4 @@ ssh_string try_publickey_from_file(ssh_session session, struct ssh_keys_struct keytab, char **privkeyfile, int *type); -ssh_private_key privatekey_from_base64(ssh_session session, const char *b64_pkey, - int type, const char *passphrase); - #endif /* KEYFILES_H_ */ diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 62a210a6..1e5f8354 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -547,9 +547,6 @@ LIBSSH_API int ssh_event_remove_fd(ssh_event event, socket_t fd); LIBSSH_API int ssh_event_remove_session(ssh_event event, ssh_session session); LIBSSH_API void ssh_event_free(ssh_event event); -LIBSSH_API ssh_private_key privatekey_from_base64(ssh_session session, const char *b64_pkey, - int type, const char *passphrase); - #ifndef LIBSSH_LEGACY_0_4 #include "libssh/legacy.h" #endif diff --git a/src/legacy.c b/src/legacy.c index 4c52d981..2789b1cb 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -343,40 +343,6 @@ char *string_to_char(ssh_string str){ return ssh_string_to_char(str); } -ssh_private_key privatekey_from_base64(ssh_session session, - const char *b64_pkey, - int type, - const char *passphrase) { - ssh_auth_callback auth_fn = NULL; - void *auth_data = NULL; - ssh_private_key privkey; - ssh_key key; - - (void) type; /* unused */ - - if (session->common.callbacks) { - auth_fn = session->common.callbacks->auth_function; - auth_data = session->common.callbacks->userdata; - } - - key = pki_private_key_from_base64(b64_pkey, passphrase, auth_fn, auth_data); - if (key == NULL) { - return NULL; - } - - privkey = malloc(sizeof(struct ssh_private_key_struct)); - if (privkey == NULL) { - ssh_key_free(key); - return NULL; - } - - privkey->type = key->type; - privkey->dsa_priv = key->dsa; - privkey->rsa_priv = key->rsa; - - return privkey; -} - ssh_private_key privatekey_from_file(ssh_session session, const char *filename, int type,