From: "Miloslav Trmač" <mitr@redhat.com>
To: eparis@redhat.com, herbert@gondor.hengli.com.au
Cc: linux-audit@redhat.com, linux-crypto@vger.kernel.org,
"Miloslav Trmač" <mitr@redhat.com>
Subject: [PATCH 3/5] Add "alg_name" operation to af_alg_type.
Date: Wed, 24 Nov 2010 18:05:53 +0100 [thread overview]
Message-ID: <1290618355-31193-4-git-send-email-mitr@redhat.com> (raw)
In-Reply-To: <1290618355-31193-1-git-send-email-mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
---
crypto/algif_hash.c | 6 ++++++
crypto/algif_skcipher.c | 6 ++++++
include/crypto/if_alg.h | 1 +
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index f08a42c..3a61e9d 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -243,6 +243,11 @@ static void hash_release(void *private)
crypto_free_ahash(private);
}
+static const char *hash_alg_name(void *private)
+{
+ return crypto_tfm_alg_name(crypto_ahash_tfm(private));
+}
+
static int hash_setkey(void *private, const u8 *key, unsigned int keylen)
{
return crypto_ahash_setkey(private, key, keylen);
@@ -296,6 +301,7 @@ static int hash_accept_parent(void *private, struct sock *sk)
static const struct af_alg_type algif_type_hash = {
.bind = hash_bind,
.release = hash_release,
+ .alg_name = hash_alg_name,
.setkey = hash_setkey,
.accept = hash_accept_parent,
.ops = &algif_hash_ops,
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 4069460..e14c8be 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -561,6 +561,11 @@ static void skcipher_release(void *private)
crypto_free_ablkcipher(private);
}
+static const char *skcipher_alg_name(void *private)
+{
+ return crypto_tfm_alg_name(crypto_ablkcipher_tfm(private));
+}
+
static int skcipher_setkey(void *private, const u8 *key, unsigned int keylen)
{
return crypto_ablkcipher_setkey(private, key, keylen);
@@ -619,6 +624,7 @@ static int skcipher_accept_parent(void *private, struct sock *sk)
static const struct af_alg_type algif_type_skcipher = {
.bind = skcipher_bind,
.release = skcipher_release,
+ .alg_name = skcipher_alg_name,
.setkey = skcipher_setkey,
.accept = skcipher_accept_parent,
.ops = &algif_skcipher_ops,
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 336b9f2..092c599 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -49,6 +49,7 @@ struct af_alg_control {
struct af_alg_type {
void *(*bind)(const char *name, u32 type, u32 mask);
void (*release)(void *private);
+ const char *(*alg_name)(void *private);
int (*setkey)(void *private, const u8 *key, unsigned int keylen);
int (*accept)(void *private, struct sock *sk);
--
1.7.3.2
next prev parent reply other threads:[~2010-11-24 17:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-24 17:05 [PATCH 0/5] RFC v2: AF_ALG auditing Miloslav Trmač
2010-11-24 17:05 ` [PATCH 1/5] Add general crypto auditing infrastructure Miloslav Trmač
2010-11-24 17:05 ` [PATCH 2/5] Add unique IDs to AF_ALG sockets Miloslav Trmač
2010-11-24 17:05 ` Miloslav Trmač [this message]
2010-11-24 17:05 ` [PATCH 4/5] Audit type-independent events Miloslav Trmač
2010-11-24 17:05 ` [PATCH 5/5] Audit type-specific crypto operations Miloslav Trmač
2010-12-02 7:48 ` [PATCH 0/5] RFC v2: AF_ALG auditing Herbert Xu
-- strict thread matches above, loose matches on Subject: below --
2010-11-23 12:47 RFC: " Miloslav Trmac
2010-11-23 12:50 ` [PATCH 3/5] Add "alg_name" operation to af_alg_type Miloslav Trmač
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=1290618355-31193-4-git-send-email-mitr@redhat.com \
--to=mitr@redhat.com \
--cc=eparis@redhat.com \
--cc=herbert@gondor.hengli.com.au \
--cc=linux-audit@redhat.com \
--cc=linux-crypto@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