aboutsummaryrefslogtreecommitdiff
path: root/libssh/keyfiles.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-07-24 22:08:04 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2009-07-24 22:08:04 +0200
commit23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60 (patch)
tree599f9e62ed88cc8da1124cfd48ef79046473fecc /libssh/keyfiles.c
parentc041bcc6d9b86b06c9323b0824db2d3346023e4c (diff)
downloadlibssh-23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60.tar.gz
libssh-23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60.tar.xz
libssh-23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60.zip
Change PRIVATE_KEY * to ssh_private_key
Diffstat (limited to 'libssh/keyfiles.c')
-rw-r--r--libssh/keyfiles.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index 8316312..43c26d9 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -609,10 +609,10 @@ static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
* \see privatekey_free()
* \see publickey_from_privatekey()
*/
-PRIVATE_KEY *privatekey_from_file(SSH_SESSION *session, const char *filename,
+ssh_private_key privatekey_from_file(SSH_SESSION *session, const char *filename,
int type, const char *passphrase) {
ssh_auth_callback auth_cb = NULL;
- PRIVATE_KEY *privkey = NULL;
+ ssh_private_key privkey = NULL;
void *auth_ud = NULL;
FILE *file = NULL;
#ifdef HAVE_LIBGCRYPT
@@ -719,7 +719,7 @@ PRIVATE_KEY *privatekey_from_file(SSH_SESSION *session, const char *filename,
return NULL;
} /* switch */
- privkey = malloc(sizeof(PRIVATE_KEY));
+ privkey = malloc(sizeof(struct ssh_private_key_struct));
if (privkey == NULL) {
#ifdef HAVE_LIBGCRYPT
gcry_sexp_release(dsa);
@@ -739,9 +739,9 @@ PRIVATE_KEY *privatekey_from_file(SSH_SESSION *session, const char *filename,
}
/* same that privatekey_from_file() but without any passphrase things. */
-PRIVATE_KEY *_privatekey_from_file(void *session, const char *filename,
+ssh_private_key _privatekey_from_file(void *session, const char *filename,
int type) {
- PRIVATE_KEY *privkey = NULL;
+ ssh_private_key privkey = NULL;
FILE *file = NULL;
#ifdef HAVE_LIBGCRYPT
gcry_sexp_t dsa = NULL;
@@ -807,7 +807,7 @@ PRIVATE_KEY *_privatekey_from_file(void *session, const char *filename,
return NULL;
}
- privkey = malloc(sizeof(PRIVATE_KEY));
+ privkey = malloc(sizeof(struct ssh_private_key_struct));
if (privkey == NULL) {
#ifdef HAVE_LIBGCRYPT
gcry_sexp_release(dsa);
@@ -829,7 +829,7 @@ PRIVATE_KEY *_privatekey_from_file(void *session, const char *filename,
/** \brief deallocate a private key
* \param prv a PRIVATE_KEY object
*/
-void privatekey_free(PRIVATE_KEY *prv) {
+void privatekey_free(ssh_private_key prv) {
if (prv == NULL) {
return;
}
@@ -841,7 +841,7 @@ void privatekey_free(PRIVATE_KEY *prv) {
DSA_free(prv->dsa_priv);
RSA_free(prv->rsa_priv);
#endif
- memset(prv, 0, sizeof(PRIVATE_KEY));
+ memset(prv, 0, sizeof(struct ssh_private_key_struct));
SAFE_FREE(prv);
}