diff options
author | Cristian Stoica <cristian.stoica@freescale.com> | 2015-01-07 17:55:02 +0800 |
---|---|---|
committer | Zhenhua Luo <zhenhua.luo@freescale.com> | 2015-01-08 18:18:00 +0800 |
commit | a24cf3acea3c6a7e639de78124c3d7f47989b8e4 (patch) | |
tree | e7000aaed5aa866fb31a8cccd96082850a4b51b0 | |
parent | 9e63ca38c4ccbf54228ac743936501f710f8a09e (diff) | |
download | meta-freescale-a24cf3acea3c6a7e639de78124c3d7f47989b8e4.tar.gz |
cryptodev: disable RSA_KEYGEN if pkc-host installed
Currently pkc-host does not support RSA_KEYGEN. When pkc-host
installed, RSA keygen operations should be avoided.
Introduce DISTRO_FEATURE "c29x_pkc". To install pkc-host, this
feature should be enabled. Then cryptodev checks it to disable
RSA_KEYGEN.
this can be done in conf/local.conf:
DISTRO_FEATURES_append = " c29x_pkc"
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
3 files changed, 41 insertions, 0 deletions
diff --git a/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0001-don-t-advertise-RSA-keygen.patch b/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0001-don-t-advertise-RSA-keygen.patch new file mode 100644 index 00000000..3d7c6086 --- /dev/null +++ b/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0001-don-t-advertise-RSA-keygen.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From b6e2a3747e3cffdf3cc515b0ce35d6bcdcb051c5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cristian Stoica <cristian.stoica@freescale.com> | ||
3 | Date: Tue, 9 Dec 2014 16:41:25 +0200 | ||
4 | Subject: [PATCH] don't advertise RSA keygen | ||
5 | |||
6 | This is supposed to avoid RSA keygen operations when they are not | ||
7 | available. Since no testing can be done, the patch should be applied | ||
8 | selectively (for example when offloading through pkc driver on C293) | ||
9 | |||
10 | Change-Id: I60765f46fd7a39053d42e075d2ec71b032b2ed8a | ||
11 | Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
12 | --- | ||
13 | ioctl.c | 3 +-- | ||
14 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/ioctl.c b/ioctl.c | ||
17 | index e907167..3239093 100644 | ||
18 | --- a/ioctl.c | ||
19 | +++ b/ioctl.c | ||
20 | @@ -961,8 +961,7 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_) | ||
21 | case CIOCASYMFEAT: | ||
22 | return put_user(CRF_MOD_EXP_CRT | CRF_MOD_EXP | CRF_DSA_SIGN | | ||
23 | CRF_DSA_VERIFY | CRF_DH_COMPUTE_KEY | | ||
24 | - CRF_DSA_GENERATE_KEY | CRF_DH_GENERATE_KEY | | ||
25 | - CRF_RSA_GENERATE_KEY, p); | ||
26 | + CRF_DSA_GENERATE_KEY | CRF_DH_GENERATE_KEY, p); | ||
27 | case CRIOGET: | ||
28 | fd = clonefd(filp); | ||
29 | ret = put_user(fd, p); | ||
30 | -- | ||
31 | 2.2.0 | ||
32 | |||
diff --git a/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-module_1.6.bbappend b/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-module_1.6.bbappend index 345a09d4..2bf012c1 100644 --- a/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-module_1.6.bbappend +++ b/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-module_1.6.bbappend | |||
@@ -6,3 +6,7 @@ do_install_append_qoriq-ppc () { | |||
6 | rm -fr ${D}/usr | 6 | rm -fr ${D}/usr |
7 | } | 7 | } |
8 | 8 | ||
9 | # Currently pkc-host does not support RSA_KEYGEN, remove this | ||
10 | # if it is fixed. | ||
11 | SRC_URI_append_qoriq-ppc = "${@base_contains('DISTRO_FEATURES', 'c29x_pkc', ' file://0001-don-t-advertise-RSA-keygen.patch', '', d)}" | ||
12 | |||
diff --git a/meta-fsl-ppc/recipes-kernel/pkc-host/pkc-host_git.bb b/meta-fsl-ppc/recipes-kernel/pkc-host/pkc-host_git.bb index 2e579c1e..2d5e3165 100644 --- a/meta-fsl-ppc/recipes-kernel/pkc-host/pkc-host_git.bb +++ b/meta-fsl-ppc/recipes-kernel/pkc-host/pkc-host_git.bb | |||
@@ -4,6 +4,11 @@ LICENSE = "GPLv2" | |||
4 | LIC_FILES_CHKSUM = "file://Makefile;endline=30;md5=6a26ed8e76a8ea2e019c525369ed0f03" | 4 | LIC_FILES_CHKSUM = "file://Makefile;endline=30;md5=6a26ed8e76a8ea2e019c525369ed0f03" |
5 | 5 | ||
6 | inherit module qoriq_build_64bit_kernel | 6 | inherit module qoriq_build_64bit_kernel |
7 | RDEPENDS_${PN} += "cryptodev-module" | ||
8 | |||
9 | # Currently pkc-host does not support RSA_KEYGEN, remove this | ||
10 | # if it is fixed. | ||
11 | REQUIRED_DISTRO_FEATURES = "c29x_pkc" | ||
7 | 12 | ||
8 | SRC_URI = "git://git.freescale.com/ppc/sdk/pkc-host.git;nobranch=1" | 13 | SRC_URI = "git://git.freescale.com/ppc/sdk/pkc-host.git;nobranch=1" |
9 | SRCREV = "cae512c94e2a26cc6b0d6393d307cdea2d7282c9" | 14 | SRCREV = "cae512c94e2a26cc6b0d6393d307cdea2d7282c9" |