hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/crypto/kpp.c
....@@ -1,14 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Key-agreement Protocol Primitives (KPP)
34 *
45 * Copyright (c) 2016, Intel Corporation
56 * Authors: Salvatore Benedetto <salvatore.benedetto@intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms of the GNU General Public License as published by the Free
9
- * Software Foundation; either version 2 of the License, or (at your option)
10
- * any later version.
11
- *
127 */
138 #include <linux/errno.h>
149 #include <linux/kernel.h>
....@@ -30,15 +25,11 @@
3025 {
3126 struct crypto_report_kpp rkpp;
3227
33
- strncpy(rkpp.type, "kpp", sizeof(rkpp.type));
28
+ memset(&rkpp, 0, sizeof(rkpp));
3429
35
- if (nla_put(skb, CRYPTOCFGA_REPORT_KPP,
36
- sizeof(struct crypto_report_kpp), &rkpp))
37
- goto nla_put_failure;
38
- return 0;
30
+ strscpy(rkpp.type, "kpp", sizeof(rkpp.type));
3931
40
-nla_put_failure:
41
- return -EMSGSIZE;
32
+ return nla_put(skb, CRYPTOCFGA_REPORT_KPP, sizeof(rkpp), &rkpp);
4233 }
4334 #else
4435 static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg)