aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-02-02 17:00:04 +0000
committerAndreas Schneider <mail@cynapses.org>2009-02-02 17:00:04 +0000
commit69a1fac7a1361e998ff373208f89808de9c522b3 (patch)
tree26803467825537e40d5b68ff7981e6587bf6682d /libssh
parent1fd6a2e9e0b57bf861f177e737fd9cbb6458975b (diff)
downloadlibssh-69a1fac7a1361e998ff373208f89808de9c522b3.tar.gz
libssh-69a1fac7a1361e998ff373208f89808de9c522b3.tar.xz
libssh-69a1fac7a1361e998ff373208f89808de9c522b3.zip
Fix build warnings in the crypto wrapper functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@221 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
-rw-r--r--libssh/wrapper.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libssh/wrapper.c b/libssh/wrapper.c
index 151d4976..5f3f67f4 100644
--- a/libssh/wrapper.c
+++ b/libssh/wrapper.c
@@ -404,14 +404,14 @@ static struct crypto_struct ssh_ciphertab[]={
#endif /* OPENSSL_CRYPTO */
/* it allocates a new cipher structure based on its offset into the global table */
-struct crypto_struct *cipher_new(int offset){
+static struct crypto_struct *cipher_new(int offset){
struct crypto_struct *cipher=malloc(sizeof(struct crypto_struct));
/* note the memcpy will copy the pointers : so, you shouldn't free them */
memcpy(cipher,&ssh_ciphertab[offset],sizeof(*cipher));
return cipher;
}
-void cipher_free(struct crypto_struct *cipher){
+static void cipher_free(struct crypto_struct *cipher){
#ifdef HAVE_LIBGCRYPT
int i;
#endif
@@ -428,7 +428,7 @@ void cipher_free(struct crypto_struct *cipher){
free(cipher);
}
-CRYPTO *crypto_new(){
+CRYPTO *crypto_new(void){
CRYPTO *crypto=malloc(sizeof (CRYPTO));
memset(crypto,0,sizeof(*crypto));
return crypto;
@@ -510,13 +510,18 @@ int crypt_set_algorithms(SSH_SESSION *session){
// TODO Obviously too much cut and paste here
int crypt_set_algorithms_server(SSH_SESSION *session){
+ char *server = NULL;
+ char *client = NULL;
+ char *match = NULL;
+ int i = 0;
+
/* we must scan the kex entries to find crypto algorithms and set their appropriate structure */
- enter_function();
- int i=0;
+ enter_function();
/* out */
- char *server=session->server_kex.methods[SSH_CRYPT_S_C];
- char *client=session->client_kex.methods[SSH_CRYPT_S_C];
- char *match=ssh_find_matching(client,server);
+ server = session->server_kex.methods[SSH_CRYPT_S_C];
+ client = session->client_kex.methods[SSH_CRYPT_S_C];
+ match = ssh_find_matching(client,server);
+
if(!match){
ssh_set_error(session,SSH_FATAL,"Crypt_set_algorithms_server : no matching algorithm function found for %s",server);
free(match);