integrity: do zero padding of the key id
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Mon, 6 Oct 2014 16:31:58 +0000 (17:31 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 6 Oct 2014 16:33:27 +0000 (17:33 +0100)
Latest KEYS code return error if hexadecimal string length id odd.
Fix it.

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: David Howells <dhowells@redhat.com>
security/integrity/digsig_asymmetric.c

index 37e0d98517a89c7929eab09cbc7f36e3a78ff65c..4fec1816a2b3b18385a2ec5c5590e4d72dc7775b 100644 (file)
@@ -28,7 +28,7 @@ static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid)
        struct key *key;
        char name[12];
 
-       sprintf(name, "id:%x", keyid);
+       sprintf(name, "id:%08x", keyid);
 
        pr_debug("key search: \"%s\"\n", name);