Hi:
This series of patches converts ahash to the new algorithm format
just like shash. Note that I've incorporated a couple of the
previously posted patches (notably the padlock/hmac conversion)
into it.
At this point all implementations are either shash or ahash. So
we can now move forward to
crypto: shash - Export/import hash state only
This patch replaces the full descriptor export with an export of
the partial hash state. This allows the use of a consistent export
format across all implementations of a given algorithm.
This is useful because a number of cases require the use of th
crypto: shash - Move finup/digest null checks to registration time
This patch moves the run-time null finup/digest checks to the
shash_prepare_alg function which is run at registration time.
Signed-off-by: Herbert Xu
---
crypto/shash.c | 10 ++
1 file changed, 6 insertions(+), 4 dele
crypto: sha1_generic - Add export/import support
This patch adds export/import support to sha1_generic. The exported
type is defined by struct sha1_state, which is basically the entire
descriptor state of sha1_generic.
Signed-off-by: Herbert Xu
---
crypto/sha1_generic.c | 41 +++
crypto: sha256_generic - Use 64-bit counter like sha1
This patch replaces the two 32-bit counter code in sha256_generic
with the simpler 64-bit counter code from sha1.
Signed-off-by: Herbert Xu
---
crypto/sha256_generic.c | 65 ++--
1 file changed,
crypto: sha256_generic - Add export/import support
This patch adds export/import support to sha256_generic. The exported
type is defined by struct sha256_state, which is basically the entire
descriptor state of sha256_generic.
Signed-off-by: Herbert Xu
---
crypto/sha256_generic.c | 37 +
crypto: sha1-s390 - Add export/import support
This patch adds export/import support to sha1-s390. The exported
type is defined by struct sha1_state, which is basically the entire
descriptor state of sha1_generic.
Signed-off-by: Herbert Xu
---
arch/s390/crypto/sha1_s390.c | 26 ++
crypto: sha256-s390 - Add export/import support
This patch adds export/import support to sha256-s390. The exported
type is defined by struct sha256_state, which is basically the entire
descriptor state of sha256_generic.
Signed-off-by: Herbert Xu
---
arch/s390/crypto/sha256_s390.c | 26
crypto: padlock - Use shash fallback for sha
This patch changes padlock sha fallback to shash instead of hash.
Signed-off-by: Herbert Xu
---
drivers/crypto/padlock-sha.c | 82 +++
1 file changed, 52 insertions(+), 30 deletions(-)
diff --git a/drivers/
crypto: shash - Move null setkey check to registration time
This patch moves the run-time null setkey check to shash_prepare_alg
just like we did for finup/digest.
Signed-off-by: Herbert Xu
---
crypto/shash.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cry
crypto: async - Use kzfree for requests
This patch changes the kfree call to kzfree for async requests.
As the request may contain sensitive data it needs to be zeroed
before it can be reallocated by others.
Signed-off-by: Herbert Xu
---
include/crypto/hash.h |2 +-
include/linux/crypto.h
crypto: shash - Make descsize a run-time attribute
This patch changes descsize to a run-time attribute so that
implementations can change it in their init functions.
Signed-off-by: Herbert Xu
---
crypto/shash.c | 39 ---
include/crypto/hash
crypto: padlock - Switch sha to shash
This patch converts the padlock-sha implementation to shash.
In doing so the existing mechanism of storing the data until
final is no longer viable as we do not have a way of allocating
data in crypto_shash_init and then reliably freeing it.
This is just as w
crypto: hmac - Switch to shash
This patch changes hmac to the new shash interface.
Signed-off-by: Herbert Xu
---
crypto/hmac.c | 271 --
1 file changed, 114 insertions(+), 157 deletions(-)
diff --git a/crypto/hmac.c b/crypto/hmac.c
inde
crypto: xcbc - Switch to shash
This patch converts the xcbc algorithm to the new shash type.
Signed-off-by: Herbert Xu
---
crypto/xcbc.c | 235 +-
1 file changed, 87 insertions(+), 148 deletions(-)
diff --git a/crypto/xcbc.c b/crypto/xc
crypto: authenc - Remove reference to crypto_hash
Now that there are no more legacy hash implementations we can
remove the reference to crypto_hash.
Signed-off-by: Herbert Xu
---
crypto/authenc.c |6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/crypto/authenc.c b/cry
crypto: hash - Remove legacy hash/digest implementaion
This patch removes the implementation of hash and digest now that
no algorithms use them anymore. The interface though will remain
until the users are converted across.
Signed-off-by: Herbert Xu
---
crypto/Makefile |3 +--
crypto/ap
crypto: shash - Export async functions
This patch exports the async functions so that they can be reused
by cryptd when it switches over to using shash.
Signed-off-by: Herbert Xu
---
crypto/shash.c | 42 +
include/crypto/internal/hash.h
crypto: cryptd - Use shash algorithms
This patch changes cryptd to use shash algorithms instead of the
legacy hash interface.
Signed-off-by: Herbert Xu
---
crypto/cryptd.c | 164
1 file changed, 84 insertions(+), 80 deletions(-)
diff -
crypto: ahash - Add crypto_ahash_set_reqsize
This patch adds the helper crypto_ahash_set_reqsize so that
implementations do not directly access the crypto_ahash structure.
Signed-off-by: Herbert Xu
---
include/crypto/internal/hash.h |6 ++
1 file changed, 6 insertions(+)
diff --git a/
crypto: cryptd - Use crypto_ahash_set_reqsize
This patch makes cryptd use crypto_ahash_set_reqsize to avoid
accessing crypto_ahash directly.
Signed-off-by: Herbert Xu
---
crypto/cryptd.c |5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/crypto/cryptd.c b/crypto/cryptd
crypto: crypto4xx - Use crypto_ahash_set_reqsize
This patch makes crypto4xx use crypto_ahash_set_reqsize to avoid
accessing crypto_ahash directly.
Signed-off-by: Herbert Xu
---
drivers/crypto/amcc/crypto4xx_alg.c |3 ++-
drivers/crypto/amcc/crypto4xx_core.c |3 ++-
2 files changed, 4
crypto: api - Remove frontend argument from extsize/init_tfm
As the extsize and init_tfm functions belong to the frontend the
frontend argument is superfluous.
Signed-off-by: Herbert Xu
---
crypto/api.c|4 ++--
crypto/pcompress.c |6 ++
crypto/shash.c |
crypto: ahash - Convert to new style algorithms
This patch converts crypto_ahash to the new style. The old ahash
algorithm type is retained until the existing ahash implementations
are also converted. All ahash users will automatically get the
new crypto_ahash type.
Signed-off-by: Herbert Xu
-
crypto: tcrypt - Add mask parameter
This patch adds a mask parameter to complement the existing type
parameter. This is useful when instantiating algorithms that
require a mask other than the default, e.g., ahash algorithms.
Signed-off-by: Herbert Xu
---
crypto/tcrypt.c |9 ++---
1 fi
crypto: ahash - Add instance/spawn support
This patch adds support for creating ahash instances and using
ahash as spawns.
Signed-off-by: Herbert Xu
---
crypto/ahash.c | 72 +
include/crypto/internal/hash.h | 51 ++
crypto: hash - Add helpers to free spawns
This patch adds the helpers crypto_drop_ahash and crypto_drop_shash
so that these spawns can be dropped without ugly casts.
Signed-off-by: Herbert Xu
---
include/crypto/internal/hash.h | 10 ++
1 file changed, 10 insertions(+)
diff --git a/i
crypto: cryptd - Switch to new style ahash
This patch changes cryptd to use the new style ahash type. In
particular, the instance is enlarged to encapsulate the new
ahash_alg structure.
Signed-off-by: Herbert Xu
---
crypto/cryptd.c | 64 --
crypto: cryptd - Switch to template create API
This patch changes cryptd to use the template->create function
instead of alloc in anticipation for the switch to new style
ahash algorithms.
Signed-off-by: Herbert Xu
---
crypto/cryptd.c | 53 ++--
crypto: ahash - Use GFP_KERNEL in unaligned setkey
We currently use GFP_ATOMIC in the unaligned setkey function
to allocate the temporary aligned buffer. Since setkey must
be called in a sleepable context, we can use GFP_KERNEL instead.
Signed-off-by: Herbert Xu
---
crypto/ahash.c |2 +-
crypto: hash - Zap unaligned buffers
Some unaligned buffers on the stack weren't zapped properly which
may cause secret data to be leaked. This patch fixes them by doing
a zero memset.
It is also possible for us to place random kernel stack contents
in the digest buffer if a digest operation fai
crypto: crypto4xx - Disable SHA implementation
The crypto4xx SHA implementation keeps the hash state in the tfm
data structure. This breaks a fundamental requirement of ahash
implementations that they must be reentrant.
This patch disables the broken implementation.
Signed-off-by: Herbert Xu
-
crypto: ahash - Remove old_ahash_alg
Now that all ahash implementations have been converted to the new
ahash type, we can remove old_ahash_alg and its associated support.
Signed-off-by: Herbert Xu
---
crypto/ahash.c | 27 ---
crypto/shash.c
crypto: shash - Fix alignment in unaligned operations
When we encounter an unaligned pointer we are supposed to copy
it to a temporary aligned location. However the temporary buffer
isn't aligned properly. This patch fixes that.
Signed-off-by: Herbert Xu
---
crypto/shash.c |6 --
1 f
crypto: ahash - Add unaligned handling and default operations
This patch exports the finup operation where available and adds
a default finup operation for ahash. The operations final, finup
and digest also will now deal with unaligned result pointers by
copying it. Finally export/import operati
crypto: crypto4xx - Switch to new style ahash
This patch changes crypto4xx to use the new style ahash type.
In particular, we now use ahash_alg to define ahash algorithms
instead of crypto_alg.
This is achieved by introducing a union that encapsulates the
new type and the existing crypto_alg stru
On Wed, Jul 15, 2009 at 03:16:21PM +0800, Herbert Xu wrote:
> crypto: cryptd - Switch to template create API
>
> This patch changes cryptd to use the template->create function
> instead of alloc in anticipation for the switch to new style
> ahash algorithms.
>
> Signed-off-by: Herbert Xu
> ---
>
If cryptd_alloc_instance() fails, the return value is uninitialized.
This patch fixes this by setting the return value.
Signed-off-by: Steffen Klassert
---
crypto/cryptd.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index 5dabb7d..f
On Wed, Jul 15, 2009 at 10:47:23AM +0200, Steffen Klassert wrote:
>
> This introduces an uninitialized return value warning. err is not initialized
> if cryptd_alloc_instance() fails.
Good catch!
> Same here.
> I'll send a patch to fix it.
Thanks.
--
Visit Openswan at http://www.openswan.org/
E
On Wed, Jul 15, 2009 at 10:50:09AM +0200, Steffen Klassert wrote:
> If cryptd_alloc_instance() fails, the return value is uninitialized.
> This patch fixes this by setting the return value.
>
> Signed-off-by: Steffen Klassert
Patch applied. Thanks Steffen!
--
Visit Openswan at http://www.opens
On Wed, Jul 15, 2009 at 10:50:09AM +0200, Steffen Klassert wrote:
> If cryptd_alloc_instance() fails, the return value is uninitialized.
> This patch fixes this by setting the return value.
>
> Signed-off-by: Steffen Klassert
Just found two similar bugs in xcbc and hmac. I'll fix them up.
Than
On Wed, Jul 15, 2009 at 03:16:05PM +0800, Herbert Xu wrote:
> crypto: padlock - Switch sha to shash
>
> This patch converts the padlock-sha implementation to shash.
> In doing so the existing mechanism of storing the data until
> final is no longer viable as we do not have a way of allocating
> da
On Wed, Jul 15, 2009 at 12:28:18PM +0200, Steffen Klassert wrote:
>
> Just FYI, I'm getting the following compiler error:
Is this 32-bit or 64-bit?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~}
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://g
On Wed, Jul 15, 2009 at 06:30:25PM +0800, Herbert Xu wrote:
> On Wed, Jul 15, 2009 at 12:28:18PM +0200, Steffen Klassert wrote:
> >
> > Just FYI, I'm getting the following compiler error:
>
> Is this 32-bit or 64-bit?
>
It's 32-bit.
One of my test systems had padlock enabled by chance.
--
To uns
On Wed, Jul 15, 2009 at 12:36:46PM +0200, Steffen Klassert wrote:
>
> It's 32-bit.
> One of my test systems had padlock enabled by chance.
This should fix it.
commit faae890883624e14a328863eafabf54a36698774
Author: Herbert Xu
Date: Wed Jul 15 18:37:48 2009 +0800
crypto: padlock - Fix comp
On Wed, Jul 15, 2009 at 06:38:43PM +0800, Herbert Xu wrote:
> On Wed, Jul 15, 2009 at 12:36:46PM +0200, Steffen Klassert wrote:
> >
> > It's 32-bit.
> > One of my test systems had padlock enabled by chance.
>
> This should fix it.
>
Yes, it does.
Thanks!
--
To unsubscribe from this list: send th
Hi:
This patch fixes a crash caused by the new ahash code and hmac.
commit a70c522520d967844c01fa01459edc698fc54544
Author: Herbert Xu
Date: Wed Jul 15 20:39:05 2009 +0800
crypto: ahash - Fix setkey crash
When the alignment check was made unconditional for ahash we
may end up
Hi:
This one fixes failures when using shash algorithms through
ahash.
commit fa64966473830219fe74952029ddb0e981a87749
Author: Herbert Xu
Date: Wed Jul 15 21:16:05 2009 +0800
crypto: shash - Fix digest size offset
When an shash algorithm is exported as ahash, ahash will access
Hi:
commit cbc86b9161b40f95caee0e56381b68956fc28cc4
Author: Herbert Xu
Date: Wed Jul 15 21:26:41 2009 +0800
crypto: shash - Fix async finup handling of null digest
When shash_ahash_finup encounters a null request, we end up not
calling the underlying final function. This patc
* Herbert Xu | 2009-07-15 08:48:47 [+0800]:
>Yes, that should be enough. You don't even ipsec-tools, just
>a manual SA setup with ip xfrm should be good enough.
I did not get that far:
|alg: hash: Chunking test 1 failed for sha1-padlock
|: e9 95 22 0c 1b d1 0f 5f f1 fa ee 74 7d 27 cd b2
On Thu, Jul 16, 2009 at 12:06:06AM +0200, Sebastian Andrzej Siewior wrote:
> * Herbert Xu | 2009-07-15 08:48:47 [+0800]:
>
> >Yes, that should be enough. You don't even ipsec-tools, just
> >a manual SA setup with ip xfrm should be good enough.
>
> I did not get that far:
>
> |alg: hash: Chunkin
On Thu, Jul 16, 2009 at 10:16:01AM +0800, Herbert Xu wrote:
>
> Can you please pull my tree again? There were quite a few bugs
> that I fixed last night.
Oh and please make sure you have this patch applied too:
commit e9b25f16cda88b33fe15b30c009912e6c471edda
Author: Herbert Xu
Date: Thu Jul 16
52 matches
Mail list logo