diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 975925b4..22b836b4 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -515,7 +515,7 @@ void ssh_set_error(void *error, int code, const char *descr, ...) PRINTF_ATTRIBU /* in dh.c */ /* DH key generation */ void dh_generate_e(SSH_SESSION *session); -void ssh_print_bignum(char *which,bignum num); +void ssh_print_bignum(const char *which,bignum num); void dh_generate_x(SSH_SESSION *session); void dh_generate_y(SSH_SESSION *session); void dh_generate_f(SSH_SESSION *session); @@ -574,15 +574,16 @@ char *ssh_find_matching(const char *in_d, const char *what_d); /* in keyfiles.c */ -PRIVATE_KEY *_privatekey_from_file(void *session,char *filename,int type); +PRIVATE_KEY *_privatekey_from_file(void *session, const char *filename, + int type); /* in keys.c */ const char *ssh_type_to_char(int type); -int ssh_type_from_name(char *name); +int ssh_type_from_name(const char *name); PRIVATE_KEY *privatekey_make_dss(SSH_SESSION *session, BUFFER *buffer); PRIVATE_KEY *privatekey_make_rsa(SSH_SESSION *session, BUFFER *buffer, - char *type); + const char *type); PRIVATE_KEY *privatekey_from_string(SSH_SESSION *session, STRING *privkey_s); PUBLIC_KEY *publickey_make_dss(SSH_SESSION *session, BUFFER *buffer); @@ -658,15 +659,15 @@ void crypto_free(CRYPTO *crypto); u32 ssh_crc32(char *buffer, int len); /* auth1.c */ -int ssh_userauth1_none(SSH_SESSION *session, char *username); -int ssh_userauth1_offer_pubkey(SSH_SESSION *session, char *username, +int ssh_userauth1_none(SSH_SESSION *session, const char *username); +int ssh_userauth1_offer_pubkey(SSH_SESSION *session, const char *username, int type, STRING *pubkey); -int ssh_userauth1_password(SSH_SESSION *session, char *username, - char *password); +int ssh_userauth1_password(SSH_SESSION *session, const char *username, + const char *password); /* in misc.c */ /* gets the user home dir. */ char *ssh_get_user_home_dir(void); -int ssh_file_readaccess_ok(char *file); +int ssh_file_readaccess_ok(const char *file); /* macro for byte ordering */ u64 ntohll(u64); diff --git a/libssh/dh.c b/libssh/dh.c index 0ef3c90e..24e7257e 100644 --- a/libssh/dh.c +++ b/libssh/dh.c @@ -128,7 +128,7 @@ void ssh_crypto_finalize(void){ } /* prints the bignum on stderr */ -void ssh_print_bignum(char *which,bignum num){ +void ssh_print_bignum(const char *which,bignum num){ #ifdef HAVE_LIBGCRYPT unsigned char *hex; bignum_bn2hex(num,&hex); diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index 73a8704a..22ead297 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -596,7 +596,8 @@ PRIVATE_KEY *privatekey_from_file(SSH_SESSION *session, const char *filename, } /* same that privatekey_from_file() but without any passphrase things. */ -PRIVATE_KEY *_privatekey_from_file(void *session,char *filename,int type){ +PRIVATE_KEY *_privatekey_from_file(void *session, const char *filename, + int type) { FILE *file=fopen(filename,"r"); PRIVATE_KEY *privkey; #ifdef HAVE_LIBGCRYPT diff --git a/libssh/keys.c b/libssh/keys.c index b1a9cc00..f7cf8e77 100644 --- a/libssh/keys.c +++ b/libssh/keys.c @@ -48,7 +48,7 @@ const char *ssh_type_to_char(int type) { } } -int ssh_type_from_name(char *name) { +int ssh_type_from_name(const char *name) { if (strcmp(name, "rsa1") == 0) { return TYPE_RSA1; } else if (strcmp(name, "rsa") == 0) { diff --git a/libssh/misc.c b/libssh/misc.c index c619530a..3f404fd2 100644 --- a/libssh/misc.c +++ b/libssh/misc.c @@ -95,7 +95,7 @@ char *ssh_get_user_home_dir(void) { #endif /* we have read access on file */ -int ssh_file_readaccess_ok(char *file){ +int ssh_file_readaccess_ok(const char *file){ if(!access(file,R_OK)) return 1; return 0;