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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux