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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 01 Jan 2018 07:03:46 -0800
From:   Joe Perches <joe@...ches.com>
To:     Joey Pabalinas <joeypabalinas@...il.com>,
        linux-crypto@...r.kernel.org
Cc:     herbert@...dor.apana.org.au, davem@...emloft.net,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: testmgr: change `guard` to unsigned char

On Mon, 2018-01-01 at 00:33 -1000, Joey Pabalinas wrote:
> When char is signed, storing the values 0xba (186) and 0xad (173) in the
> `guard` array produces signed overflow. Change the type of `guard` to
> unsigned char to remove undefined behavior.
[]
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
[]
> @@ -185,7 +185,7 @@ static int ahash_partial_update(struct ahash_request **preq,
>  	char *state;
>  	struct ahash_request *req;
>  	int statesize, ret = -EINVAL;
> -	const char guard[] = { 0x00, 0xba, 0xad, 0x00 };
> +	const unsigned char guard[] = { 0x00, 0xba, 0xad, 0x00 };

Might as well add static too

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ