mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
Fix build warnings.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@249 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -151,7 +151,7 @@ int asn1_check_sequence(BUFFER *buffer)
|
|||||||
int read_line(char *data, unsigned int len, FILE *fp)
|
int read_line(char *data, unsigned int len, FILE *fp)
|
||||||
{
|
{
|
||||||
char tmp;
|
char tmp;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i=0; fread(&tmp, 1, 1, fp) && tmp!='\n' && i<len; data[i++]=tmp)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
} else if (cb == NULL && userdata != NULL) {
|
} 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);
|
passphrase_to_key(passphrase, strlen(passphrase), iv, key, key_len);
|
||||||
if (gcry_cipher_open(&cipher, algo, mode, 0)
|
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 */
|
#endif /* GCRYPT */
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBCRYPTO
|
||||||
static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
|
static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
|
||||||
SSH_SESSION *session = userdata;
|
SSH_SESSION *session = userdata;
|
||||||
|
|
||||||
@@ -482,6 +483,7 @@ static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_LIBCRYPTO */
|
||||||
|
|
||||||
/** \addtogroup ssh_auth
|
/** \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:");
|
valid = read_dsa_privatekey(file,&dsa, auth_cb, auth_ud, "Passphrase for private key:");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
valid = read_dsa_privatekey(file,&dsa, NULL, passphrase, NULL);
|
valid = read_dsa_privatekey(file,&dsa, NULL, (void *) passphrase, NULL);
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
if(!valid) {
|
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:");
|
valid = read_rsa_privatekey(file, &rsa, auth_cb, auth_ud, "Passphrase for private key:");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
valid = read_rsa_privatekey(file, &rsa, NULL, passphrase, NULL);
|
valid = read_rsa_privatekey(file, &rsa, NULL, (void *) passphrase, NULL);
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
if(!valid){
|
if(!valid){
|
||||||
|
|||||||
Reference in New Issue
Block a user