aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r--crypto/crypto_user.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 41dfe762b7fb..11dbd5a81c72 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -27,6 +27,7 @@
27#include <net/net_namespace.h> 27#include <net/net_namespace.h>
28#include <crypto/internal/aead.h> 28#include <crypto/internal/aead.h>
29#include <crypto/internal/skcipher.h> 29#include <crypto/internal/skcipher.h>
30#include <crypto/akcipher.h>
30 31
31#include "internal.h" 32#include "internal.h"
32 33
@@ -110,6 +111,21 @@ nla_put_failure:
110 return -EMSGSIZE; 111 return -EMSGSIZE;
111} 112}
112 113
114static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg)
115{
116 struct crypto_report_akcipher rakcipher;
117
118 strncpy(rakcipher.type, "akcipher", sizeof(rakcipher.type));
119
120 if (nla_put(skb, CRYPTOCFGA_REPORT_AKCIPHER,
121 sizeof(struct crypto_report_akcipher), &rakcipher))
122 goto nla_put_failure;
123 return 0;
124
125nla_put_failure:
126 return -EMSGSIZE;
127}
128
113static int crypto_report_one(struct crypto_alg *alg, 129static int crypto_report_one(struct crypto_alg *alg,
114 struct crypto_user_alg *ualg, struct sk_buff *skb) 130 struct crypto_user_alg *ualg, struct sk_buff *skb)
115{ 131{
@@ -154,6 +170,12 @@ static int crypto_report_one(struct crypto_alg *alg,
154 goto nla_put_failure; 170 goto nla_put_failure;
155 171
156 break; 172 break;
173
174 case CRYPTO_ALG_TYPE_AKCIPHER:
175 if (crypto_report_akcipher(skb, alg))
176 goto nla_put_failure;
177
178 break;
157 } 179 }
158 180
159out: 181out: