From owner-freebsd-geom@FreeBSD.ORG Sun Sep 13 00:23:53 2009 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D571106566B for ; Sun, 13 Sep 2009 00:23:53 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id CE0B38FC14 for ; Sun, 13 Sep 2009 00:23:52 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mmcsh-0007C5-IH for freebsd-geom@freebsd.org; Sun, 13 Sep 2009 02:23:51 +0200 Received: from 93-138-12-239.adsl.net.t-com.hr ([93.138.12.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 13 Sep 2009 02:23:51 +0200 Received: from ivoras by 93-138-12-239.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 13 Sep 2009 02:23:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Date: Sun, 13 Sep 2009 02:23:05 +0200 Lines: 48 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig0367ACFB651763C964207A31" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 93-138-12-239.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Enigmail-Version: 0.96.0 Sender: news Subject: g_eli ivgen X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 00:23:53 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig0367ACFB651763C964207A31 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm looking at doing something in GELI and I've come across the following code in g_eli.c: 381 void 382 g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv,= 383 size_t size) 384 { 385 u_char off[8], hash[SHA256_DIGEST_LENGTH]; 386 SHA256_CTX ctx; 387 388 if (!(sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER)) 389 le64enc(off, (uint64_t)offset); 390 /* Copy precalculated SHA256 context for IV-Key. */ 391 bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); 392 SHA256_Update(&ctx, (uint8_t *)&offset, sizeof(offset)); 393 SHA256_Final(hash, &ctx); 394 bcopy(hash, iv, size); 395 } I don't get the purpose of the off variable - specifically, it looks unused. It looks to me like the idea was to convert offset to off if G_ELI_FLAG_NATIVE_BYTE_ORDER is not set but then it never got used and there's an "else" clause missing. Is this correct or am I missing somethi= ng? --------------enig0367ACFB651763C964207A31 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqsO28ACgkQldnAQVacBchVlwCeOCeFnQhtxk8Af1JYzeRjREUf 8CsAoLcn8WV3bbAOl4YzaI8XDzMAOVNk =0CZM -----END PGP SIGNATURE----- --------------enig0367ACFB651763C964207A31--