Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl
@ 2019-09-06 10:18 Alexander Mukhin
  2019-09-06 11:35 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Mukhin @ 2019-09-06 10:18 UTC (permalink / raw)
  To: buildroot

If building with uclibc, fall back to using its cryptographic routines
instead of openssl. This removes unnecessary dependence.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/pppd/Config.in |  2 +-
 package/pppd/pppd.mk   | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/package/pppd/Config.in b/package/pppd/Config.in
index bf05689f53..7db5674bf1 100644
--- a/package/pppd/Config.in
+++ b/package/pppd/Config.in
@@ -3,7 +3,7 @@ config BR2_PACKAGE_PPPD
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL # Use __P() macro all over the tree
 	depends on BR2_USE_MMU
-	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_OPENSSL if BR2_TOOLCHAIN_USES_GLIBC
 	help
 	  An implementation of the Point-to-point protocol.
 
diff --git a/package/pppd/pppd.mk b/package/pppd/pppd.mk
index 4dffc17941..be6c443eec 100644
--- a/package/pppd/pppd.mk
+++ b/package/pppd/pppd.mk
@@ -12,10 +12,14 @@ PPPD_LICENSE_FILES = \
 	pppd/tdb.c pppd/plugins/pppoatm/COPYING \
 	pppdump/bsd-comp.c pppd/ccp.c pppd/plugins/passprompt.c
 
+PPPD_MAKE_OPTS = HAVE_INET6=y
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
 PPPD_DEPENDENCIES = openssl
-PPPD_MAKE_OPTS = \
-	HAVE_INET6=y \
-	OPENSSL_INCLUDE_DIR=$(STAGING_DIR)/usr/include/openssl
+PPPD_MAKE_OPTS += OPENSSL_INCLUDE_DIR=$(STAGING_DIR)/usr/include/openssl
+else
+PPPD_MAKE_OPTS += USE_CRYPT=y
+endif
+
 PPPD_INSTALL_STAGING = YES
 PPPD_TARGET_BINS = chat pppd pppdump pppstats
 PPPD_RADIUS_CONF = \
-- 
2.20.1

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

* [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl
  2019-09-06 10:18 [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl Alexander Mukhin
@ 2019-09-06 11:35 ` Thomas Petazzoni
  2019-09-06 11:49   ` Baruch Siach
  2019-09-06 16:31   ` Alexander Mukhin
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2019-09-06 11:35 UTC (permalink / raw)
  To: buildroot

Hello Alexander,

On Fri,  6 Sep 2019 13:18:49 +0300
Alexander Mukhin <alexander.i.mukhin@gmail.com> wrote:

> If building with uclibc, fall back to using its cryptographic routines
> instead of openssl. This removes unnecessary dependence.
> 
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>

I am surprised: which functions are provided by uClibc that glibc
doesn't provide ?

Also, what about the musl C library that we support ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl
  2019-09-06 11:35 ` Thomas Petazzoni
@ 2019-09-06 11:49   ` Baruch Siach
  2019-09-06 16:31   ` Alexander Mukhin
  1 sibling, 0 replies; 7+ messages in thread
From: Baruch Siach @ 2019-09-06 11:49 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Fri, Sep 06 2019, Thomas Petazzoni wrote:
> On Fri,  6 Sep 2019 13:18:49 +0300
> Alexander Mukhin <alexander.i.mukhin@gmail.com> wrote:
>
>> If building with uclibc, fall back to using its cryptographic routines
>> instead of openssl. This removes unnecessary dependence.
>> 
>> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
>
> I am surprised: which functions are provided by uClibc that glibc
> doesn't provide ?
>
> Also, what about the musl C library that we support ?

pppd has:

	depends on !BR2_TOOLCHAIN_USES_MUSL # Use __P() macro all over the tree

baruch

-- 
     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 -

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

* [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl
  2019-09-06 11:35 ` Thomas Petazzoni
  2019-09-06 11:49   ` Baruch Siach
@ 2019-09-06 16:31   ` Alexander Mukhin
  2019-09-07 12:32     ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Alexander Mukhin @ 2019-09-06 16:31 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

On Fri, Sep 06, 2019 at 01:35:41PM +0200, Thomas Petazzoni wrote:
> I am surprised: which functions are provided by uClibc that glibc
> doesn't provide ?

According to Fabrice Fontaine's commit 541021, glibc since 2.28 dropped
support for DES encryption functions encrypt(), setkey(), etc. But
uclibc still provides them.

-- 
Alexander.

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

* [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl
  2019-09-06 16:31   ` Alexander Mukhin
@ 2019-09-07 12:32     ` Thomas Petazzoni
  2019-09-07 18:35       ` [Buildroot] [PATCH] package/pppd: " Alexander Mukhin
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2019-09-07 12:32 UTC (permalink / raw)
  To: buildroot

Hello Alexander,

On Fri, 6 Sep 2019 19:31:07 +0300
Alexander Mukhin <alexander.i.mukhin@gmail.com> wrote:

> On Fri, Sep 06, 2019 at 01:35:41PM +0200, Thomas Petazzoni wrote:
> > I am surprised: which functions are provided by uClibc that glibc
> > doesn't provide ?  
> 
> According to Fabrice Fontaine's commit 541021, glibc since 2.28 dropped
> support for DES encryption functions encrypt(), setkey(), etc. But
> uclibc still provides them.

OK, thanks for the additional details. Could you send an updated
version which explains this in the commit log ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH] package/pppd: use uclibc libcrypt instead of openssl
  2019-09-07 12:32     ` Thomas Petazzoni
@ 2019-09-07 18:35       ` Alexander Mukhin
  2019-09-07 19:48         ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Mukhin @ 2019-09-07 18:35 UTC (permalink / raw)
  To: buildroot

glibc since 2.28 dropped DES encryption routines setkey() and encrypt(),
but uclibc still provides them. So, if building with uclibc, we can
avoid using huge openssl library.

Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>
---
 package/pppd/Config.in |  2 +-
 package/pppd/pppd.mk   | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/package/pppd/Config.in b/package/pppd/Config.in
index bf05689f53..7db5674bf1 100644
--- a/package/pppd/Config.in
+++ b/package/pppd/Config.in
@@ -3,7 +3,7 @@ config BR2_PACKAGE_PPPD
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL # Use __P() macro all over the tree
 	depends on BR2_USE_MMU
-	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_OPENSSL if BR2_TOOLCHAIN_USES_GLIBC
 	help
 	  An implementation of the Point-to-point protocol.
 
diff --git a/package/pppd/pppd.mk b/package/pppd/pppd.mk
index 4dffc17941..be6c443eec 100644
--- a/package/pppd/pppd.mk
+++ b/package/pppd/pppd.mk
@@ -12,10 +12,14 @@ PPPD_LICENSE_FILES = \
 	pppd/tdb.c pppd/plugins/pppoatm/COPYING \
 	pppdump/bsd-comp.c pppd/ccp.c pppd/plugins/passprompt.c
 
+PPPD_MAKE_OPTS = HAVE_INET6=y
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
 PPPD_DEPENDENCIES = openssl
-PPPD_MAKE_OPTS = \
-	HAVE_INET6=y \
-	OPENSSL_INCLUDE_DIR=$(STAGING_DIR)/usr/include/openssl
+PPPD_MAKE_OPTS += OPENSSL_INCLUDE_DIR=$(STAGING_DIR)/usr/include/openssl
+else
+PPPD_MAKE_OPTS += USE_CRYPT=y
+endif
+
 PPPD_INSTALL_STAGING = YES
 PPPD_TARGET_BINS = chat pppd pppdump pppstats
 PPPD_RADIUS_CONF = \
-- 
2.20.1

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

* [Buildroot] [PATCH] package/pppd: use uclibc libcrypt instead of openssl
  2019-09-07 18:35       ` [Buildroot] [PATCH] package/pppd: " Alexander Mukhin
@ 2019-09-07 19:48         ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2019-09-07 19:48 UTC (permalink / raw)
  To: buildroot

On Sat,  7 Sep 2019 21:35:17 +0300
Alexander Mukhin <alexander.i.mukhin@gmail.com> wrote:

> glibc since 2.28 dropped DES encryption routines setkey() and encrypt(),
> but uclibc still provides them. So, if building with uclibc, we can
> avoid using huge openssl library.
> 
> Signed-off-by: Alexander Mukhin <alexander.i.mukhin@gmail.com>

I've applied, after doing one small change, see below.

> +PPPD_MAKE_OPTS = HAVE_INET6=y
> +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
>  PPPD_DEPENDENCIES = openssl

I changed this to PPPD_DEPENDENCIES += instead of PPPD_DEPENDENCIES =.
Indeed, we're now in a conditional block, and we want to avoid
overwriting any PPPD_DEPENDENCIES assignment  that could have been done
before that. There is none in the current pppd.mk, but one could be
added in the future, so we really like to use += to add conditional
dependencies.

Thanks for your contribution!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2019-09-07 19:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-06 10:18 [Buildroot] [PATCH] pppd: use uclibc libcrypt instead of openssl Alexander Mukhin
2019-09-06 11:35 ` Thomas Petazzoni
2019-09-06 11:49   ` Baruch Siach
2019-09-06 16:31   ` Alexander Mukhin
2019-09-07 12:32     ` Thomas Petazzoni
2019-09-07 18:35       ` [Buildroot] [PATCH] package/pppd: " Alexander Mukhin
2019-09-07 19:48         ` Thomas Petazzoni

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