| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Key-agreement Protocol Primitives (KPP) |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2016, Intel Corporation |
|---|
| 5 | 6 | * 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 | | - * |
|---|
| 12 | 7 | */ |
|---|
| 13 | 8 | #include <linux/errno.h> |
|---|
| 14 | 9 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 30 | 25 | { |
|---|
| 31 | 26 | struct crypto_report_kpp rkpp; |
|---|
| 32 | 27 | |
|---|
| 33 | | - strncpy(rkpp.type, "kpp", sizeof(rkpp.type)); |
|---|
| 28 | + memset(&rkpp, 0, sizeof(rkpp)); |
|---|
| 34 | 29 | |
|---|
| 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)); |
|---|
| 39 | 31 | |
|---|
| 40 | | -nla_put_failure: |
|---|
| 41 | | - return -EMSGSIZE; |
|---|
| 32 | + return nla_put(skb, CRYPTOCFGA_REPORT_KPP, sizeof(rkpp), &rkpp); |
|---|
| 42 | 33 | } |
|---|
| 43 | 34 | #else |
|---|
| 44 | 35 | static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) |
|---|