messages: Check that the requested service is 'ssh-connection'

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 9c200d3ef4)
This commit is contained in:
Andreas Schneider
2018-10-19 11:40:44 +02:00
parent e5cee205c1
commit e8f3207a0d

View File

@@ -704,6 +704,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
ssh_message msg = NULL;
char *service = NULL;
char *method = NULL;
int cmp;
int rc;
(void)user;
@@ -730,6 +731,13 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
service, method,
msg->auth_request.username);
cmp = strcmp(service, "ssh-connection");
if (cmp != 0) {
SSH_LOG(SSH_LOG_WARNING,
"Invalid service request: %s",
service);
goto end;
}
if (strcmp(method, "none") == 0) {
msg->auth_request.method = SSH_AUTH_METHOD_NONE;