[patch] UBIFS: Add cryptographic functionality when a key is passed to the compress / decompress functions

Guillaume LECERF glecerf at gmail.com
Tue Apr 3 06:41:42 EDT 2012


Hi,

2012/4/3 Joel Reardon <joel at clambassador.com>:
>  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



More information about the linux-mtd mailing list