Re: [patch] [CRYPTO] add alignment for setkey()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 10, 2007 at 11:57:17AM +0200, Sebastian Siewior wrote:
> setkey() in {cipher,blkcipher,ablkcipher,hash}.c does not respect the
> requested alignment by the algorithm. This patch fixes it.

Thanks for the patch!
  
> +static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen,
> +		unsigned long alignmask)
> +{
> +	struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher;
> +	u8 buffer[keylen + alignmask];

Hmm, I'm not comfortable with this since keylen could be unbounded,
especially for hash algorithms.  How about getting the memory via
kmalloc instead?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux