Why do you have this magic number for the blocksize, and limit the code to 
this value?

int crypto_alloc_xcbc_block(struct crypto_tfm *tfm)
+{
+       struct xcbc_ops *ops;
+
+       BUG_ON(!crypto_tfm_alg_blocksize(tfm));
+       if (crypto_tfm_alg_blocksize(tfm) != 16)
+               return 0;


And then also use dynamic stack arrays based on the blocksize?

int crypto_xcbc_final(struct crypto_tfm *tfm, u8 *key, unsigned int keylen, u8 
*out)
+{
+       struct xcbc_ops *ops = (struct xcbc_ops*)tfm->crt_cipher.cit_xcbc_block;
+       const unsigned int bsize = crypto_tfm_alg_blocksize(tfm);
+       int ret = 0;
+
+       if (!(tfm->crt_cipher.cit_mode & CRYPTO_TFM_MODE_CBC))
+               return -EINVAL;
+
+       if (keylen != bsize)
+               return -EINVAL;
+
+       if (ops->len == bsize) {
+               u8 key2[bsize];


-- 
James Morris
<[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to