public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean-Luc Cooke <jlcooke@certainkey.com>
To: Christophe Saout <christophe@saout.de>
Cc: jmorris@intercode.com.au, linux-kernel@vger.kernel.org
Subject: Re: cryptoapi OMAC (was: cryptoapi highmem bug)
Date: Wed, 25 Feb 2004 15:59:52 -0500	[thread overview]
Message-ID: <20040225205952.GB7140@certainkey.com> (raw)
In-Reply-To: <20040225181131.GA8983@leto.cs.pocnet.net>

OK.

Using a base kernel, apply the scatterwalk change:
  http://jlcooke.ca/lkml/cryptowalk_christophe_25feb2004.patch

Then apply this:
  http://jlcooke.ca/lkml/crypto_omac_hmac_ctr_25feb2004.patch

This is my HMAC/OMAC/CTR patch.  I think I fixed your HMAC issue.
I was giving a scatterlist a stack memory reference (!).  It now more
closely uses the digest.c functions.

JLC

On Wed, Feb 25, 2004 at 07:11:33PM +0100, Christophe Saout wrote:
> On Wed, Feb 25, 2004 at 11:09:35AM -0500, Jean-Luc Cooke wrote:
> 
> > http://jlcooke.ca/lkml/crypto_24feb2004.patch will work.
> 
> It didn't compile. I fixed some compile problems so that it works.
> I have disabled CRYPTO_OMAC though. And it goes boom when calling
> hmac_init (or something like that), the machine halts without Oops.
> 
> I've seen the cit_omac is kmalloc'ed. Hmm. Didn't we want to try
> to avoid that? Well. Perhaps it should be allocated when the
> omac_init is called and freed after omac_final.
> 
> Or what about this:
> If the user wants OMAC he calls omac_init and passes a pointer to
> a buffer where the omac will be computed. omac_init then sets
> the omac_update function so that xxx_process will call it. After
> the encryption is finished the user calls omac_final and finds
> the omac in his buffer.
> 
> And shouldn't the omac functions be put into a separate omac.c?
> 
> Moving the scatterwalk functions seems like a good idea to me.
> 
> Well, here are the compile fixes:
> 
> diff -Nur linux.orig/crypto/cipher.c linux/crypto/cipher.c
> --- linux.orig/crypto/cipher.c	2004-02-25 18:58:22.955601768 +0100
> +++ linux/crypto/cipher.c	2004-02-25 18:59:30.970261968 +0100
> @@ -280,7 +280,7 @@
>  			/* mac = Zeros */
>  			memset((u8*)tfm->crt_u.cipher.cit_omac, 0, crypto_tfm_alg_blocksize(tfm));
>  		}
> -#endif
> +#endif /* CONFIG_CRYPTO_OMAC */
>  
>  		return ret;
>  	}
> @@ -475,9 +475,12 @@
>  	    	ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL);
>  		if (ops->cit_iv == NULL)
>  			ret = -ENOMEM;
> +
> +#ifdef CONFIG_CRYPTO_OMAC
>  		ops->cit_omac = kmalloc(ops->cit_ivsize, GFP_KERNEL);
>  		if (ops->cit_omac == NULL)
>  			ret = -ENOMEM;
> +#endif /* CONFIG_CRYPTO_OMAC */
>  	}
>  
>  #ifdef CONFIG_CRYPTO_OMAC
> @@ -499,5 +502,5 @@
>  #ifdef CONFIG_CRYPTO_OMAC
>  	if (tfm->crt_cipher.cit_omac)
>  		kfree(tfm->crt_cipher.cit_omac);
> -#endif
> +#endif /* CONFIG_CRYPTO_OMAC */
>  }
> -
> 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/

-- 
http://www.certainkey.com
Suite 4560 CTTC
1125 Colonel By Dr.
Ottawa ON, K1S 5B6

  reply	other threads:[~2004-02-25 21:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-24 20:49 cryptoapi highmem bug Christophe Saout
2004-02-24 22:34 ` Jean-Luc Cooke
2004-02-24 23:01   ` Christophe Saout
2004-02-25  4:32     ` Jean-Luc Cooke
2004-02-25  6:00       ` Andrew Morton
2004-02-25 13:27         ` James Morris
2004-02-25 15:17           ` Jean-Luc Cooke
2004-02-25 19:50           ` Andrew Morton
2004-02-25 21:27             ` Christophe Saout
2004-02-25 21:41               ` Jean-Luc Cooke
2004-02-25 22:55             ` [PATCH 1/2] move scatterwalk functions to own file Christophe Saout
2004-02-25 22:55             ` [PATCH 2/2] fix in-place de/encryption bug with highmem Christophe Saout
2004-02-26  4:13               ` James Morris
2004-02-26 11:03                 ` Christophe Saout
2004-02-25 15:31         ` cryptoapi highmem bug Christophe Saout
2004-02-25 15:51           ` Christophe Saout
2004-02-25 15:44             ` Jean-Luc Cooke
2004-02-25 16:13               ` Christophe Saout
2004-02-25 16:09                 ` Jean-Luc Cooke
2004-02-25 18:11                   ` cryptoapi OMAC (was: cryptoapi highmem bug) Christophe Saout
2004-02-25 20:59                     ` Jean-Luc Cooke [this message]
2004-02-25 21:44                       ` Christophe Saout
2004-02-25 18:15               ` cryptoapi highmem bug Christophe Saout
2004-02-25 20:12                 ` Jean-Luc Cooke
2004-02-25 20:39                   ` Christophe Saout
2004-02-25 20:46                     ` Jean-Luc Cooke
2004-02-25 21:36                       ` Christophe Saout
2004-02-25 21:52                         ` Jean-Luc Cooke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040225205952.GB7140@certainkey.com \
    --to=jlcooke@certainkey.com \
    --cc=christophe@saout.de \
    --cc=jmorris@intercode.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox