lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] module: search the key only by keyid
Date
Latest KEYS code change the way keys identified and module
signing keys are not searchable anymore with original id.

This patch fixes this problem without change module signature
data.

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
---
kernel/module_signing.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/kernel/module_signing.c b/kernel/module_signing.c
index be5b8fa..f329de8 100644
--- a/kernel/module_signing.c
+++ b/kernel/module_signing.c
@@ -134,26 +134,20 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len,
const u8 *key_id, size_t key_id_len)
{
key_ref_t key;
- size_t i;
char *id, *q;

pr_devel("==>%s(,%zu,,%zu)\n", __func__, signer_len, key_id_len);

/* Construct an identifier. */
- id = kmalloc(signer_len + 2 + key_id_len * 2 + 1, GFP_KERNEL);
+ id = kmalloc(2 + 1 + key_id_len * 2 + 1, GFP_KERNEL);
if (!id)
return ERR_PTR(-ENOKEY);

- memcpy(id, signer, signer_len);
-
- q = id + signer_len;
+ q = id;
+ *q++ = 'i';
+ *q++ = 'd';
*q++ = ':';
- *q++ = ' ';
- for (i = 0; i < key_id_len; i++) {
- *q++ = hex_asc[*key_id >> 4];
- *q++ = hex_asc[*key_id++ & 0x0f];
- }
-
+ q = bin2hex(q, key_id, key_id_len);
*q = 0;

pr_debug("Look up: \"%s\"\n", id);
--
1.9.1


\
 
 \ /
  Last update: 2014-10-03 11:41    [W:0.071 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site