From 9a68f2f96fa033dc6ac2072c7e4ba0d521c17446 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 10 May 2016 07:24:36 +0200 Subject: [PATCH] [DEV] ompile open SSL but not te application --- buildLog.txt | 4 ++ lutin_crypto.py | 53 ++++++++++++----- lutin_openssl-apps.py | 132 ++++++++++++++++++++++++++++++++++++++++++ lutin_openssl.py | 106 +++++++++++++++++++++++++++++++++ 4 files changed, 280 insertions(+), 15 deletions(-) create mode 100644 lutin_openssl-apps.py create mode 100644 lutin_openssl.py diff --git a/buildLog.txt b/buildLog.txt index 78ae942..d845a05 100644 --- a/buildLog.txt +++ b/buildLog.txt @@ -1043,6 +1043,10 @@ make[2]: Leaving directory '/home/heero/dev/perso/framework/openssl-lutin/openss make[1]: Leaving directory '/home/heero/dev/perso/framework/openssl-lutin/openssl/engines' + + + + making all in ssl... make[1]: Entering directory '/home/heero/dev/perso/framework/openssl-lutin/openssl/ssl' LINE(---)= diff --git a/lutin_crypto.py b/lutin_crypto.py index ce79279..62db52a 100644 --- a/lutin_crypto.py +++ b/lutin_crypto.py @@ -73,6 +73,7 @@ def create(target, module_name): 'openssl/crypto/o_fips.c', 'openssl/crypto/o_init.c', 'openssl/crypto/fips_ers.c', + 'openssl/crypto/mem_clr.c', ]) #/usr/bin/perl openssl/crypto/x86_64cpuid.pl elf > x86_64cpuid.s my_module.add_src_file([ @@ -752,7 +753,39 @@ def create(target, module_name): 'openssl/crypto/cmac/cm_ameth.c', 'openssl/crypto/cmac/cm_pmeth.c', ]) - + #line(---)= gcc -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c -o + my_module.add_src_file([ + 'openssl/engines/e_4758cca.c', + 'openssl/engines/e_aep.c', + 'openssl/engines/e_atalla.c', + 'openssl/engines/e_cswift.c', + 'openssl/engines/e_gmp.c', + 'openssl/engines/e_chil.c', + 'openssl/engines/e_nuron.c', + 'openssl/engines/e_sureware.c', + 'openssl/engines/e_ubsec.c', + 'openssl/engines/e_padlock.c', + 'openssl/engines/e_capi.c', + ]) + #line(---) = gcc -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c -o + my_module.add_src_file([ + 'openssl/engines/ccgost/e_gost_err.c', + 'openssl/engines/ccgost/gost2001_keyx.c', + 'openssl/engines/ccgost/gost2001.c', + 'openssl/engines/ccgost/gost89.c', + 'openssl/engines/ccgost/gost94_keyx.c', + 'openssl/engines/ccgost/gost_ameth.c', + 'openssl/engines/ccgost/gost_asn1.c', + 'openssl/engines/ccgost/gost_crypt.c', + 'openssl/engines/ccgost/gost_ctl.c', + 'openssl/engines/ccgost/gost_eng.c', + 'openssl/engines/ccgost/gosthash.c', + 'openssl/engines/ccgost/gost_keywrap.c', + 'openssl/engines/ccgost/gost_md.c', + 'openssl/engines/ccgost/gost_params.c', + 'openssl/engines/ccgost/gost_pmeth.c', + 'openssl/engines/ccgost/gost_sign.c', + ]) my_module.compile_flags('c', [ '-DOPENSSL_THREADS', '-D_REENTRANT', @@ -762,10 +795,12 @@ def create(target, module_name): '-m64', '-DL_ENDIAN', ]) + my_module.compile_flags('c', [ + '-DOPENSSL_NO_ASM', + ]) my_module.compile_version("c", 1989, gnu=True) my_module.add_module_depend('z') my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl")) - my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl", "include")) my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl", "crypto")) my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl", "crypto", "modes")) my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl", "crypto", "asn1")) @@ -851,17 +886,5 @@ def create(target, module_name): 'generate/buildinf.h', ], destination_path="openssl") - """ - my_module.add_header_file([ - 'openssl/ssl/dtls1.h', - 'openssl/ssl/kssl.h', - 'openssl/ssl/srtp.h', - 'openssl/ssl/ssl.h', - 'openssl/ssl/ssl2.h', - 'openssl/ssl/ssl23.h', - 'openssl/ssl/ssl3.h', - 'openssl/ssl/tls1.h', - ], - destination_path="openssl") - """ + return my_module diff --git a/lutin_openssl-apps.py b/lutin_openssl-apps.py new file mode 100644 index 0000000..685efb7 --- /dev/null +++ b/lutin_openssl-apps.py @@ -0,0 +1,132 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools +import os + + +def get_type(): + return "BINARY" + +def get_desc(): + return "open SSL crypto library" + +def get_licence(): + return "BSD like + notif" + +def get_compagny_type(): + return "org" + +def get_compagny_name(): + return "openssl" + +def get_maintainer(): + return ["XXX XXX"] + +def get_version(): + return [1,0,2] + + + + +def create(target, module_name): + my_module = module.Module(__file__, module_name, get_type()) + """ + my_module.add_prebuild_action( + src="openssl/crypto/x86_64cpuid.pl", + dst= + """ + + #line(---) = gcc -DMONOLITH -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c -o + my_module.add_src_file([ + 'openssl/apps/apps.c', + 'openssl/apps/verify.c', + ]) + my_module.compile_flags('c', [ + '-DOPENSSL_NO_ASM', + ]) + my_module.compile_flags('link', [ + '-ldl', + ]) + """ + 'openssl/apps/asn1pars.c', + 'openssl/apps/req.c', + 'openssl/apps/dgst.c', + 'openssl/apps/dh.c', + 'openssl/apps/dhparam.c', + 'openssl/apps/enc.c', + 'openssl/apps/passwd.c', + 'openssl/apps/gendh.c', + 'openssl/apps/errstr.c', + 'openssl/apps/ca.c', + 'openssl/apps/pkcs7.c', + 'openssl/apps/crl2p7.c', + 'openssl/apps/crl.c', + 'openssl/apps/rsa.c', + 'openssl/apps/rsautl.c', + 'openssl/apps/dsa.c', + 'openssl/apps/dsaparam.c', + 'openssl/apps/ec.c', + 'openssl/apps/ecparam.c', + 'openssl/apps/x509.c', + 'openssl/apps/genrsa.c', + 'openssl/apps/gendsa.c', + 'openssl/apps/genpkey.c', + 'openssl/apps/s_server.c', + 'openssl/apps/s_client.c', + 'openssl/apps/speed.c', + 'openssl/apps/s_time.c', + 'openssl/apps/apps.c', + 'openssl/apps/s_cb.c', + 'openssl/apps/s_socket.c', + 'openssl/apps/app_rand.c', + 'openssl/apps/version.c', + 'openssl/apps/sess_id.c', + 'openssl/apps/ciphers.c', + 'openssl/apps/nseq.c', + 'openssl/apps/pkcs12.c', + 'openssl/apps/pkcs8.c', + 'openssl/apps/pkey.c', + 'openssl/apps/pkeyparam.c', + 'openssl/apps/pkeyutl.c', + 'openssl/apps/spkac.c', + 'openssl/apps/smime.c', + 'openssl/apps/cms.c', + 'openssl/apps/rand.c', + 'openssl/apps/engine.c', + 'openssl/apps/ocsp.c', + 'openssl/apps/prime.c', + 'openssl/apps/ts.c', + 'openssl/apps/srp.c', + 'openssl/apps/openssl.c' + """ + my_module.compile_version("c", 1989, gnu=True) + my_module.add_module_depend('openssl') + my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl", "apps")) + my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl/crypto")) + my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl")) + """ + rm -f openssl + shlib_target=; if [ -n "" ]; then \ + shlib_target="linux-shared"; \ + elif [ -n "" ]; then \ + FIPSLD_CC="gcc"; CC=/usr/local/ssl/fips-2.0/bin/fipsld; export CC FIPSLD_CC; \ + fi; \ + LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \ + make -f ../Makefile.shared -e \ + APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o" \ + LIBDEPS=" $LIBRARIES -ldl" \ + link_app.${shlib_target} + make[2]: Entering directory '/home/heero/dev/perso/framework/openssl-lutin/openssl/apps' + ( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto -ldl}"; LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} ) + make[2]: Leaving directory '/home/heero/dev/perso/framework/openssl-lutin/openssl/apps' + make[2]: Entering directory '/home/heero/dev/perso/framework/openssl-lutin/openssl' + Doing certs/demo + pca-cert.pem => e83ef475.0 + ca-cert.pem => 3f77a2b5.0 + dsa-ca.pem => cbdbd8bc.0 + dsa-pca.pem => de4fa23b.0 + make[2]: Leaving directory '/home/heero/dev/perso/framework/openssl-lutin/openssl' + make[1]: Leaving directory '/home/heero/dev/perso/framework/openssl-lutin/openssl/apps' + """ + + return my_module diff --git a/lutin_openssl.py b/lutin_openssl.py new file mode 100644 index 0000000..f8dc5f9 --- /dev/null +++ b/lutin_openssl.py @@ -0,0 +1,106 @@ +#!/usr/bin/python +import lutin.module as module +import lutin.tools as tools +import os + + +def get_type(): + return "LIBRARY" + +def get_desc(): + return "open SSL crypto library" + +def get_licence(): + return "BSD like + notif" + +def get_compagny_type(): + return "org" + +def get_compagny_name(): + return "openssl" + +def get_maintainer(): + return ["XXX XXX"] + +def get_version(): + return [1,0,2] + + + + +def create(target, module_name): + my_module = module.Module(__file__, module_name, get_type()) + + my_module.add_src_file([ + 'openssl/ssl/s2_meth.c', + 'openssl/ssl/s2_srvr.c', + 'openssl/ssl/s2_clnt.c', + 'openssl/ssl/s2_lib.c', + 'openssl/ssl/s2_enc.c', + 'openssl/ssl/s2_pkt.c', + 'openssl/ssl/s3_meth.c', + 'openssl/ssl/s3_srvr.c', + 'openssl/ssl/s3_clnt.c', + 'openssl/ssl/s3_lib.c', + 'openssl/ssl/s3_enc.c', + 'openssl/ssl/s3_pkt.c', + 'openssl/ssl/s3_both.c', + 'openssl/ssl/s3_cbc.c', + 'openssl/ssl/s23_meth.c', + 'openssl/ssl/s23_srvr.c', + 'openssl/ssl/s23_clnt.c', + 'openssl/ssl/s23_lib.c', + 'openssl/ssl/s23_pkt.c', + 'openssl/ssl/t1_meth.c', + 'openssl/ssl/t1_srvr.c', + 'openssl/ssl/t1_clnt.c', + 'openssl/ssl/t1_lib.c', + 'openssl/ssl/t1_enc.c', + 'openssl/ssl/d1_meth.c', + 'openssl/ssl/d1_srvr.c', + 'openssl/ssl/d1_clnt.c', + 'openssl/ssl/d1_lib.c', + 'openssl/ssl/d1_pkt.c', + 'openssl/ssl/d1_both.c', + 'openssl/ssl/d1_enc.c', + 'openssl/ssl/d1_srtp.c', + 'openssl/ssl/ssl_lib.c', + 'openssl/ssl/ssl_err2.c', + 'openssl/ssl/ssl_cert.c', + 'openssl/ssl/ssl_sess.c', + 'openssl/ssl/ssl_ciph.c', + 'openssl/ssl/ssl_stat.c', + 'openssl/ssl/ssl_rsa.c', + 'openssl/ssl/ssl_asn1.c', + 'openssl/ssl/ssl_txt.c', + 'openssl/ssl/ssl_algs.c', + 'openssl/ssl/bio_ssl.c', + 'openssl/ssl/ssl_err.c', + 'openssl/ssl/kssl.c', + 'openssl/ssl/tls_srp.c', + 'openssl/ssl/t1_reneg.c', + 'openssl/ssl/ssl_utst.c' + ]) + + my_module.add_header_file([ + 'openssl/ssl/dtls1.h', + 'openssl/ssl/kssl.h', + 'openssl/ssl/srtp.h', + 'openssl/ssl/ssl.h', + 'openssl/ssl/ssl2.h', + 'openssl/ssl/ssl23.h', + 'openssl/ssl/ssl3.h', + 'openssl/ssl/tls1.h', + ], + destination_path="openssl") + + my_module.compile_flags('c', [ + '-DOPENSSL_NO_ASM', + ]) + my_module.compile_version("c", 1989, gnu=True) + my_module.add_module_depend('crypto') + my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl")) + my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl/crypto")) + my_module.add_path(os.path.join(tools.get_current_path(__file__), "openssl/ssl")) + + return my_module