Skip to contentSkip to conversation

svn commit: trunk/buildroot/package/openssl

Buildroot ulf at uclibc.org 6 participants 15 messages Jul 8, 2008

lore
Share & tools
lore
#0 lore raw

Author: ulf
Date: 2008-07-08 03:13:04 -0700 (Tue, 08 Jul 2008) New Revision: 22687

Log:
Revert patch which breaks AVR32 build

Modified:
trunk/buildroot/package/openssl/openssl.mk

Changeset:
Modified: trunk/buildroot/package/openssl/openssl.mk
===================================================================

buildroot/package/openssl/openssl.mk +1 -0
@@ -40,6 +40,7 @@
 endif
 	$(SED) '/CFLAG=/s,/;, $(shell echo '$(TARGET_CFLAGS)' | sed -e 's/\//\\\\\//g')/;,' \
 		$(OPENSSL_DIR)/Configure
+	$(CONFIG_UPDATE) $(OPENSSL_DIR)
 	touch $@
 
 $(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/.unpacked
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"ulf" == ulf <[email protected]> writes:

ulf> Author: ulf
ulf> Date: 2008-07-08 03:13:04 -0700 (Tue, 08 Jul 2008) ulf> New Revision: 22687

ulf> Log:
ulf> Revert patch which breaks AVR32 build

But I don't get it. From a quick grep of openssl-0.9.7m, I don't see anything using config.sub / config.guess?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw
In reply to ulf at uclibc.org
Quoted 17 lines · ulf at uclibc.org

Author: ulf
Date: 2008-07-08 03:13:04 -0700 (Tue, 08 Jul 2008) New Revision: 22687

Log:
Revert patch which breaks AVR32 build

Modified:
trunk/buildroot/package/openssl/openssl.mk

Changeset:
Modified: trunk/buildroot/package/openssl/openssl.mk
===================================================================

buildroot/package/openssl/openssl.mk line 46

Quoted 7 lines
buildroot/package/openssl/openssl.mk +1 -0
@@ -40,6 +40,7 @@
 endif
 	$(SED) '/CFLAG=/s,/;, $(shell echo '$(TARGET_CFLAGS)' | sed -e 's/\//\\\\\//g')/;,' \
 		$(OPENSSL_DIR)/Configure
+	$(CONFIG_UPDATE) $(OPENSSL_DIR)
 	touch $@
 
 $(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/.unpacked

Please, did you test before reverting this?

Hamish

Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
#3 lore raw
Quoted 4 lines · Hamish Moffatt

On Tue, Jul 08, 2008 at 03:13:05AM -0700, ulf at uclibc.org wrote:

Please, did you test before reverting this?

Hamish, Peter,

Ulf is right. You can try building for avr32 and you will see that
configure fails with unknown platform/compiler without this. I tried it more or less at the same time as Ulf commited, while I was porting back some google code improvements. If Ulf hadn't committed before me, I would have.

Kind Regards,
Thiago A. Correa

#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Hi,

Thiago> Ulf is right. You can try building for avr32 and you will Thiago> see that configure fails with unknown platform/compiler Thiago> without this. I tried it more or less at the same time as Ulf Thiago> commited, while I was porting back some google code Thiago> improvements. If Ulf hadn't committed before me, I would Thiago> have.

Strange, what error does it give exactly? I really don't see any reference to config.sub / config.guess in the openssl package / tarball.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw
Quoted 11 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Thiago> Ulf is right. You can try building for avr32 and you will Thiago> see that configure fails with unknown platform/compiler Thiago> without this. I tried it more or less at the same time as Ulf Thiago> commited, while I was porting back some google code Thiago> improvements. If Ulf hadn't committed before me, I would Thiago> have.

Strange, what error does it give exactly? I really don't see any reference to config.sub / config.guess in the openssl package / tarball.

Hmmm after attempting to build without the CONFIG_UPDATE again, it seams that it's really not necessary. I guess I might have confused with another package.
It built to avr32 without it, but I also have some clean up changes laying here, so I will commit both if it's ok. Basically, this:
http://code.google.com/p/buildroot/source/diff?r=638&format=side&path=/trunk/package/openssl/openssl.mk

Regards,
Thiago A. Correa

#6 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Hi,

Quoted 3 lines
Quoted 3 lines

Strange, what error does it give exactly? I really don't see any reference to config.sub / config.guess in the openssl package / tarball.

Thiago> Hmmm after attempting to build without the CONFIG_UPDATE again, it Thiago> seams that it's really not necessary. I guess I might have confused Thiago> with another package.

Ahh ok.

Thiago> It built to avr32 without it, but I also have some clean up changes
Thiago> laying here, so I will commit both if it's ok.
Thiago> Basically, this:
Thiago> http://code.google.com/p/buildroot/source/diff?r=638&format=side&path=/trunk/package/openssl/openssl.mk

I don't get it, how do the files get installed into TARGET_DIR?

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw
Quoted 7 lines · Peter Korsgaard

Thiago> It built to avr32 without it, but I also have some clean up changes
Thiago> laying here, so I will commit both if it's ok.
Thiago> Basically, this:
Thiago> http://code.google.com/p/buildroot/source/diff?r=638&format=side&path=/trunk/package/openssl/openssl.mk

I don't get it, how do the files get installed into TARGET_DIR?

Oh, that's because in the google repository it was made in different commits, but there John changed it to use make install instead. He was looking into the issue of having Midori and other packages connect to https servers. To fix that, besides having a proper openssl install, one needs to install the CA certificates. But none the less make install is better than copying individual files.

$(STAGING_DIR)/usr/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl

        $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR)/usr -C
$(OPENSSL_DIR) install
        $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(TARGET_DIR) -C
$(OPENSSL_DIR) install
        touch -c $@
#8 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Hi,

Quoted 2 lines
Quoted 2 lines

I don't get it, how do the files get installed into TARGET_DIR?

Thiago> Oh, that's because in the google repository it was made in different Thiago> commits, but there John changed it to use make install instead. He was Thiago> looking into the issue of having Midori and other packages connect to Thiago> https servers. To fix that, besides having a proper openssl install, Thiago> one needs to install the CA certificates. But none the less make Thiago> install is better than copying individual files.

Yes, if it doesn't install a bunch of unneeded stuff.

Thiago> $(STAGING_DIR)/usr/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl
Thiago> $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR)/usr -C
Thiago> $(OPENSSL_DIR) install
Thiago> $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(TARGET_DIR) -C
Thiago> $(OPENSSL_DIR) install

Ahh, we normally put those in seperate targets
($TARGET_DIR)/usr/lib/libcrypto... )

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw
Quoted 6 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Hi,

Quoted 2 lines
Quoted 2 lines

I don't get it, how do the files get installed into TARGET_DIR?

Quoted 9 lines

Thiago> Oh, that's because in the google repository it was made in different Thiago> commits, but there John changed it to use make install instead. He was Thiago> looking into the issue of having Midori and other packages connect to Thiago> https servers. To fix that, besides having a proper openssl install, Thiago> one needs to install the CA certificates. But none the less make Thiago> install is better than copying individual files.

Yes, if it doesn't install a bunch of unneeded stuff.

It will install to /usr/bin c_rehash fipsld openssl and headers/libs, which the current make file does in:

$(TARGET_DIR)/usr/lib/libssl.a: $(STAGING_DIR)/usr/lib/libcrypto.a

        mkdir -p $(TARGET_DIR)/usr/include
        cp -a $(STAGING_DIR)/usr/include/openssl $(TARGET_DIR)/usr/include/
        cp -dpf $(STAGING_DIR)/usr/lib/libssl.a $(TARGET_DIR)/usr/lib/
        cp -dpf $(STAGING_DIR)/usr/lib/libcrypto.a $(TARGET_DIR)/usr/lib/
        touch -c $@

But it also creates /lib/ssl/certs folder (empty) and /lib/ssl/openssl.cnf which should be important to programs that verify the peer identity, such as browsers like midori.

If I'm not mistaken, the headers and static libs are usually removed later on when packing the final image, right?

#10 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Hi,

Thiago> It will install to /usr/bin c_rehash fipsld openssl and Thiago> headers/libs, which the current make file does in:

Ok, does it also strip them?

Thiago> If I'm not mistaken, the headers and static libs are usually Thiago> removed later on when packing the final image, right?

Yes, unless the HAVE_DEVFILES stuff is enabled.

Signature · 1 line
Bye, Peter Korsgaard
#11 lore raw

Here's a patch to add SSL certificates to buildroot. It builds them from mozilla's svn, so the certs are not likely to have been tampered with. It's really pretty slick.

diff -Nwrup -x .svn buildroot-orig/package/ca-certificates/ ca-certificates.mk buildroot/package/ca-certificates/ca-certificates.mk
--- buildroot-orig/package/ca-certificates/ca-certificates.mk 1969-12-31
19:00:00.000000000 -0500
+++ buildroot/package/ca-certificates/ca-certificates.mk 2008-07-03
07:33:36.000000000 -0400
@@ -0,0 +1,25 @@
+#############################################################
+#
+# ca-certificates
+#
+#############################################################
+
+package/ca-certificates/ca-bundle.crt:
+ package/ca-certificates/mkcabundle.pl > $@
+
+$(TARGET_DIR)/usr/lib/ssl/cert.pem: package/ca-certificates/ca-bundle.crt

+    mkdir -p $(TARGET_DIR)/usr/lib/ssl/certs/
+    mkdir -p $(TARGET_DIR)/usr/lib/ssl/CA/private
+    cp package/ca-certificates/ca-bundle.crt

$(TARGET_DIR)/usr/lib/ssl/certs
+ ln -s certs/ca-bundle.crt $(TARGET_DIR)/usr/lib/ssl/cert.pem
+
+ca-certificates: $(TARGET_DIR)/usr/lib/ssl/cert.pem
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_CA_CERTIFICATES)),y) +TARGETS+=ca-certificates
+endif
\ No newline at end of file
diff -Nwrup -x .svn buildroot-orig/package/ca-certificates/Config.in buildroot/package/ca-certificates/Config.in
--- buildroot-orig/package/ca-certificates/Config.in 1969-12-31
19:00:00.000000000 -0500
+++ buildroot/package/ca-certificates/Config.in 2008-07-03
07:33:36.000000000 -0400
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_CA_CERTIFICATES

+    bool "ssl certificates"
+    default n
+    help

+ SSL certificates for OpenSSL
diff -Nwrup -x .svn buildroot-orig/package/ca-certificates/mkcabundle.pl buildroot/package/ca-certificates/mkcabundle.pl
--- buildroot-orig/package/ca-certificates/mkcabundle.pl 1969-12-31
19:00:00.000000000 -0500
+++ buildroot/package/ca-certificates/mkcabundle.pl 2008-07-03
07:33:36.000000000 -0400
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w
+#
+# Used to regenerate ca-bundle.crt from the Mozilla certdata.txt. +# Run as ./mkcabundle.pl > ca-bundle.crt
+#
+
+my $cvsroot = ':pserver:anonymous at cvs-mirror.mozilla.org:/cvsroot'; +my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt'; +
+open(IN, "cvs -d $cvsroot co -p $certdata|")
+ || die "could not check out certdata.txt";
+
+my $incert = 0;
+
+print<<EOH;
+# This is a bundle of X.509 certificates of public Certificate +# Authorities. It was generated from the Mozilla root CA list. +#
+# Source: $certdata
+#
+EOH
+
+while (<IN>) {
+ if (/^CKA_VALUE MULTILINE_OCTAL/) {
+ $incert = 1;
+ open(OUT, "|openssl x509 -text -inform DER -fingerprint")
+ || die "could not pipe to openssl x509";
+ } elsif (/^END/ && $incert) {

+        close(OUT);
+        $incert = 0;
+        print "\n\n";

+ } elsif ($incert) {
+ my @bs = split(/\\/);
+ foreach my $b (@bs) {
+ chomp $b;
+ printf(OUT "%c", oct($b)) unless $b eq '';
+ }
+ } elsif (/^CVS_ID.*Revision: ([^ ]*).*/) {
+ print "# Generated from certdata.txt RCS revision $1\n#\n";
+ }
+}
\ No newline at end of file
diff -Nwrup -x .svn buildroot-orig/package/Config.in buildroot/package/Config.in

package/Config.in 2008-07-08 11:26:07.000000000 -0400 renamed from package/Config.in 2008-07-08 11:19:53.000000000 -0400 +1 -0
@@ -150,6 +150,7 @@ source "package/axel/Config.in"
 source "package/boa/Config.in"
 source "package/bind/Config.in"
 source "package/bridge-utils/Config.in"
+source "package/ca-certificates/Config.in"
 source "package/curl/Config.in"
 if !BR2_PACKAGE_BUSYBOX_HIDE_OTHERS
 source "package/dhcp/Config.in"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/buildroot/attachments/20080708/e821259b/attachment.htm

#12 lore raw

I've been able to verify that the openssl/libcurl subsystem works with lynx. I haven't been able to get it to work with Midori/WebKit. I'm not even sure that WebKit fully supports SSL through libcurl yet. If you export WEBKIT_IGNORE_SSL_ERRORS=true before you start Midori, secure sites will load, but it is obviously not necessarily truly a secure connection.

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/buildroot/attachments/20080708/e71d8178/attachment.htm

#13 lore raw
In reply to Thiago A. Corrêa

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thiago A. Corr?a skrev:

Quoted 6 lines · Peter Korsgaard
Quoted 5 lines

Thiago> It built to avr32 without it, but I also have some clean up changes
Thiago> laying here, so I will commit both if it's ok.
Thiago> Basically, this:
Thiago> http://code.google.com/p/buildroot/source/diff?r=638&format=side&path=/trunk/package/openssl/openssl.mk

Quoted 8 lines
Quoted 2 lines

I don't get it, how do the files get installed into TARGET_DIR?

Oh, that's because in the google repository it was made in different commits, but there John changed it to use make install instead. He was looking into the issue of having Midori and other packages connect to https servers. To fix that, besides having a proper openssl install, one needs to install the CA certificates. But none the less make install is better than copying individual files.

I think this is slightly flawed.
If the make is aborted for some reason after the make install and before the stuff is stripped, then the strip wont happen. Not a big problem, but should be easy to fix.

I think you want the install into the target like this:

$(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7: \ 	
		$(STAGING_DIR)/usr/lib/libcrypto.a
	$(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(TARGET_DIR) \
		-C $(OPENSSL_DIR) install
	<strip's>

BR
Ulf Samuelsson

Quoted 11 lines

$(STAGING_DIR)/usr/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl

        $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR)/usr -C
$(OPENSSL_DIR) install
        $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(TARGET_DIR) -C
$(OPENSSL_DIR) install
        touch -c $@

_______________________________________________
buildroot mailing list
buildroot at uclibc.org
http://busybox.net/mailman/listinfo/buildroot

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIc5Y9AyRRH5cXxqwRAhG9AJ47A3UnuCsJW6A27+1zK887sCeZRgCeJ1E2 xSSoWvQTNX9t42W4neOI5v0=
=r2Em
-----END PGP SIGNATURE-----

#14 lore raw
In reply to Thiago A. Corrêa

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thiago A. Corr?a skrev:

Quoted 9 lines · Peter Korsgaard
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thiago" == Thiago A Corr?a <[email protected]> writes:

Thiago> Ulf is right. You can try building for avr32 and you will Thiago> see that configure fails with unknown platform/compiler Thiago> without this. I tried it more or less at the same time as Ulf Thiago> commited, while I was porting back some google code Thiago> improvements. If Ulf hadn't committed before me, I would Thiago> have.

Quoted 7 lines
Quoted 3 lines

Strange, what error does it give exactly? I really don't see any reference to config.sub / config.guess in the openssl package / tarball.

Hmmm after attempting to build without the CONFIG_UPDATE again, it seams that it's really not necessary. I guess I might have confused with another package.

It was broken for the AVR32 before I started modifying the stuff. openssl-0.9.7m.patch.avr32 is needed.

Not sure about the exact sequence of changes
since it was a few days ago, but now when I had
time to run a check I can also confirm that CONFIG_UPDATE is not needed.

BR
Ulf Samuelsson

Quoted 11 lines

It built to avr32 without it, but I also have some clean up changes laying here, so I will commit both if it's ok. Basically, this:
http://code.google.com/p/buildroot/source/diff?r=638&format=side&path=/trunk/package/openssl/openssl.mk

Regards,
Thiago A. Correa
_______________________________________________
buildroot mailing list
buildroot at uclibc.org
http://busybox.net/mailman/listinfo/buildroot

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIc5pWAyRRH5cXxqwRAgzUAJ0b93y/QHy0l8XpVFbDzZvPccl8CgCgvnOb j+oxhg4STB61FvA7AIGpeZE=
=jB76
-----END PGP SIGNATURE-----