crypto: chacha20poly1305 - set cra_name correctly
Subsystems (2)
PATCH 1/1 crypto: chacha20poly1305 - set cra_name correctly
From: Eric Biggers <[email protected]>
commit 5e27f38f1f3f45a0c938299c3a34a2d2db77165a upstream. [Please apply to 4.4-stable.]
If the rfc7539 template is instantiated with specific implementations, e.g. "rfc7539(chacha20-generic,poly1305-generic)" rather than "rfc7539(chacha20,poly1305)", then the implementation names end up included in the instance's cra_name. This is incorrect because it then prevents all users from allocating "rfc7539(chacha20,poly1305)", if the highest priority implementations of chacha20 and poly1305 were selected. Also, the self-tests aren't run on an instance allocated in this way.
Fix it by setting the instance's cra_name from the underlying algorithms' actual cra_names, rather than from the requested names. This matches what other templates do.
--- crypto/chacha20poly1305.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/chacha20poly1305.c +2 -2
@@ -637,8 +637,8 @@ static int chachapoly_create(struct crypto_template *tmpl, struct rtattr **tb, err = -ENAMETOOLONG ;if (snprintf (inst->alg.base.cra_name,CRYPTO_MAX_ALG_NAME , -"%s(%s,%s)" , name, chacha_name, - poly_name) >=CRYPTO_MAX_ALG_NAME ) +"%s(%s,%s)" , name, chacha->cra_name, + poly->cra_name) >=CRYPTO_MAX_ALG_NAME ) goto out_drop_chacha; if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s,%s)", name, chacha->cra_driver_name,
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
Greg KH
maintainerQuoted 4 lines · Eric Biggers
From: Eric Biggers <[email protected]>
commit
5e27f38f1f3f45a0c938299c3a34a2d2db77165aupstream. [Please apply to 4.4-stable.]
Now applied, thanks.
greg k-h