All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/8] rsa: add sha256-rsa2048 algorithm
Date: Mon, 10 Mar 2014 07:00:56 +0100	[thread overview]
Message-ID: <531D5518.2010102@denx.de> (raw)
In-Reply-To: <CAPnjgZ0+4w-1RizepKH6tfM2DUYdk+9j6_XfyKoY2ngbaGth4g@mail.gmail.com>

Hello Simon,

Am 09.03.2014 06:33, schrieb Simon Glass:
> Hi Heiko,
>
> On 3 March 2014 04:19, Heiko Schocher<hs@denx.de>  wrote:
>> based on patch from andreas at oetken.name:
>>
>> http://patchwork.ozlabs.org/patch/294318/
>> commit message:
>> I currently need support for rsa-sha256 signatures in u-boot and found out that
>> the code for signatures is not very generic. Thus adding of different
>> hash-algorithms for rsa-signatures is not easy to do without copy-pasting the
>> rsa-code. I attached a patch for how I think it could be better and included
>> support for rsa-sha256. This is a fast first shot.
>>
>> aditionally work:
>> - removed checkpatch warnings
>> - removed compiler warnings
>> - rebased against current head
>>
>> Signed-off-by: Heiko Schocher<hs@denx.de>
>> Cc: andreas at oetken.name
>> Cc: Simon Glass<sjg@chromium.org>
>
> This looks good to me. However, when running it I hit this crash?
>
> O=b/sandbox test/vboot/vboot_test.sh
> Simple Verified Boot Test
> =========================
>
> Please see doc/uImage.FIT/verified-boot.txt for more information
>
> /home/sjg/c/src/third_party/u-boot/files/b/sandbox/tools/mkimage -D -I
> dts -O dtb -p 2000
> Build keys
> do sha1 test
> Build FIT with signed images
> Test Verified Boot Run: unsigned signatures:: OK
> Sign images
> Test Verified Boot Run: signed images: OK
> Build FIT with signed configuration
> Test Verified Boot Run: unsigned config: OK
> Sign images
> Test Verified Boot Run: signed config: OK
> check signed config on the host
> *** buffer overflow detected ***:
> /home/sjg/c/src/third_party/u-boot/files/b/sandbox/tools/fit_check_sign
> terminated
> ======= Backtrace: =========
> /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f07c7ba9f47]
> /lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7f07c7ba8e40]
[...]
>    [vsyscall]
> test/vboot/vboot_test.sh: line 65:  7597 Aborted                 (core
> dumped) ${fit_check_sign} -f test.fit -k sandbox-u-boot.dtb>  ${tmp}
>
> Verified boot key check on host failed, output follows:
>
>
> Do you see this? Presumably not - I can dig a bit if you like?

No, I do not see this crash ... Hmm... you reply this error to the
4/8 patch of this series, but "fit_check_sign" is introduced in the
8/8 ... did you tried with all 8 patches applied?

Just tested with current head of U-Boot and I see no error:

commit 247161b8160fc699b0a517f081220bb50bc502a8
Merge: d57d60c 96ac18c
Author: Tom Rini <trini@ti.com>
Date:   Fri Mar 7 20:54:22 2014 -0500

     Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx

$ O=sandbox ./test/vboot/vboot_test.sh
Simple Verified Boot Test
=========================

Please see doc/uImage.FIT/verified-boot.txt for more information

/home/hs/ids/u-boot/sandbox/tools/mkimage -D -I dts -O dtb -p 2000
Build keys
do sha1 test
Build FIT with signed images
Test Verified Boot Run: unsigned signatures:: OK
Sign images
Test Verified Boot Run: signed images: OK
Build FIT with signed configuration
Test Verified Boot Run: unsigned config: OK
Sign images
Test Verified Boot Run: signed config: OK
check signed config on the host
OK
Test Verified Boot Run: signed config: OK
Test Verified Boot Run: signed config with bad hash: OK
do sha256 test
Build FIT with signed images
Test Verified Boot Run: unsigned signatures:: OK
Sign images
Test Verified Boot Run: signed images: OK
Build FIT with signed configuration
Test Verified Boot Run: unsigned config: OK
Sign images
Test Verified Boot Run: signed config: OK
check signed config on the host
OK
Test Verified Boot Run: signed config: OK
Test Verified Boot Run: signed config with bad hash: OK

Test passed
pollux:u-boot hs [temp] $

Can you try with current head again?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2014-03-10  6:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 11:19 [U-Boot] [PATCH v3 0/8] common, fit, rsa: enhancements Heiko Schocher
2014-03-03 11:19 ` [U-Boot] [PATCH v3 1/8] tools/image-host: fix sign-images bug Heiko Schocher
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,1/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 2/8] fdt: add "fdt checksign" command Heiko Schocher
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,2/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 3/8] fit: add sha256 support Heiko Schocher
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,3/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 4/8] rsa: add sha256-rsa2048 algorithm Heiko Schocher
2014-03-09  5:33   ` Simon Glass
2014-03-10  6:00     ` Heiko Schocher [this message]
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,4/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 5/8] rsa: add sha256,rsa4096 algorithm Heiko Schocher
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,5/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 6/8] gen: Add progressive hash API Heiko Schocher
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,6/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 7/8] tools, fit: add fit_info host command Heiko Schocher
2014-03-09  5:41   ` Simon Glass
2014-03-27 16:58   ` [U-Boot] [U-Boot,v3,7/8] " Tom Rini
2014-03-03 11:19 ` [U-Boot] [PATCH v3 8/8] tools, fit_check_sign: verify a signed fit image Heiko Schocher
2014-03-09  5:47   ` Simon Glass
2014-03-27 16:58   ` [U-Boot] [U-Boot, v3, " Tom Rini

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=531D5518.2010102@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.