Duet3D / PanelDueFirmware

Firmware for the PanelDue touch screen for 3D printers
Other
165 stars 84 forks source link

Implement password protected screen locking #169

Open mfs12 opened 3 years ago

mfs12 commented 3 years ago
dc42 commented 3 years ago

The primary requirement I am aware of is to operate in a mode in which the display works but you can't enter any commands. I will call this Command Locked mode. Here is a possible outline specification:

mfs12 commented 3 years ago

@dc42

Have a facility to set and store a password or PIN. This could be stored in flash memory or PanelDue, or perhaps in config.g and sent to PanelDue.

RRF already has a password. Would it make sense to re-use that? then there would be only one password for the system. And the recovery can be done completely with existing infrastructure. Checking with the gcodes, i realized there's not yet a command to verify the password but only to set it.

mfs12 commented 3 years ago

I think either everything is configured and handled in RRF, i.e. password, command locking / normal mode, timeout, which is then provided via OM or everything is handled by PD. The latter is my preferred one. I think only the password might be handled still by RRF so there's always a "simple" way of recovery using an already established workflow.

And i would prefer not to bother RRF with all this stuff, except eventually the password. I am still undecided about this point. I think it would be even ok to store the password in PD's flash. Isn't it erased anyway when a new firmware is flashed? Just checked. Not it isn't erased. Can this be erased with bossa?

dc42 commented 3 years ago

The present RRF password scheme is insecure in that the password appears in plain text in config.g. Although we are not looking for high security, I think we should do better for this feature. One possibility is that we add a command to set the PanelDue password (e.g. M551 with a S parameter to specify which password is being set), then we send a salted hash of that password to PanelDue, which stores it in NVM if it is different from the one already stored. That means users do not have to put that command in config.g.

mfs12 commented 2 years ago

Related to #71.