Improve ssh_message_auth* functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@442 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
61bee4c60c
Коммит
3fab89b22f
@ -80,7 +80,7 @@ void ssh_message_free(SSH_MESSAGE *msg);
|
||||
char *ssh_message_auth_user(SSH_MESSAGE *msg);
|
||||
char *ssh_message_auth_password(SSH_MESSAGE *msg);
|
||||
int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial);
|
||||
void ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
|
||||
int ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
|
||||
|
||||
CHANNEL *ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
|
||||
|
||||
|
@ -211,16 +211,30 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *ssh_message_auth_user(SSH_MESSAGE *msg){
|
||||
return msg->auth_request.username;
|
||||
char *ssh_message_auth_user(SSH_MESSAGE *msg) {
|
||||
if (msg == NULL || msg->auth_request == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return msg->auth_request.username;
|
||||
}
|
||||
|
||||
char *ssh_message_auth_password(SSH_MESSAGE *msg){
|
||||
return msg->auth_request.password;
|
||||
if (msg == NULL || msg->auth_request == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return msg->auth_request.password;
|
||||
}
|
||||
|
||||
void ssh_message_auth_set_methods(SSH_MESSAGE *msg,int methods){
|
||||
msg->session->auth_methods=methods;
|
||||
int ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods) {
|
||||
if (msg == NULL || msg->session == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
msg->session->auth_methods = methods;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ssh_message_auth_reply_default(SSH_MESSAGE *msg,int partial){
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user