1
1
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@396 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
Andreas Schneider 2009-04-05 10:00:41 +00:00
родитель b7c65baef3
Коммит f8ef75c510
3 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -179,7 +179,7 @@ typedef struct kex_struct {
struct public_key_struct { struct public_key_struct {
int type; int type;
char *type_c; /* Don't free it ! it is static */ const char *type_c; /* Don't free it ! it is static */
#ifdef HAVE_LIBGCRYPT #ifdef HAVE_LIBGCRYPT
gcry_sexp_t dsa_pub; gcry_sexp_t dsa_pub;
gcry_sexp_t rsa_pub; gcry_sexp_t rsa_pub;
@ -577,7 +577,7 @@ char *ssh_find_matching(const char *in_d, const char *what_d);
PRIVATE_KEY *_privatekey_from_file(void *session,char *filename,int type); PRIVATE_KEY *_privatekey_from_file(void *session,char *filename,int type);
/* in keys.c */ /* in keys.c */
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(char *name);
PRIVATE_KEY *privatekey_make_dss(SSH_SESSION *session, BUFFER *buffer); PRIVATE_KEY *privatekey_make_dss(SSH_SESSION *session, BUFFER *buffer);
@ -586,7 +586,7 @@ PRIVATE_KEY *privatekey_make_rsa(SSH_SESSION *session, BUFFER *buffer,
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);
PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, BUFFER *buffer,char *type); PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, BUFFER *buffer, const char *type);
PUBLIC_KEY *publickey_from_string(SSH_SESSION *session, STRING *pubkey_s); PUBLIC_KEY *publickey_from_string(SSH_SESSION *session, STRING *pubkey_s);
SIGNATURE *signature_from_string(SSH_SESSION *session, STRING *signature,PUBLIC_KEY *pubkey,int needed_type); SIGNATURE *signature_from_string(SSH_SESSION *session, STRING *signature,PUBLIC_KEY *pubkey,int needed_type);
void signature_free(SIGNATURE *sign); void signature_free(SIGNATURE *sign);

Просмотреть файл

@ -744,8 +744,8 @@ STRING *publickey_from_next_file(SSH_SESSION *session, const char **pub_keys_pat
static char *home=NULL; static char *home=NULL;
char public[256]; char public[256];
char private[256]; char private[256];
char *priv; const char *priv;
char *pub; const char *pub;
STRING *pubkey; STRING *pubkey;
if(!home) if(!home)
home=ssh_get_user_home_dir(); home=ssh_get_user_home_dir();
@ -843,7 +843,8 @@ static void tokens_free(char **tokens) {
* \returns found_type type of key (ie "dsa","ssh-rsa1"). Don't free that value. * \returns found_type type of key (ie "dsa","ssh-rsa1"). Don't free that value.
*/ */
static char **ssh_get_knownhost_line(SSH_SESSION *session,FILE **file, char *filename,char **found_type){ static char **ssh_get_knownhost_line(SSH_SESSION *session, FILE **file,
const char *filename, const char **found_type) {
char buffer[4096]; char buffer[4096];
char *ptr; char *ptr;
char **tokens; char **tokens;
@ -1057,7 +1058,7 @@ int ssh_is_server_known(SSH_SESSION *session){
char **tokens; char **tokens;
char *host; char *host;
char *type; const char *type;
int match; int match;
FILE *file=NULL; FILE *file=NULL;
int ret=SSH_SERVER_NOT_KNOWN; int ret=SSH_SERVER_NOT_KNOWN;

Просмотреть файл

@ -36,7 +36,7 @@
*/ */
/* Public key decoding functions */ /* Public key decoding functions */
char *ssh_type_to_char(int type){ const char *ssh_type_to_char(int type) {
switch(type){ switch(type){
case TYPE_DSS: case TYPE_DSS:
return "ssh-dss"; return "ssh-dss";
@ -111,7 +111,8 @@ PUBLIC_KEY *publickey_make_dss(SSH_SESSION *session, BUFFER *buffer){
return key; return key;
} }
PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, BUFFER *buffer, char *type){ PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, BUFFER *buffer,
const char *type) {
STRING *e,*n; STRING *e,*n;
PUBLIC_KEY *key; PUBLIC_KEY *key;