IMA signature generated by evmctl has unexpected key identifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux