From 5f8fa2c151b8f0e568dc4015b7d307250b354a04 Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Fri, 15 Feb 2019 10:39:30 +1100 Subject: lib: Add AUTH_MSG_DECRYPT Extend the auth_message struct to support the AUTH_MSG_DECRYPT operation, allowing the existing authentications methods to be used for passing a disk password from the UI to pb-discover. In addition add DEVICE_TYPE_LUKS to identify encrypted disk devices. Signed-off-by: Samuel Mendoza-Jonas --- lib/types/types.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/types/types.c') diff --git a/lib/types/types.c b/lib/types/types.c index d7f4ead..f4510e1 100644 --- a/lib/types/types.c +++ b/lib/types/types.c @@ -35,6 +35,8 @@ const char *device_type_display_name(enum device_type type) return _("Network"); case DEVICE_TYPE_ANY: return _("Any"); + case DEVICE_TYPE_LUKS: + return _("Encrypted Device"); case DEVICE_TYPE_UNKNOWN: default: return _("Unknown"); @@ -54,6 +56,8 @@ const char *device_type_name(enum device_type type) return "network"; case DEVICE_TYPE_ANY: return "any"; + case DEVICE_TYPE_LUKS: + return "encrypted"; case DEVICE_TYPE_UNKNOWN: default: return "unknown"; @@ -72,6 +76,8 @@ enum device_type find_device_type(const char *str) return DEVICE_TYPE_NETWORK; if (!strncmp(str, "any", strlen("any"))) return DEVICE_TYPE_ANY; + if (!strncmp(str, "encrypted", strlen("encrypted"))) + return DEVICE_TYPE_LUKS; return DEVICE_TYPE_UNKNOWN; } -- cgit v1.2.1