lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2049245.HpByroTSUp@myon.chronox.de>
Date:	Tue, 26 Aug 2014 10:52:45 +0200
From:	Stephan Mueller <smueller@...onox.de>
To:	Herbert Xu <herbert@...dor.apana.org.au>
Cc:	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] DRBG: fix maximum value checks on 32 bit systems

Am Dienstag, 26. August 2014, 16:43:43 schrieb Herbert Xu:

Hi Herbert,

> On Tue, Aug 26, 2014 at 10:29:45AM +0200, Stephan Mueller wrote:
> > The maximum values for additional input string or generated blocks is
> > larger than 1<<32. To ensure a sensible value on 32 bit systems, return
> > SIZE_MAX on 32 bit systems. This value is lower than the maximum
> > allowed values defined in SP800-90A. The standard allow lower maximum
> > values, but not larger values.
> > 
> > SIZE_MAX - 1 is used for drbg_max_addtl to allow
> > drbg_healthcheck_sanity to check the enforcement of the variable
> > without wrapping.
> 
> This is really ugly but OK.  However, I'm not sure how the sanity
> check ever worked.  It would appear that the drbg_generate call in
> drbg_healthcheck_sanity should always fail because you explicitly
> set addtl->len to drbg_max_addtl + 1, which should trigger the
> "DRBG: additional information string too long" error, no?

That is exactly what the test shall do: the test is intended to check whether 
the maximum values are enforced. And it does that by checking whether an error 
is returned.

	/* get the maximum value */
        max_addtllen = drbg_max_addtl(drbg);
	/* add one to definitely overflow the maximum value */
        drbg_string_fill(&addtl, buf, max_addtllen + 1);
        /* overflow addtllen with additonal info string */
        len = drbg_generate(drbg, buf, OUTBUFLEN, &addtl);
	/*
	 * check that the drbg_generate does not return a positive
	 * value, i.e. check that drbg_generate does not generate anything
	 */
        BUG_ON(0 < len);
> 
> Obviously it's working for you but I'd like to understand why
> it's working and whether it'll continue to work.
> 
> Thanks,


-- 
Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ