Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-12 Thread Florian Weimer
* Daniel Borkmann: > On 02/11/2013 08:00 PM, Florian Weimer wrote: >> * Daniel Borkmann: > > Thanks for your feedback, Florian! > >>> + * memcmp_nta - memcmp that is secure against timing attacks >> >> It's not providing an ordering, so it should not have "cmp" in the >> name. > > I agree. What wo

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-11 Thread Daniel Borkmann
On 02/11/2013 08:00 PM, Florian Weimer wrote: > * Daniel Borkmann: Thanks for your feedback, Florian! >> + * memcmp_nta - memcmp that is secure against timing attacks > > It's not providing an ordering, so it should not have "cmp" in the > name. I agree. What would you suggest? Probably, it wou

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-11 Thread Daniel Borkmann
On 02/11/2013 07:37 PM, Andy Lutomirski wrote: On 02/10/2013 02:00 PM, Daniel Borkmann wrote: If you need to compare a password or a hash value, the timing of the comparison function can give valuable clues to the attacker. Let's say the password is 123456 and the attacker tries abcdef. If the c

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-11 Thread Florian Weimer
* Daniel Borkmann: > + * memcmp_nta - memcmp that is secure against timing attacks It's not providing an ordering, so it should not have "cmp" in the name. > + for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) > + res |= (*su1 ^ *su2); The compiler could still short-cir

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-11 Thread Andy Lutomirski
On 02/10/2013 02:00 PM, Daniel Borkmann wrote: > If you need to compare a password or a hash value, the timing of the > comparison function can give valuable clues to the attacker. Let's > say the password is 123456 and the attacker tries abcdef. If the > comparision function fails at the first byt

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-11 Thread Daniel Borkmann
On 02/11/2013 12:50 AM, Greg KH wrote: On Mon, Feb 11, 2013 at 12:30:51AM +0100, Daniel Borkmann wrote: On 02/11/2013 12:24 AM, Joe Perches wrote: On Sun, 2013-02-10 at 23:00 +0100, Daniel Borkmann wrote: add memcmp_nta ({n}o {t}iming {a}ttacks) Why should this be in the kernel? As the com

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-10 Thread Greg KH
On Mon, Feb 11, 2013 at 12:30:51AM +0100, Daniel Borkmann wrote: > On 02/11/2013 12:24 AM, Joe Perches wrote: > >On Sun, 2013-02-10 at 23:00 +0100, Daniel Borkmann wrote: > >>add memcmp_nta ({n}o {t}iming {a}ttacks) > > > >Why should this be in the kernel? > > As the commit message already says, s

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-10 Thread Daniel Borkmann
On 02/11/2013 12:24 AM, Joe Perches wrote: On Sun, 2013-02-10 at 23:00 +0100, Daniel Borkmann wrote: add memcmp_nta ({n}o {t}iming {a}ttacks) Why should this be in the kernel? As the commit message already says, so that current or future (e.g.) network protocol code or modules can make use o

Re: [PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-10 Thread Joe Perches
On Sun, 2013-02-10 at 23:00 +0100, Daniel Borkmann wrote: > add memcmp_nta ({n}o {t}iming {a}ttacks) Why should this be in the kernel? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://v

[PATCH] lib: memcmp_nta: add timing-attack secure memcmp

2013-02-10 Thread Daniel Borkmann
If you need to compare a password or a hash value, the timing of the comparison function can give valuable clues to the attacker. Let's say the password is 123456 and the attacker tries abcdef. If the comparision function fails at the first byte without looking at the other bytes, then the attacker