aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-03-08 14:05:10 +0000
committerAndreas Schneider <mail@cynapses.org>2009-03-08 14:05:10 +0000
commit461d9413d3c32066953f4ed97b8d4d8fc6f169b0 (patch)
treecd6ee139c97e1cbe2f481a3c3be51ab209f73e51 /libssh
parentcf1e7fa836b5cb33b3b8e0e01f1e1cb6f2c3c462 (diff)
downloadlibssh-461d9413d3c32066953f4ed97b8d4d8fc6f169b0.tar.gz
libssh-461d9413d3c32066953f4ed97b8d4d8fc6f169b0.tar.xz
libssh-461d9413d3c32066953f4ed97b8d4d8fc6f169b0.zip
Fix build warnings.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@249 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
-rw-r--r--libssh/keyfiles.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index b9775c77..862efa2d 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -151,7 +151,7 @@ int asn1_check_sequence(BUFFER *buffer)
int read_line(char *data, unsigned int len, FILE *fp)
{
char tmp;
- int i;
+ unsigned int i;
for (i=0; fread(&tmp, 1, 1, fp) && tmp!='\n' && i<len; data[i++]=tmp)
;
@@ -212,7 +212,7 @@ int privatekey_decrypt(int algo, int mode, unsigned int key_len,
return 0;
}
} else if (cb == NULL && userdata != NULL) {
- sprintf(passphrase, MAX_PASSPHRASE_SIZE, "%s", userdata);
+ snprintf(passphrase, MAX_PASSPHRASE_SIZE, "%s", (char *) userdata);
}
passphrase_to_key(passphrase, strlen(passphrase), iv, key, key_len);
if (gcry_cipher_open(&cipher, algo, mode, 0)
@@ -463,6 +463,7 @@ int read_dsa_privatekey(FILE *fp, gcry_sexp_t *r, ssh_auth_callback cb, void *us
}
#endif /* GCRYPT */
+#ifdef HAVE_LIBCRYPTO
static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
SSH_SESSION *session = userdata;
@@ -482,6 +483,7 @@ static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
return 0;
}
+#endif /* HAVE_LIBCRYPTO */
/** \addtogroup ssh_auth
* @{
@@ -524,7 +526,7 @@ PRIVATE_KEY *privatekey_from_file(SSH_SESSION *session,char *filename,int type,
valid = read_dsa_privatekey(file,&dsa, auth_cb, auth_ud, "Passphrase for private key:");
}
} else {
- valid = read_dsa_privatekey(file,&dsa, NULL, passphrase, NULL);
+ valid = read_dsa_privatekey(file,&dsa, NULL, (void *) passphrase, NULL);
}
fclose(file);
if(!valid) {
@@ -556,7 +558,7 @@ PRIVATE_KEY *privatekey_from_file(SSH_SESSION *session,char *filename,int type,
valid = read_rsa_privatekey(file, &rsa, auth_cb, auth_ud, "Passphrase for private key:");
}
} else {
- valid = read_rsa_privatekey(file, &rsa, NULL, passphrase, NULL);
+ valid = read_rsa_privatekey(file, &rsa, NULL, (void *) passphrase, NULL);
}
fclose(file);
if(!valid){