So a user would see the different authentication mechanisms availableattributes/*/authentication
by looking At the contents of /sys/class/firmware-
and if they don't understand it's purpose they look at the type sysfs file.
But one role can still have multiple mechanisms, so for Dell in the future
we could have say:
/sys/class/firmware-attributes/dell/authentication/Admin-password
/sys/class/firmware-attributes/dell/authentication/Admin-hotp
/sys/class/firmware-attributes/dell/authentication/System-password
So although I'm fine with taking the role_name directly from WMI
(combined with a roll attribute with standardized values) I think
we still need to postfix a -password to it now, to allow room
for adding say a -hotp mechanism for the same role_name in the
future ?
Could this be captured in the role attribute instead perhaps? So the role
attributes values could hypothetically be:
bios-admin-password
power-on-password
And if HOTP is added some day these could be added:
bios-admin-hotp
power-on-hotp
things###
So as with the actual firmware-attributes I have also been comparing the
authentication
bits for the Dell case with the community thinkpad_wmi code. And again
isare a pretty
good match already, including being able to query a minimum and maximin
password length.
The only thing which is different, which I think would be good to add now,
guessa password_encoding sysfs-attribute. The Lenovo password interface supports
2 encodings, "ascii" and "scancodes". Although I wonder if scancodes still
works on modern UEFI based platforms.
Since the Dell password code uses UTF8 to UTF16 translation routines, I
tothe encoding for the Dell password is UTF8 (at the sysfs level). So I would
like to propose
an extra password-authentication attribute like:
password_encoding: A file that can be read to obtain the encoding used
by
the current_password and new_password attributes.
The value returned should be one of: "utf8", "ascii".
In some cases this may return a vendor-specific encoding
like, e.g. "lenovo-scancodes".
And for the Dell driver this would just be hardcoded to utf8.
I don't really believe that another vendor's implementation would be likely
use scan codes for the input into the WMI method.
I did not make that example up, Lenovo really as a scan-codes encoding for
their password authentication mechanism, see:
https://download.lenovo.com/pccbbs/mobiles_pdf/kbl-r_deploy_01.pdf
The documentation you linked doesn't seem to indicate when to use scancodes or
ASCII to me, so I can't draw any conclusions if certain models support one or
the other.
I would suggest yes please don't support scancodes from the sysfs perspective for
another vendor's implementation. We should probably keep sysfs as utf8 and let
any conversions be hidden in the kernel driver if necessary.
Even then there still is the unicode (utf8
in sysfs, utf16 at the WMI level for Dell) vs ascii issue and it would be nice
if a UI for this could give an error when the user tries to use non ascii
chars in a password for a vendor implementation...
I think that the kernel driver can certainly parse and provide -EINVAL in this
context.
I would much prefer that this attribute only be added if it's actuallydeemed
necessary. Or to my point that all attributes can be considered optional,Dell's
implementation would just not offer it.
I guess that would work (Dell not offering it). Which makes me realize that
we should specify somewhere in the doc that all sysfs files which contain
a string value, the encoding is UTF8 unless explicitly specified otherwise.
(for that specific sysfs-attribute).
Yeah. I guess the very top where we will modify to mention that all attributes
are optional we can also mention that the encoding is UTF8 unless otherwise
specified.