Re: [PATCH v4 00/17] crypto user configuration api

2011-10-21 Thread Herbert Xu
On Tue, Sep 27, 2011 at 07:20:50AM +0200, Steffen Klassert wrote:
 This patchset adds a netlink based user configuration API for the crypto
 layer, similar to the configuration API of xfrm.

All applied to cryptodev.  Thanks!

I added this little fix on top:

commit e6ea64ece7f4c14294b2fce5403b1e71eab87f1e
Author: Herbert Xu herb...@gondor.apana.org.au
Date:   Fri Oct 21 14:37:10 2011 +0200

crypto: user - Initialise match in crypto_alg_match

We need to default match to 0 as otherwise it may lead to a false
positive.

Signed-off-by: Herbert Xu herb...@gondor.apana.org.au

diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 748990f..2abca78 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -40,7 +40,6 @@ struct crypto_dump_info {
 
 static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int 
exact)
 {
-   int match;
struct crypto_alg *q, *alg = NULL;
 
down_read(crypto_alg_sem);
@@ -49,6 +48,7 @@ static struct crypto_alg *crypto_alg_match(struct 
crypto_user_alg *p, int exact)
return NULL;
 
list_for_each_entry(q, crypto_alg_list, cra_list) {
+   int match = 0;
 
if ((q-cra_flags ^ p-cru_type)  p-cru_mask)
continue;

Cheers,
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 00/17] crypto user configuration api

2011-09-26 Thread Steffen Klassert
This patchset adds a netlink based user configuration API for the crypto
layer, similar to the configuration API of xfrm.

The patchset is based on the current cryptodev tree.

A userspace tool that makes use of the configuration API is available at

https://sourceforge.net/projects/crconf/files/crconf-pre2.tar.gz

With this it is possible to instantiate certain algorithms by doing

crconf add driver cbc(aes-generic) type 4

or

crconf add driver cbc(aes-generic) type 4 priority 100

To remove a (form templates build and unused) algorithm with all subsequent
algorithms do

crconf del driver cbc(aes-generic) type 4

It is possible to update the priority of an algorithm by doing

crconf update driver cbc(aes-generic) type 4 priority 200

this updates the priority of this algorithm and removes all algorithms
on top.

Finally it is possible to print the instantiated crypto algorithms
similar to /proc/crypto by doing

crconf show all

This prints the algorithm informations of all instantiated algorithms
as long as the information fits into a netlink message.

Changes from v1:

- Removed the priority update functions.
- Fix algorithm information printing when build as module.
- Update the crconf tool according to the kernel changes.

Changes from v2:

- Use one structure for creating and basic querying of algorithms.
- Send the algorithm flags to userspace, so the userspace can
  check for things like passed selftest, async algorithms etc.
- Update the crconf tool according to the kernel changes.
- Add some priority update functions. We need to be able to update
  the priority of algorithms, as we can't delete core algorithms like
  aes-generic. When we update the priority of an algorithm, we remove
  all algorithms on top.

Changes from v3:

- Remove the priority field from struct crypto_user_alg and use the
  existing netlink attribute to send the priority value to userspace.
- Update the crconf tool according to the kernel changes.
- Don't distinguish between netlink attributes that use the same
  type value.

Steffen
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html