On Wed, Sep 16, 2020 at 12:07:31PM +0100, Elena Petrova wrote:
>
> @@ -148,20 +260,58 @@ static int rng_accept_parent(void *private, struct sock 
> *sk)
>        * state of the RNG.
>        */
>  
> -     ctx->drng = private;
> +     ctx->drng = pctx->drng;
>       ask->private = ctx;
>       sk->sk_destruct = rng_sock_destruct;
>  
> +     /*
> +      * Non NULL pctx->entropy means that CAVP test has been initiated on
> +      * this socket, replace proto_ops algif_rng_ops with algif_rng_test_ops.
> +      */
> +     if (pctx->entropy)
> +             sk->sk_socket->ops = &algif_rng_test_ops;
> +

Please make that

        if (IS_ENABLED(CONFIG_CRYPTO_USER_API_RNG_CAVP) && pctx->entropy)

so that this and the rest of the new code simply disappears when
the Kconfig option is off.

Thanks,
-- 
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

Reply via email to