quelea-projection / Quelea

Open source projection software for churches.
https://quelea.org
GNU General Public License v3.0
154 stars 145 forks source link

Password bypass #595

Closed JessyJP closed 5 months ago

JessyJP commented 1 year ago

1 We don't need the boolean found variable. Directly return when we find the IP. It's more efficient and we skip the rest of the check on long IP lists. 2 Second, we can introduce an unconditional authentication case. When the case is met we add the device for the next check and return.

I feel the first commit is a must! I think in that case the second commit makes sense given the first. I mean it's a presentation software so at least we should be able to remove the password even it's via notepad at the very least.

Weird I can't open the preference pannel in debug mode and the database doesn't show!

---------- Another option

Now if it's really really important to not have an empty password we can add a checkbox next to the password edit field. The checkbox will be connected to remote.control.require.authentication Then have boolean getRemoteControlRequireAuthentication() and setRemoteControlRequireAuthentication(boolean isRequired). I can do a third commit with the checkbox but I think it's silly to add extra stuff, so as is, is fine.

---------- Also

Also '&& false) {//The empty password check disabled by default ' becomes && getRemoteControlRequireAuthentication() ) {//The empty password check is only enabled when authentication is required Could do it like that too. In that case, enable/disable actually works on the empty check rather than the authentication itself. That's still a valid way of doing it.

JessyJP commented 1 year ago

I mean, most people use a dedicated network and probably don't bother changing the password.

something like this :?

private boolean checkPasswordDisabled(){
  boolean isDisabledState = (QueleaApp.get().getPass().len() == 0) || QueleaApp.get().getSomeCheckboxForDisableedAuthenticationValue();

  if (isDisabledState) {
  addDevice(ip);
  }

  return isDisabledState;
}

or

private logRemoteActicity(String ip, String action/handlerID){
  boolean isDisabledState = (QueleaApp.get().getPass().len() == 0) || QueleaApp.get().getSomeCheckboxForDisableedAuthenticationValue();

  if (isDisabledState && (//is not in the device list)) {
  addDevice(ip);
  }

  addToRemoteHandlerLog(ip, action);// Some function to  track who did what

  return isDisabledState;
}
  1. I wanted to avoid calling one more function or condition every time there was an incoming message.
  2. Or we can rename the function to validateLogin() or something.

Well either way works for me, but then with option 2, all login checks would have to be replaced. Ok, "replace all" in notepadd++ would do but yeah that's the other reason. Also the adding of the device occurs only if that very specific condition is met. Either way you are the main chef and you say what goes in or out of the source soup.