]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86: think-lmi: Add certificate as mechanism
authorMark Pearson <mpearson-lenovo@squebb.ca>
Thu, 24 Oct 2024 19:55:22 +0000 (15:55 -0400)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 29 Oct 2024 11:54:31 +0000 (13:54 +0200)
As both password or certificate authentication are available as mechanisms
update the documentation to add certificate as an option

Update driver to return correct mechanism appropriately.

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20241024195536.6992-2-mpearson-lenovo@squebb.ca
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Documentation/ABI/testing/sysfs-class-firmware-attributes
drivers/platform/x86/think-lmi.c

index 9c82c7b42ff8239e7b2105c5ba28f40dc6e88453..1a8b59f5d6e3a173c4faecc8e9d719adb8d8cbff 100644 (file)
@@ -193,7 +193,7 @@ Description:
 
                mechanism:
                                        The means of authentication.  This attribute is mandatory.
-                                       Only supported type currently is "password".
+                                       Supported types are "password" or "certificate".
 
                max_password_length:
                                        A file that can be read to obtain the
index 727a9400d406a72c6cff4562d98d5eab27f735ec..46ab82fb2898913b81bf3c532d8108af4c5a7455 100644 (file)
@@ -524,6 +524,10 @@ static struct kobj_attribute auth_max_pass_length = __ATTR_RO(max_password_lengt
 static ssize_t mechanism_show(struct kobject *kobj, struct kobj_attribute *attr,
                         char *buf)
 {
+       struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj);
+
+       if (setting->cert_installed)
+               return sysfs_emit(buf, "certificate\n");
        return sysfs_emit(buf, "password\n");
 }
 static struct kobj_attribute auth_mechanism = __ATTR_RO(mechanism);