From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602Ab2DCKmH (ORCPT ); Tue, 3 Apr 2012 06:42:07 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:39380 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027Ab2DCKmE convert rfc822-to-8bit (ORCPT ); Tue, 3 Apr 2012 06:42:04 -0400 MIME-Version: 1.0 In-Reply-To: References: <1330531826.3545.128.camel@sauron.fi.intel.com> <1332511796.18717.72.camel@sauron.fi.intel.com> <1332521515.22278.2.camel@sauron.fi.intel.com> <1332837188.31549.14.camel@sauron.fi.intel.com> <1333377383.22146.14.camel@sauron.fi.intel.com> <1333378674.22146.18.camel@sauron.fi.intel.com> From: Guillaume LECERF Date: Tue, 3 Apr 2012 12:41:42 +0200 X-Google-Sender-Auth: tRfXocJrK-XmRF1ImhULxqyxCOw Message-ID: Subject: Re: [patch] UBIFS: Add cryptographic functionality when a key is passed to the compress / decompress functions To: Joel Reardon Cc: Artem Bityutskiy , linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 2012/4/3 Joel Reardon : >  no_compr: >        memcpy(out_buf, in_buf, in_len); >        *out_len = in_len; >        *compr_type = UBIFS_COMPR_NONE; > +       goto encrypt; This goto seems unneeded here. > + > +encrypt: > +       if (crypto_key) { > +               u8 iv[UBIFS_CRYPTO_KEYSIZE]; > + > +               memset(iv, 0, UBIFS_CRYPTO_KEYSIZE); > +               ubifs_aes_crypt(out_buf, *out_len, crypto_key, iv); > +       } -- Guillaume LECERF OpenBricks developer - www.openbricks.org