Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750814AbWHTOxP (ORCPT ); Sun, 20 Aug 2006 10:53:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750818AbWHTOxP (ORCPT ); Sun, 20 Aug 2006 10:53:15 -0400 Received: from mother.openwall.net ([195.42.179.200]:6080 "HELO mother.openwall.net") by vger.kernel.org with SMTP id S1750812AbWHTOxO (ORCPT ); Sun, 20 Aug 2006 10:53:14 -0400 Date: Sun, 20 Aug 2006 18:49:08 +0400 From: Solar Designer To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Herbert Xu Subject: Re: [PATCH] cit_encrypt_iv/cit_decrypt_iv for ECB mode Message-ID: <20060820144908.GA19602@openwall.com> References: <20060820002346.GA16995@openwall.com> <20060820080403.GA602@1wt.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060820080403.GA602@1wt.eu> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 38 On Sun, Aug 20, 2006 at 10:04:03AM +0200, Willy Tarreau wrote: > On Sun, Aug 20, 2006 at 04:23:46AM +0400, Solar Designer wrote: > > The attached patch actually defines ecb_encrypt_iv() and > > ecb_decrypt_iv() functions that perform ECB encryption/decryption > > ignoring the IV, yet return -ENOSYS (just like nocrypt_iv would). > > The result is no more Oopses and no infoleaks either. > > Can the cryptoloop patch use CRYPTO_TFM_MODE_CFB or CRYPTO_TFM_MODE_CTR > and so be redirected to nocrypt() which will leave uninitialized memory > too ? At least patch-cryptoloop-jari-2.4.22.0 in particular will only do CBC (default, preferred) or ECB (if requested); it won't attempt to use CFB or CTR. Regarding nocrypt*(): > I wonder whether we shouldn't consider that those functions must at > least clear the memory area that was submitted to them, such as > proposed below. It would also fix the problem for potential other > users. This makes sense to me, although it is not perfect as Herbert has correctly pointed out: > If the user is ignoring the error value here then you're in serious > trouble anyway since they've just lost all their data. Can we maybe define working but IV-ignoring functions for ECB (like I did), but use memory-clearing nocrypt*() for CFB and CTR (as long as these are not supported)? Of course, all of these will return -ENOSYS. Alexander - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/