Skip to contentSkip to conversation

Compiling polarssl lib in uboot

U-Boot Peter Czypek 2 participants 4 messages Oct 18, 2012 – Oct 19, 2012

lore
Share & tools
lore
#0 lore raw

Hello,

i want to use the crypto functions from polarssl in uboot. My crypto lib choice is polarssl [http://polarssl.org/] and my target is an omap4 panda board.

My first attempt was to extract the needed source files and headers from polarssl and copy them to uboot directories and modify the uboot makefiles to compile them together with uboot. This works but is not optimal. I also have had to modify some includes and replace them by compiler.h for example.

So now i want to compile polarssl as a whole lib and link it in uboot. But i don't know the "right" way to do this.

First problem:
I can't cross compile the polarssl lib with the same toolchain i use for uboot.
For compiling uboot i use an arm-linux-androideabi toolchain. For polarssl compilation i can't use this lib because it contains no std headers like string.h for example.
So i thought that i can compile this lib inside the uboot directory. As they are already some projects in the lib directory i hope to be successfull with this approach.

But i don't know how. My understanding of the uboot makefiles is not 100%.

My imagination tells me it has to be something like:
- copy polarssl into uboot/lib
- modify some uboot makefiles (tell uboot to compile the lib)
- modify some polarssl makefiles (tell polarssl which compiler is used
and where std headers of uboot are)
- modify uboot sources to use polarssl headers for crypto (#include
"polarssl/sha3.h")
- compile like always
- finished - everything works fine

Does someone have any guidelines for me how to achieve this? Which uboot makefiles do i have to edit?
Is my plan even feasible?

Greetings and thx in advance
Peter

#1 lore raw
Quoted 5 lines · Peter Czypek

Hello,

i want to use the crypto functions from polarssl in uboot. My crypto lib choice is polarssl [http://polarssl.org/] and my target is an omap4 panda board.

What are you trying to accomplish exactly?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121018/35bf7c8a/attachment.pgp>
#2 lore raw

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

I want to verify signed data in a "nice" and "proper" way. Which would be using a lib, in my opinion.

Am 18.10.2012 19:45, schrieb Tom Rini:

Quoted 10 lines · Peter Czypek
Quoted 6 lines

Hello,

i want to use the crypto functions from polarssl in uboot. My crypto lib choice is polarssl [http://polarssl.org/] and my target is an omap4 panda board.

What are you trying to accomplish exactly?

- --
Dipl.-Ing. Peter Czypek
Security Engineer
ESCRYPT GmbH - Embedded Security

Email:       peter.czypek at escrypt.com
PGP key:   www.escrypt.com/keyserver/peter.czypek
PGP Fingerprint: ED4B 1129 31F0 A93A 2307  9C90 5D14 02C6 1D41 DE63
Phone:     +49 234 43870-222
Mobil:      +49 151 402390-22
Address:   Lise-Meitner-Allee 4, 44801 Bochum, Germany
Internet:    www.escrypt.com

Managing directors: Dr.-Ing. Jan Pelzl, Dr.-Ing. Andr? Weimerskirch, Dr.-Ing. Thomas Wollinger
Registered office and court of registry: Bochum, Germany, HRB 7877 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQgQQiAAoJEF0UAsYdQd5jL1wH/RFzXfN+uGmMvw5QzcefMgmh NvtQpLMNDdM5Es3G8ch+895IBUVzdWBNPJ2avGzbK/K7W9dLlQvupQc4b2B9+ppY qtTKrypTdyuFDFT0uht6kb8x9xpw3hsv94WRD65zeB2evSkguloVH8MSrlqr8ZD/ qxjx/sfdfYXrRFHbIuAIQz3cp+af2anfaqxbBF4mpmkvfGTQURFpcYGFzZR5R/Lf BXeczYe2NSLz4RchvFBIGl368FZsvhLs9zZuABQyce6DzL6JnhZQ2zmXQu4NUGTE M+ATvRsYStmtXU/YQEjMAcrrZVaQqesQvliXcgzXjFx4EDTnK0xxvbDxXiI78Jc= =VI8y
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 5 lines · Peter Czypek

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

I want to verify signed data in a "nice" and "proper" way. Which would be using a lib, in my opinion.

So you want to add a command that uses it, OK. I would see lib/zlib or lib/lzma for examples of how other libraries have been imported.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121019/4007a666/attachment.pgp>