Re: [PATCH v2 04/19] crypto: ecrdsa - Migrate to sig_alg backend

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

 



On Wed, Sep 11, 2024 at 03:49:07PM +0300, Jarkko Sakkinen wrote:
> On Tue Sep 10, 2024 at 5:30 PM EEST, Lukas Wunner wrote:
> > A sig_alg backend has just been introduced with the intent of moving all
> > asymmetric sign/verify algorithms to it one by one.
> >
> > Migrate ecrdsa.c to the new backend.
[...]
> >  	if (!ctx->curve ||
> >  	    !ctx->digest ||
> > -	    !req->src ||
> > +	    !src ||
> > +	    !digest ||
> >  	    !ctx->pub_key.x ||
> > -	    req->dst_len != ctx->digest_len ||
> > -	    req->dst_len != ctx->curve->g.ndigits * sizeof(u64) ||
> > +	    dlen != ctx->digest_len ||
> > +	    dlen != ctx->curve->g.ndigits * sizeof(u64) ||
> >  	    ctx->pub_key.ndigits != ctx->curve->g.ndigits ||
> > -	    req->dst_len * 2 != req->src_len ||
> > -	    WARN_ON(req->src_len > sizeof(sig)) ||
> > -	    WARN_ON(req->dst_len > sizeof(digest)))
> > +	    dlen * 2 != slen ||
> > +	    WARN_ON(slen > ECRDSA_MAX_SIG_SIZE) ||
> > +	    WARN_ON(dlen > STREEBOG512_DIGEST_SIZE))
> 
> Despite being migration I don't see no point recycling use of WARN_ON()
> here, given panic_on_warn kernel command-line flag.
> 
> If you want to print to something, please do separate checks and use
> pr_warn() instead at most.

The object of the patch is to migrate ecrdsa.c to sig_alg with no
behavioral change.

If you feel the WARN_ON() is uncalled for, please submit a cleanup
patch.

Thanks,

Lukas




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