]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/blkcipher.c
crypto: user - fix info leaks in report API
[mirror_ubuntu-bionic-kernel.git] / crypto / blkcipher.c
index e9e7244d5ef5bc4de642228d26933d97e75a8397..a79e7e9ab86e890d7eed95f3038b4424323a70f5 100644 (file)
@@ -499,9 +499,9 @@ static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_blkcipher rblkcipher;
 
-       snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "blkcipher");
-       snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s",
-                alg->cra_blkcipher.geniv ?: "<default>");
+       strncpy(rblkcipher.type, "blkcipher", sizeof(rblkcipher.type));
+       strncpy(rblkcipher.geniv, alg->cra_blkcipher.geniv ?: "<default>",
+               sizeof(rblkcipher.geniv));
 
        rblkcipher.blocksize = alg->cra_blocksize;
        rblkcipher.min_keysize = alg->cra_blkcipher.min_keysize;