From 6b0a89a288d2ca41f93178f60266573eddd0db1e Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Wed, 23 Sep 2009 23:55:07 +0200 Subject: Get rid of CRYPTO --- libssh/keys.c | 6 +++--- libssh/wrapper.c | 12 +++++------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'libssh') diff --git a/libssh/keys.c b/libssh/keys.c index 8ffa4394..2fcc6750 100644 --- a/libssh/keys.c +++ b/libssh/keys.c @@ -1168,7 +1168,7 @@ ssh_buffer ssh_userauth_build_digest(ssh_session session, ssh_message msg, char string public key algorithm name string public key to be used for authentication */ - CRYPTO *crypto = session->current_crypto ? session->current_crypto : + struct ssh_crypto_struct *crypto = session->current_crypto ? session->current_crypto : session->next_crypto; ssh_buffer buffer = NULL; ssh_string session_id = NULL; @@ -1220,7 +1220,7 @@ error: * the content of sigbuf */ ssh_string ssh_do_sign(ssh_session session, ssh_buffer sigbuf, ssh_private_key privatekey) { - CRYPTO *crypto = session->current_crypto ? session->current_crypto : + struct ssh_crypto_struct *crypto = session->current_crypto ? session->current_crypto : session->next_crypto; unsigned char hash[SHA_DIGEST_LEN + 1] = {0}; ssh_string session_str = NULL; @@ -1384,7 +1384,7 @@ ssh_string ssh_encrypt_rsa1(ssh_session session, ssh_string data, ssh_public_key /* this function signs the session id */ ssh_string ssh_sign_session_id(ssh_session session, ssh_private_key privatekey) { - CRYPTO *crypto=session->current_crypto ? session->current_crypto : + struct ssh_crypto_struct *crypto=session->current_crypto ? session->current_crypto : session->next_crypto; unsigned char hash[SHA_DIGEST_LEN + 1] = {0}; ssh_string signature = NULL; diff --git a/libssh/wrapper.c b/libssh/wrapper.c index f82ae3e7..f6806057 100644 --- a/libssh/wrapper.c +++ b/libssh/wrapper.c @@ -769,20 +769,18 @@ static void cipher_free(struct crypto_struct *cipher) { SAFE_FREE(cipher); } -CRYPTO *crypto_new(void) { - CRYPTO *crypto; +struct ssh_crypto_struct *crypto_new(void) { + struct ssh_crypto_struct *crypto; - crypto = malloc(sizeof(CRYPTO)); + crypto = malloc(sizeof(struct ssh_crypto_struct)); if (crypto == NULL) { return NULL; } - - memset(crypto, 0, sizeof(CRYPTO)); - + ZERO_STRUCTP(crypto); return crypto; } -void crypto_free(CRYPTO *crypto){ +void crypto_free(struct ssh_crypto_struct *crypto){ if (crypto == NULL) { return; } -- cgit