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] [day] [month] [year] [list]
Message-ID: <wrfj1tehvv3d.fsf@redhat.com>
Date:	Wed, 02 Sep 2015 08:55:50 -0400
From:	Jes Sorensen <Jes.Sorensen@...hat.com>
To:	Michał Bartoszkiewicz <mbartoszkiewicz@...il.com>
Cc:	Larry Finger <Larry.Finger@...inger.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-wireless@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723au: remove unnecessary le32_to_cpu

Michał Bartoszkiewicz <mbartoszkiewicz@...il.com> writes:
> The values passed to le32_to_cpu are already in the correct byte order.
> This fixes four "cast to restricted __le32" sparse warnings.
>
> Signed-off-by: Michał Bartoszkiewicz <mbartoszkiewicz@...il.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_security.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Sounds OK to me - the fact we never hit problems with this is a good
indicator the hw crypt functions work.

Cheers,
Jes

>
> diff --git a/drivers/staging/rtl8723au/core/rtw_security.c b/drivers/staging/rtl8723au/core/rtw_security.c
> index 3d40bab..9d1cce1 100644
> --- a/drivers/staging/rtl8723au/core/rtw_security.c
> +++ b/drivers/staging/rtl8723au/core/rtw_security.c
> @@ -245,8 +245,8 @@ void rtw_wep_decrypt23a(struct rtw_adapter *padapter,
>  	arcfour_encrypt(&mycontext, payload, payload, length);
>  
>  	/* calculate icv and compare the icv */
> -	actual_crc = le32_to_cpu(getcrc32(payload, length - 4));
> -	expected_crc = le32_to_cpu(get_unaligned_le32(&payload[length - 4]));
> +	actual_crc = getcrc32(payload, length - 4);
> +	expected_crc = get_unaligned_le32(&payload[length - 4]);
>  
>  	if (actual_crc != expected_crc) {
>  		RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
> @@ -773,8 +773,8 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter,
>  	arcfour_init(&mycontext, rc4key, 16);
>  	arcfour_encrypt(&mycontext, payload, payload, length);
>  
> -	actual_crc = le32_to_cpu(getcrc32(payload, length - 4));
> -	expected_crc = le32_to_cpu(get_unaligned_le32(&payload[length - 4]));
> +	actual_crc = getcrc32(payload, length - 4);
> +	expected_crc = get_unaligned_le32(&payload[length - 4]);
>  
>  	if (actual_crc != expected_crc) {
>  		RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
--
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