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]
Date:	Thu, 23 Apr 2009 13:31:19 -0400
From:	Jarod Wilson <jarod@...hat.com>
To:	Herbert Xu <herbert@...dor.apana.org.au>
CC:	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
	Neil Horman <nhorman@...driver.com>
Subject: Re: [PATCH 2/3] crypto: handle ccm dec test vectors expected to	fail
 verification

On 04/20/2009 02:25 AM, Herbert Xu wrote:
> On Wed, Apr 15, 2009 at 09:36:43AM -0400, Jarod Wilson wrote:
>> Add infrastructure to tcrypt to support handling ccm decryption test
>> vectors that are expected to fail verification.
>>
>> Signed-off-by: Jarod Wilson<jarod@...hat.com>
>>
>> ---
>>   crypto/testmgr.c |   32 ++++++++++++++++++++++++++++++++
>>   crypto/testmgr.h |    1 +
>>   2 files changed, 33 insertions(+), 0 deletions(-)
>>
>> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
>> index a8bdcb3..92f4df0 100644
>> --- a/crypto/testmgr.c
>> +++ b/crypto/testmgr.c
>> @@ -373,6 +373,16 @@ static int test_aead(struct crypto_aead *tfm, int enc,
>>
>>   			switch (ret) {
>>   			case 0:
>> +				if (template[i].novrfy) {
>> +					/* verification was supposed to fail */
>> +					printk(KERN_ERR "alg: aead: %s failed "
>> +					       "on test %d for %s: ret was 0, "
>> +					       "expected -EBADMSG\n",
>> +					       e, j, algo);
>> +					/* so really, we got a bad message */
>> +					ret = -EBADMSG;
>> +					goto out;
>> +				}
>>   				break;
>>   			case -EINPROGRESS:
>>   			case -EBUSY:
>> @@ -382,6 +392,10 @@ static int test_aead(struct crypto_aead *tfm, int enc,
>>   					INIT_COMPLETION(result.completion);
>>   					break;
>>   				}
>> +			case -EBADMSG:
>> +				if (template[i].novrfy)
>> +					/* verification failure was expected */
>> +					goto next_aead_vector;
>>   				/* fall through */
>
> How about just doing continue instead of having this goto?

Gah. Yeah, that makes sense. Relic of having some additional debug goo 
in there, where I wanted feedback from every loop of the test...

-- 
Jarod Wilson
jarod@...hat.com

--
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