Discussion:
[PATCH v2 0/3] Display module signature information in modinfo
Michal Marek
2013-01-17 07:51:49 UTC
Permalink
Hi,

this makes modinfo aware of CONFIG_MODULE_SIG signed modules.
Changes in v2:
* Updated kmod_module_get_info() documentation
* In error case, free the module_info list in kmod_module_get_info()
* Make kmod_module_signature_info() return bool
* Added a testcase

Note: I am not sending the testcase patch for size reasons, please pull
it from git.kernel.org.

Note2: I tried to send this yesterday, but it seems it got rejected by vger.
Sorry if you now got the emails twice.

The following changes since commit f64458cab522670135950adc4b04f18df20ae947:

libkmod-module: Add helper for building the module info list (2013-01-16 09:53:46 -0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kmod.git modinfo-signature2

for you to fetch changes up to 6f3327737f5009ada9334950446c358f9dd55bc2:

testsuite: Add modinfo test for module signatures (2013-01-16 21:11:14 +0100)
Michal Marek (3):
libkmod-module: Do not free the list in kmod_module_info_append
libkmod: Return module signature information in
kmod_module_get_info()
testsuite: Add modinfo test for module signatures

Makefile.am | 3 +-
libkmod/libkmod-module.c | 60 +++++++--
libkmod/libkmod-private.h | 9 ++
libkmod/libkmod-signature.c | 141 ++++++++++++++++++++
testsuite/rootfs-pristine/test-modinfo/correct.txt | 24 ++++
.../test-modinfo/ext4-x86_64-sha1.ko | Bin 0 -> 729451 bytes
.../test-modinfo/ext4-x86_64-sha256.ko | Bin 0 -> 729451 bytes
testsuite/test-modinfo.c | 3 +-
8 files changed, 230 insertions(+), 10 deletions(-)
create mode 100644 libkmod/libkmod-signature.c
create mode 100644 testsuite/rootfs-pristine/test-modinfo/ext4-x86_64-sha1.ko
create mode 100644 testsuite/rootfs-pristine/test-modinfo/ext4-x86_64-sha256.ko
--
1.7.10.4
Michal Marek
2013-01-17 07:51:51 UTC
Permalink
If the module is built with CONFIG_MODULE_SIG, add the the signer's
name, hexadecimal key id and hash algorithm to the list returned in
kmod_module_get_info(). The modinfo output then looks like this:

filename: /home/mmarek/kmod/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64-sha256.ko
license: GPL
description: Fourth Extended Filesystem
author: Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
alias: ext3
alias: ext2
depends: mbcache,jbd2
intree: Y
vermagic: 3.7.0 SMP mod_unload
signer: Magrathea: Glacier signing key
sig_key: E3:C8:FC:A7:3F:B3:1D:DE:84:81:EF:38:E3:4C:DE:4B:0C:FD:1B:F9
sig_hashalgo: sha256

The signature algorithm (RSA) and key identifier type (X509) are not
displayed, because they are constant information for every signed
module. But it would be trivial to add this. Note: No attempt is made at
verifying the signature, I don't think that modinfo is the right tool
for this.
---
Makefile.am | 3 +-
libkmod/libkmod-module.c | 45 +++++++++++++-
libkmod/libkmod-private.h | 9 +++
libkmod/libkmod-signature.c | 141 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 196 insertions(+), 2 deletions(-)
create mode 100644 libkmod/libkmod-signature.c

diff --git a/Makefile.am b/Makefile.am
index 995f2de..9feaf96 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,7 +62,8 @@ libkmod_libkmod_la_SOURCES =\
libkmod/libkmod-index.h \
libkmod/libkmod-module.c \
libkmod/libkmod-file.c \
- libkmod/libkmod-elf.c
+ libkmod/libkmod-elf.c \
+ libkmod/libkmod-signature.c

EXTRA_DIST += libkmod/libkmod.sym
EXTRA_DIST += libkmod/README libkmod/COPYING testsuite/COPYING COPYING
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index d7d6938..70ddeab 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -2120,7 +2120,9 @@ static struct kmod_list *kmod_module_info_append(struct kmod_list **list, const
*
* Get a list of entries in ELF section ".modinfo", these contain
* alias, license, depends, vermagic and other keys with respective
- * values.
+ * values. If the module is signed (CONFIG_MODULE_SIG), information
+ * about the module signature is included as well: signer,
+ * sig_key and sig_hashalgo.
*
* After use, free the @list by calling kmod_module_info_free_list().
*
@@ -2131,6 +2133,7 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
struct kmod_elf *elf;
char **strings;
int i, count, ret = -ENOMEM;
+ struct kmod_signature_info sig_info;

if (mod == NULL || list == NULL)
return -ENOENT;
@@ -2165,6 +2168,46 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
if (n == NULL)
goto list_error;
}
+
+ if (kmod_module_signature_info(mod->file, &sig_info)) {
+ struct kmod_list *n;
+ char *key_hex;
+
+ n = kmod_module_info_append(list, "signer", strlen("signer"),
+ sig_info.signer, sig_info.signer_len);
+ if (n == NULL)
+ goto list_error;
+ count++;
+
+ /* Display the key id as 01:12:DE:AD:BE:EF:... */
+ key_hex = malloc(sig_info.key_id_len * 3);
+ if (key_hex == NULL)
+ goto list_error;
+ for (i = 0; i < (int)sig_info.key_id_len; i++) {
+ sprintf(key_hex + i * 3, "%02X",
+ (unsigned char)sig_info.key_id[i]);
+ if (i < (int)sig_info.key_id_len - 1)
+ key_hex[i * 3 + 2] = ':';
+ }
+ n = kmod_module_info_append(list, "sig_key", strlen("sig_key"),
+ key_hex, sig_info.key_id_len * 3 - 1);
+ free(key_hex);
+ if (n == NULL)
+ goto list_error;
+ count++;
+
+ n = kmod_module_info_append(list,
+ "sig_hashalgo", strlen("sig_hashalgo"),
+ sig_info.hash_algo, strlen(sig_info.hash_algo));
+ if (n == NULL)
+ goto list_error;
+ count++;
+
+ /*
+ * Omit sig_info.id_type and sig_info.algo for now, as these
+ * are currently constant.
+ */
+ }
ret = count;

list_error:
diff --git a/libkmod/libkmod-private.h b/libkmod/libkmod-private.h
index 4760733..b472c62 100644
--- a/libkmod/libkmod-private.h
+++ b/libkmod/libkmod-private.h
@@ -168,5 +168,14 @@ int kmod_elf_strip_vermagic(struct kmod_elf *elf) _must_check_ __attribute__((no
*/
int kmod_elf_get_section(const struct kmod_elf *elf, const char *section, const void **buf, uint64_t *buf_size) _must_check_ __attribute__((nonnull(1,2,3,4)));

+/* libkmod-signature.c */
+struct kmod_signature_info {
+ const char *signer;
+ size_t signer_len;
+ const char *key_id;
+ size_t key_id_len;
+ const char *algo, *hash_algo, *id_type;
+};
+bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signature_info *sig_info) _must_check_ __attribute__((nonnull(1, 2)));
/* util functions */
#include "libkmod-util.h"
diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
new file mode 100644
index 0000000..6b80caa
--- /dev/null
+++ b/libkmod/libkmod-signature.c
@@ -0,0 +1,141 @@
+/*
+ * libkmod - module signature display
+ *
+ * Copyright (C) 2013 Michal Marek, SUSE
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <endian.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "libkmod-private.h"
+
+/* These types and tables were copied from the 3.7 kernel sources.
+ * As this is just description of the signature format, it should not be
+ * considered derived work (so libkmod can use the LGPL license).
+ */
+enum pkey_algo {
+ PKEY_ALGO_DSA,
+ PKEY_ALGO_RSA,
+ PKEY_ALGO__LAST
+};
+
+static const char *const pkey_algo[PKEY_ALGO__LAST] = {
+ [PKEY_ALGO_DSA] = "DSA",
+ [PKEY_ALGO_RSA] = "RSA",
+};
+
+enum pkey_hash_algo {
+ PKEY_HASH_MD4,
+ PKEY_HASH_MD5,
+ PKEY_HASH_SHA1,
+ PKEY_HASH_RIPE_MD_160,
+ PKEY_HASH_SHA256,
+ PKEY_HASH_SHA384,
+ PKEY_HASH_SHA512,
+ PKEY_HASH_SHA224,
+ PKEY_HASH__LAST
+};
+
+const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
+ [PKEY_HASH_MD4] = "md4",
+ [PKEY_HASH_MD5] = "md5",
+ [PKEY_HASH_SHA1] = "sha1",
+ [PKEY_HASH_RIPE_MD_160] = "rmd160",
+ [PKEY_HASH_SHA256] = "sha256",
+ [PKEY_HASH_SHA384] = "sha384",
+ [PKEY_HASH_SHA512] = "sha512",
+ [PKEY_HASH_SHA224] = "sha224",
+};
+
+enum pkey_id_type {
+ PKEY_ID_PGP, /* OpenPGP generated key ID */
+ PKEY_ID_X509, /* X.509 arbitrary subjectKeyIdentifier */
+ PKEY_ID_TYPE__LAST
+};
+
+const char *const pkey_id_type[PKEY_ID_TYPE__LAST] = {
+ [PKEY_ID_PGP] = "PGP",
+ [PKEY_ID_X509] = "X509",
+};
+
+/*
+ * Module signature information block.
+ *
+ * The constituents of the signature section are, in order:
+ *
+ * - Signer's name
+ * - Key identifier
+ * - Signature data
+ * - Information block
+ */
+struct module_signature {
+ uint8_t algo; /* Public-key crypto algorithm [enum pkey_algo] */
+ uint8_t hash; /* Digest algorithm [enum pkey_hash_algo] */
+ uint8_t id_type; /* Key identifier type [enum pkey_id_type] */
+ uint8_t signer_len; /* Length of signer's name */
+ uint8_t key_id_len; /* Length of key identifier */
+ uint8_t __pad[3];
+ uint32_t sig_len; /* Length of signature data (big endian) */
+};
+
+#define SIG_MAGIC "~Module signature appended~\n"
+
+bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signature_info *sig_info)
+{
+ const char *mem;
+ off_t size;
+ const struct module_signature *modsig;
+ size_t sig_len;
+
+
+ size = kmod_file_get_size(file);
+ mem = kmod_file_get_contents(file);
+ if (size < (off_t)strlen(SIG_MAGIC))
+ return false;
+ size -= strlen(SIG_MAGIC);
+ if (memcmp(SIG_MAGIC, mem + size, strlen(SIG_MAGIC)) != 0)
+ return false;
+
+ if (size < (off_t)sizeof(struct module_signature))
+ return false;
+ size -= sizeof(struct module_signature);
+ modsig = (struct module_signature *)(mem + size);
+ if (modsig->algo >= PKEY_ALGO__LAST ||
+ modsig->hash >= PKEY_HASH__LAST ||
+ modsig->id_type >= PKEY_ID_TYPE__LAST)
+ return false;
+ sig_len = be32toh(modsig->sig_len);
+ if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len))
+ return false;
+
+ size -= modsig->key_id_len + sig_len;
+ sig_info->key_id = mem + size;
+ sig_info->key_id_len = modsig->key_id_len;
+
+ size -= modsig->signer_len;
+ sig_info->signer = mem + size;
+ sig_info->signer_len = modsig->signer_len;
+
+ sig_info->algo = pkey_algo[modsig->algo];
+ sig_info->hash_algo = pkey_hash_algo[modsig->hash];
+ sig_info->id_type = pkey_id_type[modsig->id_type];
+
+ return true;
+}
--
1.7.10.4
Michal Marek
2013-01-17 07:51:50 UTC
Permalink
In error case, just return NULL and let the caller free the list.
---
libkmod/libkmod-module.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index ae0d9c8..d7d6938 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -2100,16 +2100,13 @@ static struct kmod_list *kmod_module_info_append(struct kmod_list **list, const
struct kmod_list *n;

info = kmod_module_info_new(key, keylen, value, valuelen);
- if (info == NULL) {
- kmod_module_info_free_list(*list);
+ if (info == NULL)
return NULL;
- }
n = kmod_list_append(*list, info);
- if (n == NULL) {
+ if (n != NULL)
+ *list = n;
+ else
kmod_module_info_free(info);
- kmod_module_info_free_list(*list);
- }
- *list = n;
return n;
}

@@ -2171,6 +2168,10 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
ret = count;

list_error:
+ if (ret < 0) {
+ kmod_module_info_free_list(*list);
+ *list = NULL;
+ }
free(strings);
return ret;
}
--
1.7.10.4
Lucas De Marchi
2013-01-18 01:55:14 UTC
Permalink
Hi Michal,
Post by Michal Marek
Hi,
this makes modinfo aware of CONFIG_MODULE_SIG signed modules.
* Updated kmod_module_get_info() documentation
* In error case, free the module_info list in kmod_module_get_info()
* Make kmod_module_signature_info() return bool
* Added a testcase
Note: I am not sending the testcase patch for size reasons, please pull
it from git.kernel.org.
libkmod-module: Add helper for building the module info list (2013-01-16 09:53:46 -0200)
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kmod.git modinfo-signature2
testsuite: Add modinfo test for module signatures (2013-01-16 21:11:14 +0100)
libkmod-module: Do not free the list in kmod_module_info_append
libkmod: Return module signature information in
kmod_module_get_info()
testsuite: Add modinfo test for module signatures
All patches have been applied. Thanks.


Lucas De Marchi
Michal Marek
2013-01-18 12:11:17 UTC
Permalink
Post by Lucas De Marchi
Hi Michal,
Post by Michal Marek
Hi,
this makes modinfo aware of CONFIG_MODULE_SIG signed modules.
* Updated kmod_module_get_info() documentation
* In error case, free the module_info list in kmod_module_get_info()
* Make kmod_module_signature_info() return bool
* Added a testcase
Note: I am not sending the testcase patch for size reasons, please pull
it from git.kernel.org.
libkmod-module: Add helper for building the module info list (2013-01-16 09:53:46 -0200)
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kmod.git modinfo-signature2
testsuite: Add modinfo test for module signatures (2013-01-16 21:11:14 +0100)
libkmod-module: Do not free the list in kmod_module_info_append
libkmod: Return module signature information in
kmod_module_get_info()
testsuite: Add modinfo test for module signatures
All patches have been applied. Thanks.
Thanks a lot!

Michal
David Howells
2013-01-18 17:02:11 UTC
Permalink
Post by Michal Marek
The signature algorithm (RSA) and key identifier type (X509) are not
displayed, because they are constant information for every signed
module.
That's not necessarily so. Say, for example, a third party open source vendor
like the OpenAFS project released their own signed module to be used against
someone else's kernel...

David
Michal Marek
2013-01-18 23:04:25 UTC
Permalink
Post by David Howells
Post by Michal Marek
The signature algorithm (RSA) and key identifier type (X509) are not
displayed, because they are constant information for every signed
module.
That's not necessarily so. Say, for example, a third party open source vendor
like the OpenAFS project released their own signed module to be used against
someone else's kernel...
But somebody else's kernel will still only support RSA and X.509 for
module signatures, won't it? Or are there kernels that also support DSA
or PGP?

Michal
David Howells
2013-01-18 23:18:52 UTC
Permalink
Post by Michal Marek
Post by David Howells
That's not necessarily so. Say, for example, a third party open source
vendor like the OpenAFS project released their own signed module to be
used against someone else's kernel...
But somebody else's kernel will still only support RSA and X.509 for
module signatures, won't it? Or are there kernels that also support DSA
or PGP?
Sorry, I misread what you wrote. It is possible we might support Elliptic
Curve at some point.

David
Michal Marek
2013-01-21 14:29:57 UTC
Permalink
Post by David Howells
Post by Michal Marek
Post by David Howells
That's not necessarily so. Say, for example, a third party open source
vendor like the OpenAFS project released their own signed module to be
used against someone else's kernel...
But somebody else's kernel will still only support RSA and X.509 for
module signatures, won't it? Or are there kernels that also support DSA
or PGP?
Sorry, I misread what you wrote. It is possible we might support Elliptic
Curve at some point.
So do you think that it makes sense to display the name of the signature
algorithm in modinfo?

Thanks,
Michal
David Howells
2013-01-21 14:32:53 UTC
Permalink
Post by Michal Marek
So do you think that it makes sense to display the name of the signature
algorithm in modinfo?
It's perhaps not doing it for now - or only do it if it's not X.509 and RSA
perhaps.

David
Michal Marek
2013-01-21 15:10:44 UTC
Permalink
Post by David Howells
Post by Michal Marek
So do you think that it makes sense to display the name of the signature
algorithm in modinfo?
It's perhaps not doing it for now - or only do it if it's not X.509 and RSA
perhaps.
Like this?
Post by David Howells
From 6d7d34cff635e9d3689c9eebb1d440f2ce0dc72d Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek-***@public.gmane.org>
Date: Mon, 21 Jan 2013 15:59:37 +0100
Subject: [PATCH] libkmod: Return unknown signature information as "unknown"

This helps in case the kernel supports more module signature types in
the future. For the same reason, return the signature algorithm name
and the identifier type if it is different than RSA and X509,
respectively.
---
libkmod/libkmod-module.c | 24 +++++++++++++++++++-----
libkmod/libkmod-signature.c | 26 +++++++++++++++++++-------
2 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index b1d40b1..6dba389 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -2122,7 +2122,8 @@ static struct kmod_list *kmod_module_info_append(struct kmod_list **list, const
* alias, license, depends, vermagic and other keys with respective
* values. If the module is signed (CONFIG_MODULE_SIG), information
* about the module signature is included as well: signer,
- * sig_key and sig_hashalgo.
+ * sig_key, sig_hashalgo, and, if different from the default values "RSA"
+ * and "X509", sig_algo and sig_idtype.
*
* After use, free the @list by calling kmod_module_info_free_list().
*
@@ -2196,6 +2197,15 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
goto list_error;
count++;

+ if (sig_info.algo) {
+ n = kmod_module_info_append(list,
+ "sig_algo", strlen("sig_algo"),
+ sig_info.algo, strlen(sig_info.algo));
+ if (n == NULL)
+ goto list_error;
+ count++;
+ }
+
n = kmod_module_info_append(list,
"sig_hashalgo", strlen("sig_hashalgo"),
sig_info.hash_algo, strlen(sig_info.hash_algo));
@@ -2203,10 +2213,14 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
goto list_error;
count++;

- /*
- * Omit sig_info.id_type and sig_info.algo for now, as these
- * are currently constant.
- */
+ if (sig_info.id_type) {
+ n = kmod_module_info_append(list,
+ "sig_idtype", strlen("sig_idtype"),
+ sig_info.id_type, strlen(sig_info.id_type));
+ if (n == NULL)
+ goto list_error;
+ count++;
+ }
}
ret = count;

diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
index 6b80caa..2e4c9bf 100644
--- a/libkmod/libkmod-signature.c
+++ b/libkmod/libkmod-signature.c
@@ -117,10 +117,6 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
return false;
size -= sizeof(struct module_signature);
modsig = (struct module_signature *)(mem + size);
- if (modsig->algo >= PKEY_ALGO__LAST ||
- modsig->hash >= PKEY_HASH__LAST ||
- modsig->id_type >= PKEY_ID_TYPE__LAST)
- return false;
sig_len = be32toh(modsig->sig_len);
if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len))
return false;
@@ -133,9 +129,25 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
sig_info->signer = mem + size;
sig_info->signer_len = modsig->signer_len;

- sig_info->algo = pkey_algo[modsig->algo];
- sig_info->hash_algo = pkey_hash_algo[modsig->hash];
- sig_info->id_type = pkey_id_type[modsig->id_type];
+ if (modsig->algo == PKEY_ALGO_RSA)
+ /*
+ * Current kernels only support RSA, exclude it to not
+ * pollute modinfo output with obvious information.
+ */
+ sig_info->algo = NULL;
+ else
+ sig_info->algo = modsig->algo < PKEY_ALGO__LAST ?
+ pkey_algo[modsig->algo] : "unknown";
+
+ sig_info->hash_algo = modsig->hash < PKEY_HASH__LAST ?
+ pkey_hash_algo[modsig->hash] : "unknown";
+
+ if (modsig->id_type == PKEY_ID_X509)
+ /* Current kernels only support X.509. */
+ sig_info->id_type = NULL;
+ else
+ sig_info->id_type = modsig->id_type < PKEY_ID_TYPE__LAST ?
+ pkey_id_type[modsig->id_type] : "unknown";

return true;
}
--
1.7.10.4
David Howells
2013-01-21 15:31:29 UTC
Permalink
Post by Michal Marek
+ if (sig_info.algo) {
I wouldn't compare against 0.

my $algo = 1; # Public-key crypto algorithm: RSA
Post by Michal Marek
+ if (sig_info.id_type) {
my $id_type = 1; # Identifier type: X.509

Though I'd compare against PKEY_ALGO_RSA and PKEY_ID_X509 if they're available
to you rather than 1 and 1.

David
Michal Marek
2013-01-21 15:49:12 UTC
Permalink
Post by Michal Marek
+ if (sig_info.algo) {
struct kmod_signature_info is the textual representation already. The
libkmod/libkmod-signature.c file has copies of the PKEY_* enums and the
patch checks for PKEY_ALGO_RSA and PKEY_ID_X509:

+ if (modsig->algo == PKEY_ALGO_RSA)
+ /*
+ * Current kernels only support RSA, exclude it to not
+ * pollute modinfo output with obvious information.
+ */
+ sig_info->algo = NULL;
+ else
+ sig_info->algo = modsig->algo < PKEY_ALGO__LAST ?
+ pkey_algo[modsig->algo] : "unknown";
...
+ if (modsig->id_type == PKEY_ID_X509)
+ /* Current kernels only support X.509. */
+ sig_info->id_type = NULL;
+ else
+ sig_info->id_type = modsig->id_type < PKEY_ID_TYPE__LAST ?
+ pkey_id_type[modsig->id_type] : "unknown";

Michal
David Howells
2013-01-21 16:00:45 UTC
Permalink
Post by Michal Marek
struct kmod_signature_info is the textual representation already. The
libkmod/libkmod-signature.c file has copies of the PKEY_* enums and the
Okay then.

David
Lucas De Marchi
2013-03-05 17:37:28 UTC
Permalink
Hi David and Michal
Post by David Howells
Post by Michal Marek
So do you think that it makes sense to display the name of the signature
algorithm in modinfo?
It's perhaps not doing it for now - or only do it if it's not X.509 and RSA
perhaps.
I missed this discussion while I was on vacations. I prefer the
"perhaps not doing it for now". If a third party support other
algorithms let them carry a patch to kmod too.

The day it's in mainline is the day a similar patch is accepted in kmod.

Lucas De Marchi

Loading...