linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IMA signature generated by evmctl has unexpected key identifier
@ 2019-05-13  0:37 nramas
  2019-05-14 17:18 ` Lakshmi
  0 siblings, 1 reply; 13+ messages in thread
From: nramas @ 2019-05-13  0:37 UTC (permalink / raw)
  To: linux-integrity; +Cc: zohar

Hello,

I am trying to test IMA signature validation using EVMCTL version 1.1
Am running kernel version 5.1.0 rc2 on an Ubuntu desktop.

I have followed the steps given in the README below:
https://sourceforge.net/p/linux-ima/ima-evm-utils/ci/master/tree/README

I have created private\public key pair and the DER encoded certificate for 
the private key. Imported the signed DER encoded cert to IMA keyring.

keyctl show %keyring:.ima
Keyring
1054868458 ---lswrv      0     0  keyring: .ima
  740136756 --als--v      0     0   \_ asymmetric: hostname: whoami signing
key: 85512d09fc12c7f38b9679352651dcb365903336

cat /proc/keys | grep -i signing
2c1d9734 I--Q---     1 perm 39010000     0     0 asymmetri hostname:
whoami signing key: 85512d09fc12c7f38b9679352651dcb365903336: X509.rsa
65903336 []

evmctl ima_sign -a sha256 --key /etc/keys/privkey_evm.pem /boot/vmlinuz-5.1.0-rc2+

In the key identifier set in security.ima attribute the key identifier 
should be 65903336 to match the key in the IMA keyring. But it is 
b8847de9.

getfattr -d -m ima -e hex /boot/vmlinuz-5.1.0-rc2+
getfattr: Removing leading '/' from absolute path names
# file: boot/vmlinuz-5.1.0-rc2+
security.ima=0x030204b8847de90080b06c8d5517a6afea64805c2871581b256a4efcf7ce4ba079a85545e5e70a2603596366c4e342f11052291e9b558ccb1a1208747f12c45bbe4cee59c727f308a46e951c0df9b1f6b443a8c0a4f5ac881d49e0cce9927b64eeab29c5688aba0758e5cfb30c26fd5b131c2206f1b208d48a427c53a77ae5baf98f4994a19f67b163

When trying to verify the IMA signature I get the following error

evmctl ima_verify --key /etc/keys/x509_evm.der /boot/vmlinuz-5.1.0-rc2+
/boot/vmlinuz-5.1.0-rc2+: RSA_public_decrypt() failed: -1
error:0407008A:rsa routines:RSA_padding_check_PKCS1_type_1:invalid 
padding
error:04067072:rsa routines:rsa_ossl_public_decrypt:padding check failed

This looks very similar to the issue discussed here
https://sourceforge.net/p/linux-ima/mailman/message/34290588/

But the bug discussed in the above thread looks to be fixed though.

Am I missing something?

Thank you.

  -lakshmi



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-05-23 17:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13  0:37 IMA signature generated by evmctl has unexpected key identifier nramas
2019-05-14 17:18 ` Lakshmi
2019-05-14 17:25   ` Mimi Zohar
2019-05-14 17:57     ` Lakshmi
2019-05-14 21:38       ` Mimi Zohar
2019-05-14 22:07         ` Lakshmi
2019-05-21 17:48           ` Lakshmi
2019-05-22  0:30             ` Mimi Zohar
2019-05-22  1:39               ` Lakshmi
2019-05-22  2:16                 ` Lakshmi
2019-05-23  1:10                   ` Lakshmi
2019-05-23 13:26                     ` Mimi Zohar
2019-05-23 17:23                       ` Lakshmi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).