* [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments
@ 2013-08-23 18:56 Stephen Warren
[not found] ` <1377284162-7700-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-08-23 18:56 UTC (permalink / raw)
To: swarren-3lzwWm7+Weoh9ZMKESR00Q
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren
From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Using "$@" (rather than #@) quotes any arguments if required. This is
useful if you want to run ./autogen.sh CFLAGS="-ggdb -O0".
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
autogen.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index e925023..530783b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,5 +1,4 @@
#!/bin/sh -e
autoreconf --install --symlink
-./configure $@
-
+./configure "$@"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [cbootimage PATCH 2/2] crypto: produce consistent hash for zero-length data
[not found] ` <1377284162-7700-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-08-23 18:56 ` Stephen Warren
[not found] ` <1377284162-7700-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-26 7:52 ` [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments Thierry Reding
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-08-23 18:56 UTC (permalink / raw)
To: swarren-3lzwWm7+Weoh9ZMKESR00Q
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren
From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
In real-world use-cases, hashing zero-length data likely never happens.
However, it is relevant when testing cbootimage with a dummy zero-length
bootloader binary, e.g.:
touch u-boot.bin
cbootimage -t30 ../tamonten-ng/tegra30.img.cfg tegra30-tec-ng.img
In this scenario, it's useful to create a consistent hash, so that one
can compare the resultant images before and after applying patches, to
check for regressions.
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
src/crypto.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/crypto.c b/src/crypto.c
index 88de357..9741785 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -183,6 +183,9 @@ sign_objext(
if (enable_debug_crypto)
print_vector("K1", KEY_LENGTH, k1);
+ if (!num_aes_blocks)
+ memset(dst, 0, 4 * NVAES_STATECOLS);
+
/* compute the AES-CMAC value */
for (i = 0; i < num_aes_blocks; i++) {
/* Apply the chain data */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments
[not found] ` <1377284162-7700-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-23 18:56 ` [cbootimage PATCH 2/2] crypto: produce consistent hash for zero-length data Stephen Warren
@ 2013-08-26 7:52 ` Thierry Reding
2013-08-26 20:20 ` Stephen Warren
1 sibling, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2013-08-26 7:52 UTC (permalink / raw)
To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
On Fri, Aug 23, 2013 at 12:56:01PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
s/spaced/spaces/ in the patch subject?
Otherwise:
Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [cbootimage PATCH 2/2] crypto: produce consistent hash for zero-length data
[not found] ` <1377284162-7700-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-08-26 8:01 ` Thierry Reding
0 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2013-08-26 8:01 UTC (permalink / raw)
To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren
[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]
On Fri, Aug 23, 2013 at 12:56:02PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> In real-world use-cases, hashing zero-length data likely never happens.
> However, it is relevant when testing cbootimage with a dummy zero-length
> bootloader binary, e.g.:
>
> touch u-boot.bin
> cbootimage -t30 ../tamonten-ng/tegra30.img.cfg tegra30-tec-ng.img
>
> In this scenario, it's useful to create a consistent hash, so that one
> can compare the resultant images before and after applying patches, to
> check for regressions.
>
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> src/crypto.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/crypto.c b/src/crypto.c
> index 88de357..9741785 100644
> --- a/src/crypto.c
> +++ b/src/crypto.c
> @@ -183,6 +183,9 @@ sign_objext(
> if (enable_debug_crypto)
> print_vector("K1", KEY_LENGTH, k1);
>
> + if (!num_aes_blocks)
> + memset(dst, 0, 4 * NVAES_STATECOLS);
> +
Perhaps it would be better to zero out the memory after allocating it in
sign_bct()? Or alternatively use:
hash_buffer = calloc(1, hash_size);
That way you're sure to get the size right and don't have to hardcode
it. The above patch will only work as long as the hash size across SoCs
remains the same.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments
2013-08-26 7:52 ` [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments Thierry Reding
@ 2013-08-26 20:20 ` Stephen Warren
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2013-08-26 20:20 UTC (permalink / raw)
To: Thierry Reding; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren
On 08/26/2013 01:52 AM, Thierry Reding wrote:
> On Fri, Aug 23, 2013 at 12:56:01PM -0600, Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> s/spaced/spaces/ in the patch subject?
Sigh. Guess I need to pay more attention too:-)
> Otherwise:
>
> Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Thanks. I've pushed this one patch out with the subject fixed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-26 20:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23 18:56 [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments Stephen Warren
[not found] ` <1377284162-7700-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-23 18:56 ` [cbootimage PATCH 2/2] crypto: produce consistent hash for zero-length data Stephen Warren
[not found] ` <1377284162-7700-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-26 8:01 ` Thierry Reding
2013-08-26 7:52 ` [cbootimage PATCH 1/2] autogen.sh: allow spaced in configure arguments Thierry Reding
2013-08-26 20:20 ` Stephen Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox