[PATCH] lib: Add hex2bin and bin2hex implementations

2015-03-13 Thread Sascha Hauer
Taken from the Kernel, put into the same place as in the kernel, although the hexdump.c does not actually contain hexdum functions. Signed-off-by: Sascha Hauer --- include/linux/kernel.h | 4 +++ lib/Makefile | 1 + lib/hexdump.c | 74

Re: [PATCH 7/7] command: add generic digest command

2015-03-13 Thread Sascha Hauer
On Thu, Mar 12, 2015 at 03:22:26PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > That can be used for digest calculation and verify > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > commands/Kconfig| 12 +++- > commands/Makefile | 1 + > commands/digest.c | 195 > ++

Re: [PATCH 5/7] digest: allow algo to specify their length at runtime

2015-03-13 Thread Sascha Hauer
On Thu, Mar 12, 2015 at 03:22:24PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > such as RSA as we load a DER key we will detect the key size > at runtime and so the algo length. > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > include/digest.h | 3 ++- > 1 file changed, 2 inserti

Re: [PATCH 1/7] digest: fix and add missing copyright

2015-03-13 Thread Sascha Hauer
On Thu, Mar 12, 2015 at 03:22:20PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > crypto/hmac.c | 6 ++ > crypto/internal.h | 2 +- > 2 files changed, 7 insertions(+), 1 deletion(-) Squashed this one and 2/7 into the initial hmac

Re: [RFC 1/4] digest: Make filename arguments const

2015-03-13 Thread Sascha Hauer
On Thu, Mar 12, 2015 at 03:39:56PM +0100, Jan Luebbe wrote: > From: Sascha Hauer > > Signed-off-by: Sascha Hauer > --- > common/digest.c | 8 > include/digest.h | 8 > 2 files changed, 8 insertions(+), 8 deletions(-) Already rebased onto Jean-Christophes latest changes and a

Re: [PATCH 7/7] command: add generic digest command

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
> > + > > +static int do_digest(int argc, char *argv[]) > > +{ > > + struct digest *d; > > + unsigned char *tmp_key = NULL; > > + unsigned char *tmp_sig = NULL; > > + char *sig = NULL; > > + char *sigfile = NULL; > > + size_t siglen = 0; > > + char *key = NULL; > > + char *keyfile =

[PATCH 1/1] command: allow runtime usage

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
this will allow as example to list the current supported digest Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/command.c | 2 ++ include/command.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/common/command.c b/common/command.c index 61191c2..dc2cb88 100644 --- a/common/c

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jan Lübbe
On Do, 2015-03-12 at 19:19 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > please do not send a new version except for fix > > I'm going to re-integrate it with the keystore & co Could you describe your keystore design? > and sha1,rsa2048 is considered weak in term of security > and worse md4/m

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jan Lübbe
On Do, 2015-03-12 at 18:47 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > as state in my previous e-mail I will a keystore support > > but this dt format to handle no please > > we need to use the standard format as in the kernel or openssl > > DER and x509 > > specially x509 as if we want to

Re: [RFC] digest: Add enum

2015-03-13 Thread Jan Lübbe
On Do, 2015-03-12 at 18:50 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > do as in the kernel use the string as we may want to add hw IP You mean we should add a priority instead? The kernel also has separate names for the algorithm and for the driver. Regards, Jan -- Pengutronix e.K.

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 10:35 Fri 13 Mar , Jan Lübbe wrote: > On Do, 2015-03-12 at 18:47 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > as state in my previous e-mail I will a keystore support > > > > but this dt format to handle no please > > > > we need to use the standard format as in the kernel or openssl

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 10:28 Fri 13 Mar , Jan Lübbe wrote: > On Do, 2015-03-12 at 19:19 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > please do not send a new version except for fix > > > > I'm going to re-integrate it with the keystore & co > > Could you describe your keystore design? I'll send the patch

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Sascha Hauer
On Fri, Mar 13, 2015 at 10:56:54AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 10:35 Fri 13 Mar , Jan Lübbe wrote: > > On Do, 2015-03-12 at 18:47 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > as state in my previous e-mail I will a keystore support > > > > > > but this dt forma

Re: [RFC] digest: Add enum

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 10:54 Fri 13 Mar , Jan Lübbe wrote: > On Do, 2015-03-12 at 18:50 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > do as in the kernel use the string as we may want to add hw IP > > You mean we should add a priority instead? The kernel also has separate > names for the algorithm and for th

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jan Lübbe
On Fr, 2015-03-13 at 10:56 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > Having an ASN1 parser for DER/x509 is a huge amount of complexity I > > would not want in a bootloader. Just take a look at the problems the > > SSL-CAs and browsers had with different interpretations of the same > > cert

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:06 Fri 13 Mar , Sascha Hauer wrote: > On Fri, Mar 13, 2015 at 10:56:54AM +0100, Jean-Christophe PLAGNIOL-VILLARD > wrote: > > On 10:35 Fri 13 Mar , Jan Lübbe wrote: > > > On Do, 2015-03-12 at 18:47 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > as state in my previous e-mail

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jan Lübbe
On Fr, 2015-03-13 at 11:05 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 10:28 Fri 13 Mar , Jan Lübbe wrote: > > On Do, 2015-03-12 at 19:19 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > please do not send a new version except for fix > > > > > > I'm going to re-integrate it with t

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jan Lübbe
On Fr, 2015-03-13 at 11:12 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > sorry mutt via ssh lost some character when typing > > der is few 100s line of code that's all > > and x509 just a few more > > as I do not plan to support all the options of x509 specially the non > standard one Do

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:10 Fri 13 Mar , Jan Lübbe wrote: > On Fr, 2015-03-13 at 10:56 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > Having an ASN1 parser for DER/x509 is a huge amount of complexity I > > > would not want in a bootloader. Just take a look at the problems the > > > SSL-CAs and browsers had

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:22 Fri 13 Mar , Jan Lübbe wrote: > On Fr, 2015-03-13 at 11:12 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > sorry mutt via ssh lost some character when typing > > > > der is few 100s line of code that's all > > > > and x509 just a few more > > > > as I do not plan to support

[PATCH] PCI: fix bad bugs in bridge setup code

2015-03-13 Thread Lucas Stach
Add the required brackets, so that we don't write unused registers with potentially bogus values. Signed-off-by: Lucas Stach --- /me hides under a rock --- drivers/pci/pci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 5b84

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jan Lübbe
On Fr, 2015-03-13 at 11:25 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 11:10 Fri 13 Mar , Jan Lübbe wrote: > > On Fr, 2015-03-13 at 10:56 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > Having an ASN1 parser for DER/x509 is a huge amount of complexity I > > > > would not want in

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Marc Kleine-Budde
On 03/13/2015 11:05 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 10:28 Fri 13 Mar , Jan Lübbe wrote: >> On Do, 2015-03-12 at 19:19 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: >>> please do not send a new version except for fix >>> >>> I'm going to re-integrate it with the keystore & co >

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:21 Fri 13 Mar , Jan Lübbe wrote: > On Fr, 2015-03-13 at 11:05 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > On 10:28 Fri 13 Mar , Jan Lübbe wrote: > > > On Do, 2015-03-12 at 19:19 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > please do not send a new version except for f

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jan Lübbe
On Fr, 2015-03-13 at 15:28 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > It's not the job of barebox to define security policies, it must fit > > well into the larger security design, which may require compromises. > > I disagree, disable by default non secure feature is require to pass > sec

ARM: UBI/UBIFS on spi-nor

2015-03-13 Thread Renaud Barbier
Hello, I have a cortex-A9 based platform featuring a spi-nor (n25q256a). I have disabled 4KB sector for this spi-nor in order to use UBI/UBIFS. So far I can ubiattach, mount and copy small files (~65KB or 2 sectors) to ramfs. Copying a bigger file (512KB) leads to a read failure (ubifs_search_zbra

Re: [RFC 2/4] Add rsa support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:43 Fri 13 Mar , Jan Lübbe wrote: > On Fr, 2015-03-13 at 11:25 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > On 11:10 Fri 13 Mar , Jan Lübbe wrote: > > > On Fr, 2015-03-13 at 10:56 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > > Having an ASN1 parser for DER/x509 is a hug

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 12:33 Fri 13 Mar , Marc Kleine-Budde wrote: > On 03/13/2015 11:05 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: > > On 10:28 Fri 13 Mar , Jan Lübbe wrote: > >> On Do, 2015-03-12 at 19:19 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > >>> please do not send a new version except for fix >

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Marc Kleine-Budde
On 03/13/2015 04:54 PM, Jean-Christophe PLAGNIOL-VILLARD wrote: >>> if you can break rsa4096, the chance you can break ECC are high too >> >> If you want to open the box, today you would probably not break >> rsa2048/sha1 (unless you have huge calculation power) but look for >> implementation weakn

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 16:41 Fri 13 Mar , Jan Lübbe wrote: > On Fr, 2015-03-13 at 15:28 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > It's not the job of barebox to define security policies, it must fit > > > well into the larger security design, which may require compromises. > > > > I disagree, disable b

Re: [RFC 3/4] FIT: add FIT image support

2015-03-13 Thread Jean-Christophe PLAGNIOL-VILLARD
On 17:06 Fri 13 Mar , Marc Kleine-Budde wrote: > On 03/13/2015 04:54 PM, Jean-Christophe PLAGNIOL-VILLARD wrote: > >>> if you can break rsa4096, the chance you can break ECC are high too > >> > >> If you want to open the box, today you would probably not break > >> rsa2048/sha1 (unless you have

Re: [PATCH 1/1] command: allow runtime usage

2015-03-13 Thread Robert Schwebel
On Fri, Mar 13, 2015 at 09:42:22AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > this will allow as example to list the current supported digest ^^ ^ Tly. Maybe you mean

Re: [RFC] digest: Add enum

2015-03-13 Thread Robert Schwebel
On Fri, Mar 13, 2015 at 11:10:19AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 10:54 Fri 13 Mar , Jan Lübbe wrote: > > On Do, 2015-03-12 at 18:50 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > do as in the kernel use the string as we may want to add hw IP > > > > You mean we sho

Re: git fetch issue

2015-03-13 Thread Uwe Kleine-König
Hello Antony, On Thu, Mar 12, 2015 at 01:32:53PM +0400, Antony Pavlov wrote: > It looks like my local repo is damaged ("git fsck" exits with a bus error > message). > I suppose that the problem is likely due to my laptop yesterday emergency > power off. > I have just re-cloned barebox.git from p

[PATCH] net: mvneta: convert to streaming DMA ops

2015-03-13 Thread Lucas Stach
Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach --- I don't know why I missed this one driver in the big conversion series, but the randconfig builder just came around and reminded to get m