9
0
Fork 0
Commit Graph

976 Commits

Author SHA1 Message Date
Philippe Leduc d46b6785c4 digest: digest doesn't return an error if the signature length is incorrect
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>
2015-07-06 13:29:35 +02:00
Sascha Hauer 7b4e61bbf9 Merge branch 'for-next/mtd'
Conflicts:
	drivers/mtd/core.c
2015-07-03 08:37:52 +02:00
Sascha Hauer f2a2894c27 Merge branch 'for-next/misc' 2015-07-03 08:37:40 +02:00
Antony Pavlov 177cab00ce treewide: fix 'new blank line at EOF' formatting error
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 09:39:58 +02:00
Lucas Stach f2d31f6f6d commands: digest: fix harmless warning
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>
2015-06-29 07:22:37 +02:00
Sascha Hauer fc34ff801b commands: mount: detect the device to be mounted
Before mounting a device try to detect it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 09:21:41 +02:00
Sascha Hauer 39ca74057d commands: detect: use device_detect_by_name
Instead of looking up the device ourselves let device_detect_by_name
do the work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 09:19:35 +02:00
Sascha Hauer 54d78652c1 devinfo: fix return value
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>
2015-06-23 08:38:31 +02:00
Hubert Feurstein cd09bf8f51 login: fix broken login command
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>
2015-06-18 09:44:37 +02:00
Renaud Barbier c83950aa03 memtest: skip memory region smaller than one page
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>
2015-06-16 15:59:04 +02:00
Sascha Hauer 7a429bfb3b Merge branch 'for-next/misc' 2015-06-09 09:26:44 +02:00
Sascha Hauer 0c3bb48db9 Merge branch 'for-next/mem64' 2015-06-09 09:26:43 +02:00
Sascha Hauer d036dd5a66 Merge branch 'for-next/console' 2015-06-09 09:26:43 +02:00
Sascha Hauer ee2ac17df0 Merge branch 'for-next/am33xx' 2015-06-09 09:26:43 +02:00
Sascha Hauer b4d5c8a039 loadb: ignore -c option
And always create the file if necessary. No need to have an extra flag for
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer e8b94fdfb6 loadb: Use console_set_baudrate
No Need to do this manually

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer 7cf221db7c loadb: use console_get_baudrate
No need to fiddle with device parameters anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer 230c22252a loadxy: use console_set_baudrate
No need to do this manually

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer 3894344053 loadx: ignore -c option
And always create the file if necessary. No need to have an extra flag for
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer d2a53a56b9 loadxy: use console_get_baudrate
No need to fiddle with device parameters anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer c6fe3cd6be loadxy: Use console_get_by_name
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>
2015-06-09 09:22:14 +02:00
Wadim Egorov e9bd26c7a7 net: dhcp: Split dhcp funcionality & add dhcp command
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>
2015-06-05 13:32:39 +02:00
Sascha Hauer d7050d1a9d mw command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:59 +02:00
Sascha Hauer 14221b676d mm command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:59 +02:00
Sascha Hauer ab194d11c1 memset command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:58 +02:00
Sascha Hauer 97f5098201 memcpy command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:58 +02:00
Sascha Hauer 3878611a44 memcmp command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:58 +02:00
Sascha Hauer a27d43a794 md command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:54 +02:00
Sascha Hauer 8141d2956e mem commands: suppport parsing 'q' option
Add 64bit ('q', for quad) support to mem_parse_options

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:29:49 +02:00
Sascha Hauer 6792d94a4b md: use memmap when possible
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>
2015-05-28 12:26:33 +02:00
Marc Kleine-Budde 82d21cf155 commands/Kconfig: fix typo in CMD_BOOTM_OFTREE help
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-26 09:19:31 +02:00
Marc Kleine-Budde 01fdbb9652 bootm: add magicvar description for global.bootm.oftree
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-26 09:19:30 +02:00
Alexander Richter 4df73d5f58 ubiformat: fix argument parser
- remove duplicate 'y' option
- add missing 'Q' option

Signed-off-by: Alexander Richter <alexander.richter@atsonline.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-20 08:09:15 +02:00
Marc Kleine-Budde 1aa3dbfc1a timeout: factor out wait-for-key-press loop into separate file
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>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 78caf2d171 command: timeout: add documentation for option '-v'
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 2daf357206 command: timeout: remove unhandled '-t' option
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>
2015-04-23 08:12:28 +02:00
Marc Kleine-Budde 4f315f3670 command: state: harmonize in-barebox documentation
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>
2015-04-17 07:31:35 +02:00
Sascha Hauer ee0035e5cc Merge branch 'for-next/state' 2015-04-13 12:57:14 +02:00
Sascha Hauer 9f13039b55 Merge branch 'for-next/misc' 2015-04-13 12:57:13 +02:00
Marc Kleine-Budde 134f24615b commands: dmesg: fi format security warning
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>
2015-04-03 08:01:53 +02:00
Antony Pavlov 238ffb68f6 command: hashsum: Conding style fixup
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-30 19:08:14 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5afec9c781 command: digest/hashsum: set key at command level
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>
2015-03-27 07:49:37 +01:00
Jean-Christophe PLAGNIOL-VILLARD ca95c2531f crypto: digest: speficied when a digest need a key to be used
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>
2015-03-20 11:45:55 +01:00
Jean-Christophe PLAGNIOL-VILLARD b0be99fc10 command: add generic digest command
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>
2015-03-20 11:45:55 +01:00
Jean-Christophe PLAGNIOL-VILLARD 1f91b3e6da command: rename digest.c to hashsum.c
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>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD 92138a7754 crypto: digest: digest_file_window/digest_file/digest_file_by_name drop key params
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>
2015-03-19 07:46:15 +01:00
Jean-Christophe PLAGNIOL-VILLARD 102d59f91f command: add hmac sum supportfor md5, sha1, sha224, sha256, sha384, sha512
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>
2015-03-13 08:32:28 +01:00
Sascha Hauer 1487e6b9ad state: add framework for persistent state handling
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>
2015-03-12 08:28:31 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2505dd9b41 command: add sha384sum and sha512sum support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-12 07:58:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD 27b2336029 digest: make it multi-instance
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>
2015-03-12 07:58:24 +01:00