Skip to content

reversed logic when checking for service == "ssh-connection" in src/svr-auth.c #397

Description

@turistu

https://github.com/mkj/dropbear/blame/4214d7c3954e85bc7a6e83bdc4407b3dc003453d/src/svr-auth.c#L102

That AND should an OR. As it stands now, that will not exit if servicename is angle-grinders (same length as ssh-connection) or ssh-connection-with-handlebars (same prefix):

	/* only handle 'ssh-connection' currently */
	if (servicelen != SSH_SERVICE_CONNECTION_LEN
			&& (strncmp(servicename, SSH_SERVICE_CONNECTION,
					SSH_SERVICE_CONNECTION_LEN) != 0)) {
		
		/* TODO - disconnect here */
[...]
		dropbear_exit("unknown service in auth");
	}

Or even better, you could

#define STR_NOT_EQ(a, b)  (strcmp(a, b))
...
  if(STR_NOT_EQ(servicename,  SSH_SERVICE_CONNECTION)){ ... bail out ...}

Or just remove that check completely and ignore what servicename says ;-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions