Skip to contentSkip to conversation

gnupg: Add options for SHA-256 and SHA-512 hashes

PATCH Superseded Jack Breese 3 participants 5 messages Apr 6, 2017 – Apr 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gnupg: Add options for SHA-256 and SHA-512 hashes

---
 package/gnupg/Config.in | 10 ++++++++++
 package/gnupg/gnupg.mk  | 12 ++++++++++++
 2 files changed, 22 insertions(+)
package/gnupg/Config.in +10 -0
index 30f215fed..87b3afe76 100644
@@ -26,6 +26,16 @@ config BR2_PACKAGE_GNUPG_RSA
 	help
 	  Support for RSA public key algorithm
 
+config BR2_PACKAGE_GNUPG_SHA256
+	bool "SHA256 support"
+	help
+	  Support for SHA256 hash algorithm
+
+config BR2_PACKAGE_GNUPG_SHA512
+	bool "SHA512 support"
+	help
+	  Support for SHA512 hash algorithm
+
 config BR2_PACKAGE_GNUPG_GPGV
 	bool "gpgv"
 	help
package/gnupg/gnupg.mk +12 -0
index caa9d2c46..be3e00282 100644
@@ -48,6 +48,18 @@ else
 GNUPG_CONF_OPTS += --disable-rsa
 endif
 
+ifeq ($(BR2_PACKAGE_GNUPG_SHA256),y)
+GNUPG_CONF_OPTS += --enable-sha256
+else
+GNUPG_CONF_OPTS += --disable-sha256
+endif
+
+ifeq ($(BR2_PACKAGE_GNUPG_SHA512),y)
+GNUPG_CONF_OPTS += --enable-sha512
+else
+GNUPG_CONF_OPTS += --disable-sha512
+endif
+
 ifneq ($(BR2_PACKAGE_GNUPG_GPGV),y)
 define GNUPG_REMOVE_GPGV
 	rm -f $(TARGET_DIR)/usr/bin/gpgv
Signature · 1 line
2.11.0 (Apple Git-81)
#1 lore raw

PATCH 1/1 gnupg: Add options for SHA-256 and SHA-512 hashes

Hi Jack,

Quoted 13 lines · Jack Breese
---
 package/gnupg/Config.in | 10 ++++++++++
 package/gnupg/gnupg.mk  | 12 ++++++++++++
 2 files changed, 22 insertions(+)
package/gnupg/Config.in +0 -0
index 30f215fed..87b3afe76 100644
@@ -26,6 +26,16 @@ config BR2_PACKAGE_GNUPG_RSA
 	help
 	  Support for RSA public key algorithm

package/gnupg/Config.in config BR2_PACKAGE_GNUPG_RSA · line 37

Quoted 10 lines
package/gnupg/Config.in +9 -0
 
+config BR2_PACKAGE_GNUPG_SHA256
+	bool "SHA256 support"
+	help
+	  Support for SHA256 hash algorithm
+
+config BR2_PACKAGE_GNUPG_SHA512
+	bool "SHA512 support"
+	help
+	  Support for SHA512 hash algorithm

What is the size impact of these options? In case the size increase is relatively small just enable them unconditionally. I'd say that, given the security implications, we should enable SHA2 even if the size impact is big.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 gnupg: Add options for SHA-256 and SHA-512 hashes

Quoted 8 lines

What is the size impact of these options? In case the size increase is relatively small just enable them unconditionally. I'd say that, given the security implications, we should enable SHA2 even if the size impact is big.

Size impact is ~6k to the binary to enable both options. (armv7l). I'll

submit v2 with both enabled.

Binary size without SHA256 + SHA512:
-rwxr-xr-x 1 root root 550K Apr 6 10:03 gpg

Binary size with both:
-rwxr-xr-x 1 root root 555.9K Mar 31 22:50 gpg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170406/8ba83f8b/attachment.html>

#3 lore raw

PATCH v2 1/1 gnupg: Add options for SHA-256 and SHA-512 hashes

In reply to Jack Breese

---
Changes v1 -> v2:
- Enable SHA-256 and SHA-512 unconditionally because size difference is small. (~6k on armv7l) (Suggested by Baruch)

Binary size without SHA256 + SHA512:
-rwxr-xr-x 1 root root 550K Apr 6 10:03 gpg

Binary size with both:
-rwxr-xr-x 1 root root 555.9K Mar 31 22:50 gpg

---
 package/gnupg/gnupg.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
package/gnupg/gnupg.mk +6 -1
index caa9d2c46..b3578b87d 100644
@@ -11,7 +11,12 @@ GNUPG_LICENSE = GPL-3.0+
 GNUPG_LICENSE_FILES = COPYING
 GNUPG_DEPENDENCIES = zlib ncurses $(if $(BR2_PACKAGE_LIBICONV),libiconv)
 GNUPG_CONF_ENV = ac_cv_sys_symbol_underscore=no
-GNUPG_CONF_OPTS = --disable-rpath --enable-minimal --disable-regex
+GNUPG_CONF_OPTS = \
+	--disable-rpath \
+	--enable-minimal \
+	--disable-regex \
+	--enable-sha256 \
+	--enable-sha512
 
 # gnupg doesn't support assembly for coldfire
 ifeq ($(BR2_m68k_cf),y)
Signature · 1 line
2.11.0 (Apple Git-81)
#4 lore raw

PATCH v2 1/1 gnupg: Add options for SHA-256 and SHA-512 hashes

Hello,

Quoted 6 lines · Jack Breese

---
Changes v1 -> v2:
- Enable SHA-256 and SHA-512 unconditionally because size difference is small. (~6k on armv7l) (Suggested by Baruch)

I've applied, but after fixing the commit title: you're no longer adding options for SHA256 and SHA512, but enabling those unconditionally.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com