Thread (4 messages) 4 messages, 1 author, 2015-01-11

Re: [PATCH v9 1/2] crypto: AF_ALG: add AEAD support

From: Stephan Mueller <hidden>
Date: 2015-01-11 16:16:59
Also in: linux-crypto, lkml

Am Sonntag, 11. Januar 2015, 04:45:53 schrieb Stephan Mueller:

Hi Herbert,
+static int aead_accept_parent(void *private, struct sock *sk)
+{
+	struct aead_ctx *ctx;
+	struct alg_sock *ask = alg_sk(sk);
+	unsigned int len = sizeof(*ctx) + crypto_aead_reqsize(private);
+	unsigned int ivlen = crypto_aead_ivsize(private);
+
+	ctx = sock_kmalloc(sk, len, GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;
+	memset(ctx, 0, len);
+
+	ctx->iv = sock_kmalloc(sk, ivlen, GFP_KERNEL);
+	if (!ctx->iv) {
+		sock_kfree_s(sk, ctx, len);
+		return -ENOMEM;
+	}
+	memset(ctx->iv, 0, ivlen);
+
+	ctx->len = len;
+	ctx->used = 0;
+	ctx->more = 0;
+	ctx->merge = 0;
+	ctx->enc = 0;
+	ctx->tsgl.cur = 0;
ctx->trunc = 0;

is missing here.

I would wait with a new patch once you had the chance to review the updates 
and provide comments.

Thanks
-- 
Ciao
Stephan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help