mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] openssl: Add config option to select cryptodev engine
@ 2012-05-28 12:42 Bart vdr. Meulen
  2012-05-30  7:28 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Bart vdr. Meulen @ 2012-05-28 12:42 UTC (permalink / raw)
  To: ptxdist

From: Harro Haan <hrhaan@gmail.com>

Use PTXCONF_OPENSSL_HAVE_CRYPTODEV to enable the BSD cryptodev engine even if
you are not using BSD. Useful if you are running ocf-linux or something similar.
Once enabled you can also enable the use of cryptodev digests, which is usually
slower unless you have large amounts of data.
Use PTXCONF_OPENSSL_USE_CRYPTODEV_DIGESTS to force it.

Signed-off-by: Harro Haan <hrhaan@gmail.com>
---
 rules/openssl.in   |   19 +++++++++++++++++++
 rules/openssl.make |   13 +++++++++++++
 2 files changed, 32 insertions(+)
 mode change 100644 => 100755 rules/openssl.in
 mode change 100644 => 100755 rules/openssl.make

diff --git a/rules/openssl.in b/rules/openssl.in
old mode 100644
new mode 100755
index a17c05d..00aba1d
--- a/rules/openssl.in
+++ b/rules/openssl.in
@@ -5,6 +5,7 @@ menuconfig OPENSSL
 	select LIBC_DL
 	select GCCLIBS_GCC_S
 	prompt "openssl                       "
+	select KERNEL_HEADER if OPENSSL_HAVE_CRYPTODEV
 	help
 	  Secure Socket Layer (SSL) binary and related cryptographic tools
 
@@ -34,3 +35,21 @@ config OPENSSL_SHARED
 	depends on OPENSSL
 	help
 	  Whether to build OpenSSL with shared libraries.
+
+config OPENSSL_HAVE_CRYPTODEV
+	bool "Add -DHAVE_CRYPTODEV"
+	default n
+	depends on OPENSSL
+	help
+	  Use -DHAVE_CRYPTODEV to enable the BSD cryptodev engine even
+	  if we are not using BSD. Useful if you are running ocf-linux
+	  or something similar.
+
+config OPENSSL_USE_CRYPTODEV_DIGESTS
+	bool "Add -DUSE_CRYPTODEV_DIGESTS"
+	default n
+	depends on OPENSSL_HAVE_CRYPTODEV
+	help
+	  Once -DHAVE_CRYPTODEV is enabled you can also enable the use of
+	  cryptodev digests, which is usually slower unless you have large
+	  amounts of data.
diff --git a/rules/openssl.make b/rules/openssl.make
old mode 100644
new mode 100755
index 8fe7663..0f2d519
--- a/rules/openssl.make
+++ b/rules/openssl.make
@@ -85,11 +85,24 @@ else
 OPENSSL_CONF_OPT += no-shared
 endif
 
+ifdef PTXCONF_OPENSSL_HAVE_CRYPTODEV
+OPENSSL_CONF_OPT += -DHAVE_CRYPTODEV -I$(SYSROOT)/usr/include/
+endif
+
+ifdef PTXCONF_OPENSSL_USE_CRYPTODEV_DIGESTS
+OPENSSL_CONF_OPT += -DUSE_CRYPTODEV_DIGESTS
+endif
+
 $(STATEDIR)/openssl.prepare:
 	@$(call targetinfo)
 	cd $(OPENSSL_DIR) && \
 		$(OPENSSL_PATH) $(OPENSSL_CONF_ENV) \
 		./Configure $(OPENSSL_ARCH-y) $(OPENSSL_CONF_OPT)
+
+ifdef PTXCONF_OPENSSL_HAVE_CRYPTODEV
+	mkdir -p $(SYSROOT)/usr/include/crypto;
+	cp $(KERNEL_DIR)/crypto/ocf/cryptodev.h $(SYSROOT)/usr/include/crypto;
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
-- 
1.7.9.5


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] openssl: Add config option to select cryptodev engine
  2012-05-28 12:42 [ptxdist] [PATCH] openssl: Add config option to select cryptodev engine Bart vdr. Meulen
@ 2012-05-30  7:28 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2012-05-30  7:28 UTC (permalink / raw)
  To: ptxdist

On Mon, May 28, 2012 at 02:42:32PM +0200, Bart vdr. Meulen wrote:
> From: Harro Haan <hrhaan@gmail.com>
> 
> Use PTXCONF_OPENSSL_HAVE_CRYPTODEV to enable the BSD cryptodev engine even if
> you are not using BSD. Useful if you are running ocf-linux or something similar.
> Once enabled you can also enable the use of cryptodev digests, which is usually
> slower unless you have large amounts of data.
> Use PTXCONF_OPENSSL_USE_CRYPTODEV_DIGESTS to force it.
> 
> Signed-off-by: Harro Haan <hrhaan@gmail.com>
> ---
>  rules/openssl.in   |   19 +++++++++++++++++++
>  rules/openssl.make |   13 +++++++++++++
>  2 files changed, 32 insertions(+)
>  mode change 100644 => 100755 rules/openssl.in
>  mode change 100644 => 100755 rules/openssl.make
> 
> diff --git a/rules/openssl.in b/rules/openssl.in
> old mode 100644
> new mode 100755
> index a17c05d..00aba1d
> --- a/rules/openssl.in
> +++ b/rules/openssl.in
> @@ -5,6 +5,7 @@ menuconfig OPENSSL
>  	select LIBC_DL
>  	select GCCLIBS_GCC_S
>  	prompt "openssl                       "
> +	select KERNEL_HEADER if OPENSSL_HAVE_CRYPTODEV
>  	help
>  	  Secure Socket Layer (SSL) binary and related cryptographic tools
>  
> @@ -34,3 +35,21 @@ config OPENSSL_SHARED
>  	depends on OPENSSL
>  	help
>  	  Whether to build OpenSSL with shared libraries.
> +
> +config OPENSSL_HAVE_CRYPTODEV
> +	bool "Add -DHAVE_CRYPTODEV"
> +	default n
> +	depends on OPENSSL
> +	help
> +	  Use -DHAVE_CRYPTODEV to enable the BSD cryptodev engine even
> +	  if we are not using BSD. Useful if you are running ocf-linux
> +	  or something similar.
> +
> +config OPENSSL_USE_CRYPTODEV_DIGESTS
> +	bool "Add -DUSE_CRYPTODEV_DIGESTS"
> +	default n
> +	depends on OPENSSL_HAVE_CRYPTODEV
> +	help
> +	  Once -DHAVE_CRYPTODEV is enabled you can also enable the use of
> +	  cryptodev digests, which is usually slower unless you have large
> +	  amounts of data.
> diff --git a/rules/openssl.make b/rules/openssl.make
> old mode 100644
> new mode 100755
> index 8fe7663..0f2d519
> --- a/rules/openssl.make
> +++ b/rules/openssl.make
> @@ -85,11 +85,24 @@ else
>  OPENSSL_CONF_OPT += no-shared
>  endif
>  
> +ifdef PTXCONF_OPENSSL_HAVE_CRYPTODEV
> +OPENSSL_CONF_OPT += -DHAVE_CRYPTODEV -I$(SYSROOT)/usr/include/
> +endif
> +
> +ifdef PTXCONF_OPENSSL_USE_CRYPTODEV_DIGESTS
> +OPENSSL_CONF_OPT += -DUSE_CRYPTODEV_DIGESTS
> +endif
> +
>  $(STATEDIR)/openssl.prepare:
>  	@$(call targetinfo)
>  	cd $(OPENSSL_DIR) && \
>  		$(OPENSSL_PATH) $(OPENSSL_CONF_ENV) \
>  		./Configure $(OPENSSL_ARCH-y) $(OPENSSL_CONF_OPT)
> +
> +ifdef PTXCONF_OPENSSL_HAVE_CRYPTODEV
> +	mkdir -p $(SYSROOT)/usr/include/crypto;
> +	cp $(KERNEL_DIR)/crypto/ocf/cryptodev.h $(SYSROOT)/usr/include/crypto;

	install -D -m 644 $(KERNEL_HEADER_DIR)/crypto/ocf/cryptodev.h \
		$(SYSROOT)/usr/include/crypto/cryptodev.h

and no mkdir. I assume cryptodev.h is not installed with headers_install?

Michael

> +endif
>  	@$(call touch)
>  
>  # ----------------------------------------------------------------------------
> -- 
> 1.7.9.5
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-30  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-28 12:42 [ptxdist] [PATCH] openssl: Add config option to select cryptodev engine Bart vdr. Meulen
2012-05-30  7:28 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox