qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 54/54] crypto: Introduce RSA algorithm


From: Michael S. Tsirkin
Subject: Re: [PULL 54/54] crypto: Introduce RSA algorithm
Date: Fri, 10 Jun 2022 20:35:58 -0400

On Fri, Jun 10, 2022 at 11:05:13AM -0700, Richard Henderson wrote:
> On 6/10/22 08:55, Philippe Mathieu-Daudé wrote:
> > On 10/6/22 09:59, Michael S. Tsirkin wrote:
> > > From: zhenwei pi <pizhenwei@bytedance.com>
> > > +static int cryptodev_builtin_set_rsa_options(
> > > +                    int virtio_padding_algo,
> > > +                    int virtio_hash_algo,
> > > +                    QCryptoAkCipherOptionsRSA *opt,
> > > +                    Error **errp)
> > > +{
> > > +    if (virtio_padding_algo == VIRTIO_CRYPTO_RSA_PKCS1_PADDING) {
> > > +        opt->padding_alg = QCRYPTO_RSA_PADDING_ALG_PKCS1;
> > > +        opt->hash_alg =
> > > +            cryptodev_builtin_get_rsa_hash_algo(virtio_hash_algo, errp);
> > > +        if (opt->hash_alg < 0) {
> > > +            return -1;
> > > +        }
> > > +        return 0;
> > > +    }
> > > +
> > > +    if (virtio_padding_algo == VIRTIO_CRYPTO_RSA_RAW_PADDING) {
> > > +        opt->padding_alg = QCRYPTO_RSA_PADDING_ALG_RAW;
> > > +        return 0;
> > > +    }
> > > +
> > > +    error_setg(errp, "Unsupported rsa padding algo: %d", 
> > > virtio_padding_algo);
> > > +    return -1;
> > > +}
> > 
> > Build failure:
> > 
> > ../backends/cryptodev-builtin.c:187:27: error: result of comparison of
> > unsigned enum expression < 0 is always false
> > [-Werror,-Wtautological-unsigned-enum-zero-compare]
> >          if (opt->hash_alg < 0) {
> >              ~~~~~~~~~~~~~ ^ ~
> 
> Yep, e.g.
> 
> https://gitlab.com/qemu-project/qemu/-/jobs/2574418442
> 


Dropped now and re-pushed a tag. Can you try pulling that pls?

> r~




reply via email to

[Prev in Thread] Current Thread [Next in Thread]