linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Lakshmi <nramas@linux.microsoft.com>, linux-integrity@vger.kernel.org
Subject: Re: IMA signature generated by evmctl has unexpected key identifier
Date: Tue, 14 May 2019 13:25:50 -0400	[thread overview]
Message-ID: <1557854750.4139.65.camel@linux.ibm.com> (raw)
In-Reply-To: <90a4d769-4c32-4b2b-ceaa-6e0980d5c193@linux.microsoft.com>

On Tue, 2019-05-14 at 10:18 -0700, Lakshmi wrote:
> On 5/12/19 5:37 PM, nramas@linux.microsoft.com wrote:
> > 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
> > 
> 
> I have tried the above on Linux kernel 4.18.0-17 as well and am seeing 
> the same behavior.
> 
> I am unable to find older versions (prior to Version 1.1) of evmctl to 
> check if the behavior is different.

Missing from this log is the list of keys on the .ima keyring.

Mimi


  reply	other threads:[~2019-05-14 17:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557854750.4139.65.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=nramas@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).