public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Martin Townsend <mtownsend1973@gmail.com>,
	Fabio Estevam <festevam@gmail.com>
Cc: Horia Geanta Neag <horia.geanta@nxp.com>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Breno Matheus Lima <brenomatheus@gmail.com>,
	linux-integrity@vger.kernel.org, linux-crypto@vger.kernel.org,
	Aymen Sghaier <aymen.sghaier@nxp.com>
Subject: Re: CAAM and IMA/EVM : caam_rsa_enc: DECO: desc idx 7: Protocol Size Error
Date: Tue, 10 Apr 2018 15:36:20 -0700	[thread overview]
Message-ID: <1523399780.3238.30.camel@HansenPartnership.com> (raw)
In-Reply-To: <CABatt_yokAz4bozv5mGu44rh_sZaok-fGj36p2Z3EpcXYiphVA@mail.gmail.com>

On Tue, 2018-04-10 at 23:01 +0100, Martin Townsend wrote:
> Using openssl to get the signature in my x509 cert
> 
>    Signature Algorithm: sha256WithRSAEncryption
>          68:82:cc:5d:f9:ee:fb:1a:77:72:a6:a9:c6:4c:cc:d7:f6:2a:
>          17:a5:db:bf:5a:2b:8d:39:60:dc:a0:93:39:45:0f:bc:a7:e8:
>          7f:6c:06:84:2d:f3:c1:94:0a:60:56:1c:50:78:dc:34:d1:87:
> 
> So there's an extra 0x00 and the signature is 257 bytes so I guess
> this is upsetting CAAM, just need to work out where it's coming from,
> or whether it's valid and CAAM should be handling it.

A signature is just a bignum so leading zeros are permitted because
it's the same numeric value; however, there are normalization
procedures that require stripping the leading zeros, say before doing a
hash or other operation which would be affected by them.

CAAM should definitely handle it on the "be liberal in what you accept"
 principle.  The kernel should probably remove the leading zeros on the
"be conservative in what you do" part of the same principle. 

>   I notice that in my stack trace I have pkcs1pad_verify which
> suggests some sort of padding?

Yes, RSA has various forms of padding because the information being
encrypted is usually much smaller than the encryption unit; PKCS1 is
the most common (although its now deprecated in favour of OAEP because
of all the padding oracle problems).

James

  reply	other threads:[~2018-04-10 22:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09  8:41 CAAM and IMA/EVM : caam_rsa_enc: DECO: desc idx 7: Protocol Size Error Martin Townsend
2018-04-09 12:46 ` Mimi Zohar
2018-04-09 14:10   ` Martin Townsend
2018-04-09 15:07     ` Mimi Zohar
2018-04-09 16:53     ` Mike Rapoport
2018-04-09 17:41       ` Martin Townsend
2018-04-10 16:59 ` Fabio Estevam
2018-04-10 17:06   ` Martin Townsend
2018-04-10 18:22     ` Fabio Estevam
2018-04-10 18:43       ` Martin Townsend
2018-04-10 22:01         ` Martin Townsend
2018-04-10 22:36           ` James Bottomley [this message]
2018-04-11 10:58             ` Horia Geantă
2018-04-11 12:07               ` Martin Townsend
2018-04-11 11:56             ` Martin Townsend
2018-04-11  2:21           ` Fabio Estevam
2018-04-11 10:15             ` Horia Geantă
2018-04-11 17:26               ` Fabio Estevam
2018-04-12  7:12                 ` Horia Geantă
2018-04-13  0:12                   ` Fabio Estevam
2018-04-13  6:18                     ` Horia Geantă
2018-04-14  1:06                       ` Fabio Estevam

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=1523399780.3238.30.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=brenomatheus@gmail.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=festevam@gmail.com \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mtownsend1973@gmail.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