Discussion:
[edk2] Merging OpenSSL support
David Woodhouse
2015-07-23 19:54:24 UTC
Permalink
(The 01.org list seems to be rejecting all my posts, so I'll repost to
this not-dead-yet list.)

WIP at git://git.infradead.org/users/dwmw2/openssl.git and
git://git.infradead.org/users/dwmw2/edk.git

Clone the former into the CryptoPkg/Library/OpensslLib/openssl/
directory of the EDK2 tree.

I'm starting to push the OpenSSL patches upstream where it makes sense.

I could do with some help fixing up EDK2 build side. Starting with the
include paths. Apparently I am not permitted to add an [includes]
section to OpensslLib.inf? So we can't just tell it to include files
from the openssl/include and openssl/crypto/include/ directories?

So far I've just symlinked *all* of openssl/include/internal.*.h and
openssl/crypto/include/*.h into a CryptoPkg/Include/internal/ directory
but that really wants fixing.

You'll want to run './Configure UWIN' in the OpenSSL tree to generate
opensslconf.h.

I'm going to see how we can automate that and keep the file list up to
date automatically too.

Most importantly though, now that I have something that at least
builds, what should I be doing to test it?
--
David Woodhouse Open Source Technology Centre
***@intel.com Intel Corporation
Andrew Fish
2015-07-23 20:37:25 UTC
Permalink
Post by David Woodhouse
(The 01.org list seems to be rejecting all my posts, so I'll repost to
this not-dead-yet list.)
WIP at git://git.infradead.org/users/dwmw2/openssl.git and
git://git.infradead.org/users/dwmw2/edk.git
Clone the former into the CryptoPkg/Library/OpensslLib/openssl/
directory of the EDK2 tree.
I'm starting to push the OpenSSL patches upstream where it makes sense.
I could do with some help fixing up EDK2 build side. Starting with the
include paths. Apparently I am not permitted to add an [includes]
section to OpensslLib.inf?
David,

What I did for the acpica dump tool is I made a DEC file for the blob of code from another project and I added the [Includes] section to the DEC. Then the INF just depends on DEC for the package that represents the 3rd party. You have to update the DEC if the non edk2 project changes its include path, but otherwise your good to go.

Thanks,

Andrew Fish
Post by David Woodhouse
So we can't just tell it to include files
from the openssl/include and openssl/crypto/include/ directories?
So far I've just symlinked *all* of openssl/include/internal.*.h and
openssl/crypto/include/*.h into a CryptoPkg/Include/internal/ directory
but that really wants fixing.
You'll want to run './Configure UWIN' in the OpenSSL tree to generate
opensslconf.h.
I'm going to see how we can automate that and keep the file list up to
date automatically too.
Most importantly though, now that I have something that at least
builds, what should I be doing to test it?
--
David Woodhouse Open Source Technology Centre
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
David Woodhouse
2015-07-23 20:38:39 UTC
Permalink
Post by Andrew Fish
David,
What I did for the acpica dump tool is I made a DEC file for the blob
of code from another project and I added the [Includes] section to
the DEC. Then the INF just depends on DEC for the package that
represents the 3rd party. You have to update the DEC if the non edk2
project changes its include path, but otherwise your good to go.
That sounds like an excellent plan. Thanks.
--
dwmw2
David Woodhouse
2015-07-23 20:49:17 UTC
Permalink
Post by Andrew Fish
David,
What I did for the acpica dump tool is I made a DEC file for the blob
of code from another project and I added the [Includes] section to
the DEC. Then the INF just depends on DEC for the package that
represents the 3rd party. You have to update the DEC if the non edk2
project changes its include path, but otherwise your good to go.
Oh, I don't even need a new DEC file. It's sufficient just to add to
the [Includes] section of CryptoPkg/CryptoPkg.dec:

--- a/CryptoPkg/CryptoPkg.dec
+++ b/CryptoPkg/CryptoPkg.dec
@@ -24,6 +24,8 @@

[Includes]
Include
+ Library/OpensslLib/openssl/include
+ Library/OpensslLib/openssl/crypto/include

[LibraryClasses]
## @libraryclass Provides basic library functions for cryptographic primitives.

I've pushed that out to my tree now, so there's no need to run Install.sh at all.
Thanks again.
--
dwmw2
Long, Qin
2015-07-24 00:52:32 UTC
Permalink
David,

Really thanks for your helps on this.

For the include path issue, yes, "....../openssl/crypto/include" may include all symlinked header file. But it may depend on the unpack utility (esp. In Windows). Some unpack tool will ignore those symlink files or replace the content directly in Windows. That's why we need one install script before to make sure all header files were in place.


Best Regards & Thanks,
LONG, Qin

-----Original Message-----
From: David Woodhouse [mailto:***@infradead.org]
Sent: Friday, July 24, 2015 4:49 AM
To: Andrew Fish
Cc: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] Merging OpenSSL support
Post by Andrew Fish
David,
What I did for the acpica dump tool is I made a DEC file for the blob
of code from another project and I added the [Includes] section to the
DEC. Then the INF just depends on DEC for the package that represents
the 3rd party. You have to update the DEC if the non edk2 project
changes its include path, but otherwise your good to go.
Oh, I don't even need a new DEC file. It's sufficient just to add to the [Includes] section of CryptoPkg/CryptoPkg.dec:

--- a/CryptoPkg/CryptoPkg.dec
+++ b/CryptoPkg/CryptoPkg.dec
@@ -24,6 +24,8 @@

[Includes]
Include
+ Library/OpensslLib/openssl/include
+ Library/OpensslLib/openssl/crypto/include

[LibraryClasses]
## @libraryclass Provides basic library functions for cryptographic primitives.

I've pushed that out to my tree now, so there's no need to run Install.sh at all.
Thanks again.

--
dwmw2
------------------------------------------------------------------------------
Long, Qin
2015-07-24 08:06:39 UTC
Permalink
That's great. If so, we can remove the install script then.

Best Regards & Thanks,
LONG, Qin

-----Original Message-----
From: David Woodhouse [mailto:***@infradead.org]
Sent: Friday, July 24, 2015 3:49 PM
To: Long, Qin; Andrew Fish
Cc: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] Merging OpenSSL support
Post by Andrew Fish
David,
Really thanks for your helps on this.
For the include path issue, yes, "....../openssl/crypto/include" may
include all symlinked header file. But it may depend on the unpack
utility (esp. In Windows). Some unpack tool will ignore those symlink
files or replace the content directly in Windows. That's why we need
one install script before to make sure all header files were in
place.
In OpenSSL HEAD they've ditched all the symlink nonsense and the files
just live in the include/ directories.
--
dwmw2
David Woodhouse
2015-07-24 08:08:47 UTC
Permalink
Post by Long, Qin
That's great. If so, we can remove the install script then.
Well, after a 1.1 release and when we update to it. We'll be on 1.0.2
releases for a little while yet. But for the purpose of getting our
changes merged into OpenSSL, of course I had to target HEAD.
--
dwmw2
Blibbet
2015-07-24 00:09:12 UTC
Permalink
Post by David Woodhouse
I'm starting to push the OpenSSL patches upstream where it makes sense.
THANK YOU!

------------------------------------------------------------------------------
Loading...