summaryrefslogtreecommitdiff
path: root/crypto/shash.c
diff options
context:
space:
mode:
authorJames Morris <james.morris@microsoft.com>2019-01-10 11:41:59 -0800
committerJames Morris <james.morris@microsoft.com>2019-01-10 11:41:59 -0800
commit7ff17fe228094bad025c79c39e9e23af4364644c (patch)
tree05dc0dd252df9b5e3ed8e4429dc5f31c070e0f23 /crypto/shash.c
parent7271e588c712517a184f75744b6e94d05c8251a4 (diff)
parent9b882a6a998381cc1ea34edef55b8a6315114b7b (diff)
downloadlinux-crypto-7ff17fe228094bad025c79c39e9e23af4364644c.tar.gz
linux-crypto-7ff17fe228094bad025c79c39e9e23af4364644c.zip
Merge tag 'v5.0-rc1' into next-general
Linux 5.0-rc1 Sync to pick up LSM stacking work (which is based on -rc1).
Diffstat (limited to '')
-rw-r--r--crypto/shash.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/crypto/shash.c b/crypto/shash.c
index d21f04d7..44d297b8 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -408,18 +408,14 @@ static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
struct crypto_report_hash rhash;
struct shash_alg *salg = __crypto_shash_alg(alg);
- strncpy(rhash.type, "shash", sizeof(rhash.type));
+ memset(&rhash, 0, sizeof(rhash));
+
+ strscpy(rhash.type, "shash", sizeof(rhash.type));
rhash.blocksize = alg->cra_blocksize;
rhash.digestsize = salg->digestsize;
- if (nla_put(skb, CRYPTOCFGA_REPORT_HASH,
- sizeof(struct crypto_report_hash), &rhash))
- goto nla_put_failure;
- return 0;
-
-nla_put_failure:
- return -EMSGSIZE;
+ return nla_put(skb, CRYPTOCFGA_REPORT_HASH, sizeof(rhash), &rhash);
}
#else
static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)