fix: digest return no error even if the digest length is wrong
fix: documentation error (-v -> -s / -V -> -S)
Signed-off-by: Philippe Leduc <ledphilippe@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fixes with !CONFIG_LONGHELP:
commands/digest.c:71:13: warning:
'prints_algo_help' defined but not used [-Wunused-function]
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
devinfo on a non existing device prints:
no such device: blah
devinfo: Operation not permitted
The second message comes because devinfo returns -1 which is -EPERM.
Just return -ENODEV which will print:
devinfo: No such device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It was possible to login with ctrl-c or an empty password. This bug was
introduced by the recent digest changes in common/password.c (e49a47fb).
The function check_passwd returns now also negative error codes which were
not correctly handled in do_login.
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
If the size between memory regions is smaller than one page, the
size is rounded down to 0. This results in a region request failure.
This commit skips the memory region whose size is smaller than a page.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Use console_get_by_name rather than iterating over the console list in the
loadxy code. The code in loadxy.c used to test whether a console is active
before using it. This check is dropped along the way since there's no reason
to not being able to use a disabled console for loadxy.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
dhcp/bootp was bound to the command functionality.
This patch splits the dhcp command.
We are now able to use bootp without a shell.
This patch adds also a check for environment variables and globalvar.
So only when ENVIRONMENT_VARIABLES and GLOBALVAR is set, all received
dhcp data will be stored.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds the missing pieces for:
d8a6e1c ARM/mem: handle data aborts gracefully for md
When possible use memmap and directly and dereference the input pointer
directly in memory_display() so that the data abort occurs where we expect
it and not in the md command. With this d8a6e1c can work as expected.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch factors out the wait-for-key-press loop from the shell command
"timeout" into a sparate file, so that it can be used from C, too.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch removes the option '-t', as it's unhandled in the code since it was
added to barebox.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
According to this patch by Holger Schurig:
f1f532084a commands: harmonize in-barebox documentation
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
commands/dmesg.c: In function ‘do_dmesg’:
commands/dmesg.c:71:3: warning: format not a string literal and no format arguments [-Wformat-security]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
and only set the key when specified
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
such as for hmac(xxx) you must provide a key
This will allow to enforce the correct parameter at digest command
<digest>sum is not impacted
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
That can be used for digest calculation and verify
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
as I'll add a new generic command named digest
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
expect the key to be set before calling
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
pass the key via -h param
barebox@barebox sandbox:/ sha256sum -h test /dev/fd0
c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de /dev/fd0 0x00000000 ... 0xffffffffffffffff
use the same idea as openssl command
$ openssl dgst -sha256 -hmac "test" TODO
HMAC-SHA256(TODO)= c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds a framework to describe, access, store and restore a set of
variables. A state variable set can be fully described in a devicetree node.
This node could be part of the regular devicetree blob or it could be an extra
devicetree solely for the state. The state variable set contains variables of
different types and a place to store the variable set.
For more information see:
Documentation/devicetree/bindings/barebox/barebox,state.rst
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Now you need to call digest_alloc and when you finish to use it digest_free.
We need this for upcomming aes encryption support and secure boot
as we will need multiple instance of the same digest.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>