aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-07-24 22:02:32 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2009-07-24 22:02:32 +0200
commitfc5dd23afa3b71d1020065be61842964852f3482 (patch)
treeab1198445624cae190ebb8c3809d8000786cbc54 /libssh
parent91d0660cc3b0f72b690678862bb21cbe0328a186 (diff)
downloadlibssh-fc5dd23afa3b71d1020065be61842964852f3482.tar.gz
libssh-fc5dd23afa3b71d1020065be61842964852f3482.tar.xz
libssh-fc5dd23afa3b71d1020065be61842964852f3482.zip
Changed all PUBLIC_KEY * to ssh_public_key
Diffstat (limited to 'libssh')
-rw-r--r--libssh/auth.c2
-rw-r--r--libssh/dh.c4
-rw-r--r--libssh/kex.c10
-rw-r--r--libssh/keyfiles.c2
-rw-r--r--libssh/keys.c28
-rw-r--r--libssh/server.c2
6 files changed, 24 insertions, 24 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 8bb13e36..97651245 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -537,7 +537,7 @@ error:
* @see ssh_userauth_offer_pubkey()
*/
int ssh_userauth_agent_pubkey(SSH_SESSION *session, const char *username,
- PUBLIC_KEY *publickey) {
+ ssh_public_key publickey) {
ssh_string user = NULL;
ssh_string service = NULL;
ssh_string method = NULL;
diff --git a/libssh/dh.c b/libssh/dh.c
index 1bf663d9..0edd19da 100644
--- a/libssh/dh.c
+++ b/libssh/dh.c
@@ -875,7 +875,7 @@ static int match(const char *group, const char *object){
return 0;
}
-static int sig_verify(SSH_SESSION *session, PUBLIC_KEY *pubkey,
+static int sig_verify(SSH_SESSION *session, ssh_public_key pubkey,
SIGNATURE *signature, unsigned char *digest) {
#ifdef HAVE_LIBGCRYPT
gcry_error_t valid = 0;
@@ -971,7 +971,7 @@ static int sig_verify(SSH_SESSION *session, PUBLIC_KEY *pubkey,
}
int signature_verify(SSH_SESSION *session, ssh_string signature) {
- PUBLIC_KEY *pubkey = NULL;
+ ssh_public_key pubkey = NULL;
SIGNATURE *sign = NULL;
int err;
diff --git a/libssh/kex.c b/libssh/kex.c
index ae9c9a5a..887fc5c5 100644
--- a/libssh/kex.c
+++ b/libssh/kex.c
@@ -500,7 +500,7 @@ static int build_session_id1(SSH_SESSION *session, ssh_string servern,
}
/* returns 1 if the modulus of k1 is < than the one of k2 */
-static int modulus_smaller(PUBLIC_KEY *k1, PUBLIC_KEY *k2){
+static int modulus_smaller(ssh_public_key k1, ssh_public_key k2){
bignum n1;
bignum n2;
int res;
@@ -529,8 +529,8 @@ static int modulus_smaller(PUBLIC_KEY *k1, PUBLIC_KEY *k2){
}
#define ABS(A) ( (A)<0 ? -(A):(A) )
-static ssh_string encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *srvkey,
- PUBLIC_KEY *hostkey, int slen, int hlen) {
+static ssh_string encrypt_session_key(SSH_SESSION *session, ssh_public_key srvkey,
+ ssh_public_key hostkey, int slen, int hlen) {
unsigned char buffer[32] = {0};
int i;
ssh_string data1 = NULL;
@@ -614,8 +614,8 @@ int ssh_get_kex1(SSH_SESSION *session) {
ssh_string serverkey = NULL;
ssh_string hostkey = NULL;
ssh_string enc_session = NULL;
- PUBLIC_KEY *srv = NULL;
- PUBLIC_KEY *host = NULL;
+ ssh_public_key srv = NULL;
+ ssh_public_key host = NULL;
u32 server_bits;
u32 host_bits;
u32 protocol_flags;
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index be927ba7..83163121 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -1470,7 +1470,7 @@ int ssh_write_knownhost(SSH_SESSION *session) {
if (strcmp(session->current_crypto->server_pubkey_type, "ssh-rsa1") == 0) {
/* openssh uses a different format for ssh-rsa1 keys.
Be compatible --kv */
- PUBLIC_KEY *key;
+ ssh_public_key key;
char *e_string = NULL;
char *n_string = NULL;
bignum e = NULL;
diff --git a/libssh/keys.c b/libssh/keys.c
index 7faa80bd..6494c9ae 100644
--- a/libssh/keys.c
+++ b/libssh/keys.c
@@ -65,14 +65,14 @@ int ssh_type_from_name(const char *name) {
return -1;
}
-PUBLIC_KEY *publickey_make_dss(SSH_SESSION *session, ssh_buffer buffer) {
+ssh_public_key publickey_make_dss(SSH_SESSION *session, ssh_buffer buffer) {
ssh_string p = NULL;
ssh_string q = NULL;
ssh_string g = NULL;
ssh_string pubkey = NULL;
- PUBLIC_KEY *key = NULL;
+ ssh_public_key key = NULL;
- key = malloc(sizeof(PUBLIC_KEY));
+ key = malloc(sizeof(struct ssh_public_key_struct));
if (key == NULL) {
buffer_free(buffer);
return NULL;
@@ -151,13 +151,13 @@ error:
return NULL;
}
-PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, ssh_buffer buffer,
+ssh_public_key publickey_make_rsa(SSH_SESSION *session, ssh_buffer buffer,
int type) {
ssh_string e = NULL;
ssh_string n = NULL;
- PUBLIC_KEY *key = NULL;
+ ssh_public_key key = NULL;
- key = malloc(sizeof(PUBLIC_KEY));
+ key = malloc(sizeof(struct ssh_public_key_struct));
if (key == NULL) {
buffer_free(buffer);
return NULL;
@@ -218,7 +218,7 @@ error:
return NULL;
}
-void publickey_free(PUBLIC_KEY *key) {
+void publickey_free(ssh_public_key key) {
if (key == NULL) {
return;
}
@@ -245,7 +245,7 @@ void publickey_free(PUBLIC_KEY *key) {
SAFE_FREE(key);
}
-PUBLIC_KEY *publickey_from_string(SSH_SESSION *session, ssh_string pubkey_s) {
+ssh_public_key publickey_from_string(SSH_SESSION *session, ssh_string pubkey_s) {
ssh_buffer tmpbuf = NULL;
ssh_string type_s = NULL;
char *type_c = NULL;
@@ -296,8 +296,8 @@ error:
* \returns the public key
* \see publickey_to_string()
*/
-PUBLIC_KEY *publickey_from_privatekey(PRIVATE_KEY *prv) {
- PUBLIC_KEY *key = NULL;
+ssh_public_key publickey_from_privatekey(PRIVATE_KEY *prv) {
+ ssh_public_key key = NULL;
#ifdef HAVE_LIBGCRYPT
gcry_sexp_t sexp;
const char *tmp = NULL;
@@ -310,7 +310,7 @@ PUBLIC_KEY *publickey_from_privatekey(PRIVATE_KEY *prv) {
ssh_string n = NULL;
#endif /* HAVE_LIBGCRYPT */
- key = malloc(sizeof(PUBLIC_KEY));
+ key = malloc(sizeof(struct ssh_public_key_struct));
if (key == NULL) {
return NULL;
}
@@ -655,7 +655,7 @@ error:
* \returns a SSH String containing the public key
* \see string_free()
*/
-ssh_string publickey_to_string(PUBLIC_KEY *key) {
+ssh_string publickey_to_string(ssh_public_key key) {
ssh_string type = NULL;
ssh_string ret = NULL;
ssh_buffer buf = NULL;
@@ -847,7 +847,7 @@ static ssh_string signature_to_string(SIGNATURE *sign) {
/* TODO : split this function in two so it becomes smaller */
SIGNATURE *signature_from_string(SSH_SESSION *session, ssh_string signature,
- PUBLIC_KEY *pubkey, int needed_type) {
+ ssh_public_key pubkey, int needed_type) {
SIGNATURE *sign = NULL;
ssh_buffer tmpbuf = NULL;
ssh_string rs = NULL;
@@ -1249,7 +1249,7 @@ ssh_string ssh_do_sign(SSH_SESSION *session, ssh_buffer sigbuf,
return signature;
}
-ssh_string ssh_encrypt_rsa1(SSH_SESSION *session, ssh_string data, PUBLIC_KEY *key) {
+ssh_string ssh_encrypt_rsa1(SSH_SESSION *session, ssh_string data, ssh_public_key key) {
ssh_string str = NULL;
size_t len = string_len(data);
size_t size = 0;
diff --git a/libssh/server.c b/libssh/server.c
index 7b33cc6d..90b29b92 100644
--- a/libssh/server.c
+++ b/libssh/server.c
@@ -329,7 +329,7 @@ static int dh_handshake_server(SSH_SESSION *session) {
ssh_string f;
ssh_string pubkey;
ssh_string sign;
- PUBLIC_KEY *pub;
+ ssh_public_key pub;
PRIVATE_KEY *prv;
if (packet_wait(session, SSH2_MSG_KEXDH_INIT, 1) != SSH_OK) {