Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2014 20:55:46 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        "Bjoern A. Zeeb" <bz@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org>
Subject:   Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde
Message-ID:  <A4F3E6DC-13F9-4DCE-BA76-50A93EEB7D2E@FreeBSD.org>
In-Reply-To: <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org>
References:  <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

On 10 Nov 2014, at 16:10, Bjoern A. Zeeb <bz@FreeBSD.org> wrote:
>=20
> On 10 Nov 2014, at 09:44 , Dag-Erling Sm=F8rgrav <des@FreeBSD.org> =
wrote:
>=20
>> Author: des
>> Date: Mon Nov 10 09:44:38 2014
>> New Revision: 274340
>> URL: https://svnweb.freebsd.org/changeset/base/274340
>>=20
>> Log:
>> Constify the AES code and propagate to consumers.  This allows us to
>> update the Fortuna code to use SHAd-256 as defined in FS&K.
>>=20
>> Approved by:	so (self)
>=20
> This fails to compile on all gcc platforms.
>=20
> cc1: warnings being treated as errors
> =
/scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae=
l/rijndael-api-fst.c: In function 'rijndael_padEncrypt':
> =
/scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae=
l/rijndael-api-fst.c:236: warning: cast discards qualifiers from pointer =
target type
> =
/scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae=
l/rijndael-api-fst.c:237: warning: cast discards qualifiers from pointer =
target type
> =
/scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae=
l/rijndael-api-fst.c:238: warning: cast discards qualifiers from pointer =
target type
> =
/scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndae=
l/rijndael-api-fst.c:239: warning: cast discards qualifiers from pointer =
target type
> --- rijndael-api-fst.o ---
> *** [rijndael-api-fst.o] Error code 1

Proposed fix (the lines were too long anyway, so I didn't see reason to =
change that):

Index: sys/crypto/rijndael/rijndael-api-fst.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/crypto/rijndael/rijndael-api-fst.c      (revision 274350)
+++ sys/crypto/rijndael/rijndael-api-fst.c      (working copy)
@@ -233,10 +233,10 @@
        case MODE_CBC:
                iv =3D cipher->IV;
                for (i =3D numBlocks; i > 0; i--) {
-                       ((u_int32_t*)block)[0] =3D =
((u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0];
-                       ((u_int32_t*)block)[1] =3D =
((u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1];
-                       ((u_int32_t*)block)[2] =3D =
((u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2];
-                       ((u_int32_t*)block)[3] =3D =
((u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3];
+                       ((u_int32_t*)block)[0] =3D ((const =
u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0];
+                       ((u_int32_t*)block)[1] =3D ((const =
u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1];
+                       ((u_int32_t*)block)[2] =3D ((const =
u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2];
+                       ((u_int32_t*)block)[3] =3D ((const =
u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3];
                        rijndaelEncrypt(key->rk, key->Nr, block, =
outBuffer);
                        iv =3D outBuffer;
                        input +=3D 16;

-Dimitry


--Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.26

iEYEARECAAYFAlRhGFAACgkQsF6jCi4glqOidACgmCde+diAOGfa+D3zLdIbSusP
UBAAn2++W5nL4Qg988Dnhz17VB2LV7om
=MUKa
-----END PGP SIGNATURE-----

--Apple-Mail=_53257F3D-7477-437C-94B4-60A519E00290--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A4F3E6DC-13F9-4DCE-BA76-50A93EEB7D2E>