]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - crypto/rsa-pkcs1pad.c
Merge tag 'riscv-for-linus-5.6-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / crypto / rsa-pkcs1pad.c
index 0aa489711ec497b53309a7c44fe87ec00faffe5a..176b63afec8d978de12b10a9828b6b8d0a96330e 100644 (file)
@@ -598,6 +598,7 @@ static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb)
 {
        const struct rsa_asn1_template *digest_info;
        struct crypto_attr_type *algt;
+       u32 mask;
        struct akcipher_instance *inst;
        struct pkcs1pad_inst_ctx *ctx;
        struct crypto_akcipher_spawn *spawn;
@@ -613,6 +614,8 @@ static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb)
        if ((algt->type ^ CRYPTO_ALG_TYPE_AKCIPHER) & algt->mask)
                return -EINVAL;
 
+       mask = crypto_requires_sync(algt->type, algt->mask);
+
        rsa_alg_name = crypto_attr_alg_name(tb[1]);
        if (IS_ERR(rsa_alg_name))
                return PTR_ERR(rsa_alg_name);
@@ -636,9 +639,8 @@ static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb)
        spawn = &ctx->spawn;
        ctx->digest_info = digest_info;
 
-       crypto_set_spawn(&spawn->base, akcipher_crypto_instance(inst));
-       err = crypto_grab_akcipher(spawn, rsa_alg_name, 0,
-                       crypto_requires_sync(algt->type, algt->mask));
+       err = crypto_grab_akcipher(spawn, akcipher_crypto_instance(inst),
+                                  rsa_alg_name, 0, mask);
        if (err)
                goto out_free_inst;