Use const where it should be used.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@407 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
db4ff30f38
Коммит
6c6094538f
@ -515,7 +515,7 @@ void ssh_set_error(void *error, int code, const char *descr, ...) PRINTF_ATTRIBU
|
|||||||
/* in dh.c */
|
/* in dh.c */
|
||||||
/* DH key generation */
|
/* DH key generation */
|
||||||
void dh_generate_e(SSH_SESSION *session);
|
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_x(SSH_SESSION *session);
|
||||||
void dh_generate_y(SSH_SESSION *session);
|
void dh_generate_y(SSH_SESSION *session);
|
||||||
void dh_generate_f(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 */
|
/* 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 */
|
/* in keys.c */
|
||||||
const char *ssh_type_to_char(int type);
|
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_dss(SSH_SESSION *session, BUFFER *buffer);
|
||||||
PRIVATE_KEY *privatekey_make_rsa(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);
|
PRIVATE_KEY *privatekey_from_string(SSH_SESSION *session, STRING *privkey_s);
|
||||||
|
|
||||||
PUBLIC_KEY *publickey_make_dss(SSH_SESSION *session, BUFFER *buffer);
|
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);
|
u32 ssh_crc32(char *buffer, int len);
|
||||||
|
|
||||||
/* auth1.c */
|
/* auth1.c */
|
||||||
int ssh_userauth1_none(SSH_SESSION *session, char *username);
|
int ssh_userauth1_none(SSH_SESSION *session, const char *username);
|
||||||
int ssh_userauth1_offer_pubkey(SSH_SESSION *session, char *username,
|
int ssh_userauth1_offer_pubkey(SSH_SESSION *session, const char *username,
|
||||||
int type, STRING *pubkey);
|
int type, STRING *pubkey);
|
||||||
int ssh_userauth1_password(SSH_SESSION *session, char *username,
|
int ssh_userauth1_password(SSH_SESSION *session, const char *username,
|
||||||
char *password);
|
const char *password);
|
||||||
/* in misc.c */
|
/* in misc.c */
|
||||||
/* gets the user home dir. */
|
/* gets the user home dir. */
|
||||||
char *ssh_get_user_home_dir(void);
|
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 */
|
/* macro for byte ordering */
|
||||||
u64 ntohll(u64);
|
u64 ntohll(u64);
|
||||||
|
@ -128,7 +128,7 @@ void ssh_crypto_finalize(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* prints the bignum on stderr */
|
/* 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
|
#ifdef HAVE_LIBGCRYPT
|
||||||
unsigned char *hex;
|
unsigned char *hex;
|
||||||
bignum_bn2hex(num,&hex);
|
bignum_bn2hex(num,&hex);
|
||||||
|
@ -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. */
|
/* 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");
|
FILE *file=fopen(filename,"r");
|
||||||
PRIVATE_KEY *privkey;
|
PRIVATE_KEY *privkey;
|
||||||
#ifdef HAVE_LIBGCRYPT
|
#ifdef HAVE_LIBGCRYPT
|
||||||
|
@ -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) {
|
if (strcmp(name, "rsa1") == 0) {
|
||||||
return TYPE_RSA1;
|
return TYPE_RSA1;
|
||||||
} else if (strcmp(name, "rsa") == 0) {
|
} else if (strcmp(name, "rsa") == 0) {
|
||||||
|
@ -95,7 +95,7 @@ char *ssh_get_user_home_dir(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* we have read access on file */
|
/* 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))
|
if(!access(file,R_OK))
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user