diff options
author | pjd <pjd@FreeBSD.org> | 2005-07-27 22:31:57 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-07-27 22:31:57 +0000 |
commit | 8ecb9be842ecf042f25c94f45ffc6abd0a830d79 (patch) | |
tree | da7e747d2727135f1f58ff8f1020fbc70af82a73 /sys | |
parent | 3f2c6109db5d1497e3f5184fc6f6b074e2ac6b4a (diff) | |
download | FreeBSD-src-8ecb9be842ecf042f25c94f45ffc6abd0a830d79.zip FreeBSD-src-8ecb9be842ecf042f25c94f45ffc6abd0a830d79.tar.gz |
MFp4: Export more informations about encrypted providers.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/eli/g_eli.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index fc97bec..2030380 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -1093,6 +1093,35 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, return; if (pp != NULL || cp != NULL) return; /* Nothing here. */ + sbuf_printf(sb, "%s<Flags>", indent); + if (sc->sc_flags == 0) + sbuf_printf(sb, "NONE"); + else { + int first = 1; + +#define ADD_FLAG(flag, name) do { \ + if ((sc->sc_flags & (flag)) != 0) { \ + if (!first) \ + sbuf_printf(sb, ", "); \ + else \ + first = 0; \ + sbuf_printf(sb, name); \ + } \ +} while (0) + ADD_FLAG(G_ELI_FLAG_ONETIME, "ONETIME"); + ADD_FLAG(G_ELI_FLAG_BOOT, "BOOT"); + ADD_FLAG(G_ELI_FLAG_WO_DETACH, "W-DETACH"); + ADD_FLAG(G_ELI_FLAG_RW_DETACH, "RW-DETACH"); + ADD_FLAG(G_ELI_FLAG_WOPEN, "W-OPEN"); + ADD_FLAG(G_ELI_FLAG_DESTROY, "DESTROY"); +#undef ADD_FLAG + } + sbuf_printf(sb, "</Flags>\n"); + + if ((sc->sc_flags & G_ELI_FLAG_ONETIME) == 0) { + sbuf_printf(sb, "%s<UsedKey>%u</UsedKey>\n", indent, + sc->sc_nkey); + } sbuf_printf(sb, "%s<Crypto>", indent); switch (sc->sc_crypto) { case G_ELI_CRYPTO_HW: @@ -1106,6 +1135,9 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, break; } sbuf_printf(sb, "</Crypto>\n"); + sbuf_printf(sb, "%s<KeyLength>%u</KeyLength>\n", indent, sc->sc_keylen); + sbuf_printf(sb, "%s<Cipher>%s</Cipher>\n", indent, + g_eli_algo2str(sc->sc_algo)); } static void |