diff options
| author | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-07-24 22:08:04 +0200 |
|---|---|---|
| committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-07-24 22:08:04 +0200 |
| commit | 23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60 (patch) | |
| tree | 599f9e62ed88cc8da1124cfd48ef79046473fecc /libssh | |
| parent | c041bcc6d9b86b06c9323b0824db2d3346023e4c (diff) | |
| download | libssh-23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60.tar.gz libssh-23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60.tar.xz libssh-23b6c95e04adeff7cf49d7d8dffc74f1e3e4bc60.zip | |
Change PRIVATE_KEY * to ssh_private_key
Diffstat (limited to 'libssh')
| -rw-r--r-- | libssh/auth.c | 4 | ||||
| -rw-r--r-- | libssh/auth1.c | 2 | ||||
| -rw-r--r-- | libssh/keyfiles.c | 16 | ||||
| -rw-r--r-- | libssh/keys.c | 6 | ||||
| -rw-r--r-- | libssh/server.c | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/libssh/auth.c b/libssh/auth.c index 97651245..80d978fb 100644 --- a/libssh/auth.c +++ b/libssh/auth.c @@ -418,7 +418,7 @@ error: * @see ssh_userauth_offer_pubkey() */ int ssh_userauth_pubkey(SSH_SESSION *session, const char *username, - ssh_string publickey, PRIVATE_KEY *privatekey) { + ssh_string publickey, ssh_private_key privatekey) { ssh_string user = NULL; ssh_string service = NULL; ssh_string method = NULL; @@ -797,7 +797,7 @@ static struct ssh_keys_struct keytab[] = { int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) { struct ssh_public_key_struct *publickey; ssh_string pubkey; - PRIVATE_KEY *privkey; + ssh_private_key privkey; char *privkeyfile = NULL; char *id = NULL; size_t size; diff --git a/libssh/auth1.c b/libssh/auth1.c index d242c5e8..6d11b2ce 100644 --- a/libssh/auth1.c +++ b/libssh/auth1.c @@ -142,7 +142,7 @@ int ssh_userauth1_offer_pubkey(SSH_SESSION *session, const char *username, } /* -int ssh_userauth_pubkey(SSH_SESSION *session, char *username, ssh_string publickey, PRIVATE_KEY *privatekey){ +int ssh_userauth_pubkey(SSH_SESSION *session, char *username, ssh_string publickey, ssh_private_key privatekey){ ssh_string user; ssh_string service; ssh_string method; diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index 83163121..43c26d9d 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); } diff --git a/libssh/keys.c b/libssh/keys.c index 6494c9ae..453f3a55 100644 --- a/libssh/keys.c +++ b/libssh/keys.c @@ -296,7 +296,7 @@ error: * \returns the public key * \see publickey_to_string() */ -ssh_public_key publickey_from_privatekey(PRIVATE_KEY *prv) { +ssh_public_key publickey_from_privatekey(ssh_private_key prv) { ssh_public_key key = NULL; #ifdef HAVE_LIBGCRYPT gcry_sexp_t sexp; @@ -1151,7 +1151,7 @@ ssh_string ssh_do_sign_with_agent(struct ssh_session *session, * This function signs the session id (known as H) as a string then * the content of sigbuf */ ssh_string ssh_do_sign(SSH_SESSION *session, ssh_buffer sigbuf, - PRIVATE_KEY *privatekey) { + ssh_private_key privatekey) { CRYPTO *crypto = session->current_crypto ? session->current_crypto : session->next_crypto; unsigned char hash[SHA_DIGEST_LEN + 1] = {0}; @@ -1315,7 +1315,7 @@ ssh_string ssh_encrypt_rsa1(SSH_SESSION *session, ssh_string data, ssh_public_ke /* this function signs the session id */ -ssh_string ssh_sign_session_id(SSH_SESSION *session, PRIVATE_KEY *privatekey) { +ssh_string ssh_sign_session_id(SSH_SESSION *session, ssh_private_key privatekey) { CRYPTO *crypto=session->current_crypto ? session->current_crypto : session->next_crypto; unsigned char hash[SHA_DIGEST_LEN + 1] = {0}; diff --git a/libssh/server.c b/libssh/server.c index 90b29b92..8df0a1b9 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -179,8 +179,8 @@ void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind) { SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind) { SSH_SESSION *session; - PRIVATE_KEY *dsa = NULL; - PRIVATE_KEY *rsa = NULL; + ssh_private_key dsa = NULL; + ssh_private_key rsa = NULL; int fd = -1; if (ssh_bind->bindfd < 0) { @@ -330,7 +330,7 @@ static int dh_handshake_server(SSH_SESSION *session) { ssh_string pubkey; ssh_string sign; ssh_public_key pub; - PRIVATE_KEY *prv; + ssh_private_key prv; if (packet_wait(session, SSH2_MSG_KEXDH_INIT, 1) != SSH_OK) { return -1; |
