summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0016-add-basic-detection-of-asym-features.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0016-add-basic-detection-of-asym-features.patch')
-rw-r--r--recipes-kernel/cryptodev/sdk_patches/0016-add-basic-detection-of-asym-features.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0016-add-basic-detection-of-asym-features.patch b/recipes-kernel/cryptodev/sdk_patches/0016-add-basic-detection-of-asym-features.patch
new file mode 100644
index 0000000..9301349
--- /dev/null
+++ b/recipes-kernel/cryptodev/sdk_patches/0016-add-basic-detection-of-asym-features.patch
@@ -0,0 +1,37 @@
1From 4ce4081d9abef651473e9d7e089a0748f77db631 Mon Sep 17 00:00:00 2001
2From: Cristian Stoica <cristian.stoica@freescale.com>
3Date: Mon, 20 Apr 2015 13:18:47 +0300
4Subject: [PATCH 16/38] add basic detection of asym features
5
6Change-Id: I3b3ba8664bf631a63be1f11e715024509e20f841
7Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
8---
9 ioctl.c | 12 ++++++++----
10 1 file changed, 8 insertions(+), 4 deletions(-)
11
12diff --git a/ioctl.c b/ioctl.c
13index da3a842..53dbf64 100644
14--- a/ioctl.c
15+++ b/ioctl.c
16@@ -977,10 +977,14 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_)
17
18 switch (cmd) {
19 case CIOCASYMFEAT:
20- return put_user(CRF_MOD_EXP_CRT | CRF_MOD_EXP | CRF_DSA_SIGN |
21- CRF_DSA_VERIFY | CRF_DH_COMPUTE_KEY |
22- CRF_DSA_GENERATE_KEY | CRF_DH_GENERATE_KEY |
23- CRF_RSA_GENERATE_KEY, p);
24+ ses = 0;
25+ if (crypto_has_alg("pkc(rsa)", 0, 0))
26+ ses = CRF_MOD_EXP_CRT | CRF_MOD_EXP | CRF_RSA_GENERATE_KEY;
27+ if (crypto_has_alg("pkc(dsa)", 0, 0))
28+ ses |= CRF_DSA_SIGN | CRF_DSA_VERIFY | CRF_DSA_GENERATE_KEY;
29+ if (crypto_has_alg("pkc(dh)", 0, 0))
30+ ses |= CRF_DH_COMPUTE_KEY |CRF_DH_GENERATE_KEY;
31+ return put_user(ses, p);
32 case CRIOGET:
33 fd = clonefd(filp);
34 ret = put_user(fd, p);
35--
362.7.0
37