summaryrefslogtreecommitdiffstats
path: root/lib/types
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2019-02-15 10:39:30 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2019-03-06 09:54:10 +1300
commit5f8fa2c151b8f0e568dc4015b7d307250b354a04 (patch)
tree70f626a58f3f83c53dfb0194bbcf77584dbdf00a /lib/types
parentba8144f917f5603e507e9c72aed4ae3257c6b0ce (diff)
downloadtalos-petitboot-5f8fa2c151b8f0e568dc4015b7d307250b354a04.tar.gz
talos-petitboot-5f8fa2c151b8f0e568dc4015b7d307250b354a04.zip
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 <sam@mendozajonas.com>
Diffstat (limited to 'lib/types')
-rw-r--r--lib/types/types.c6
-rw-r--r--lib/types/types.h1
2 files changed, 7 insertions, 0 deletions
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;
}
diff --git a/lib/types/types.h b/lib/types/types.h
index 9d83d87..433a37b 100644
--- a/lib/types/types.h
+++ b/lib/types/types.h
@@ -11,6 +11,7 @@ enum device_type {
DEVICE_TYPE_USB,
DEVICE_TYPE_OPTICAL,
DEVICE_TYPE_ANY,
+ DEVICE_TYPE_LUKS,
DEVICE_TYPE_UNKNOWN,
};
OpenPOWER on IntegriCloud