From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3131C81F94 for ; Thu, 15 Dec 2016 00:37:39 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 15 Dec 2016 00:37:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,351,1477983600"; d="scan'208";a="18403893" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 15 Dec 2016 00:37:31 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 15 Dec 2016 00:37:19 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 15 Dec 2016 00:37:18 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.11]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.235]) with mapi id 14.03.0248.002; Thu, 15 Dec 2016 16:37:16 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Long, Qin" , "Fu, Siyuan" , "Zhang, Lubo" , Thomas Palmer Thread-Topic: [Patch 03/10] CryptoPkg: Enable ssl build in OpensslLib directly Thread-Index: AQHSVdyFEw7gvq6rrEGuXQEKepnJWqEIsR+Q Date: Thu, 15 Dec 2016 08:37:15 +0000 Message-ID: References: <1481700859-76060-1-git-send-email-jiaxin.wu@intel.com> <1481700859-76060-4-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1481700859-76060-4-git-send-email-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch 03/10] CryptoPkg: Enable ssl build in OpensslLib directly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2016 08:37:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting -----Original Message----- From: Wu, Jiaxin=20 Sent: Wednesday, December 14, 2016 3:34 PM To: edk2-devel@lists.01.org Cc: Wu, Jiaxin ; Ye, Ting ; Long, Q= in ; Fu, Siyuan ; Zhang, Lubo ; Thomas Palmer Subject: [Patch 03/10] CryptoPkg: Enable ssl build in OpensslLib directly This patch is used to enable ssl build in OpensslLib module directly. Cc: Wu Jiaxin Cc: Ye Ting Cc: Long Qin Cc: Fu Siyuan Cc: Zhang Lubo Cc: Thomas Palmer Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Long Qin Reviewed-by: Wu Jiaxin Tested-by: Wu Jiaxin --- CryptoPkg/Include/OpenSslSupport.h | 11 ++++- .../Library/BaseCryptLib/SysCall/CrtWrapper.c | 10 +++++ CryptoPkg/Library/OpensslLib/Install.cmd | 1 + CryptoPkg/Library/OpensslLib/Install.sh | 1 + CryptoPkg/Library/OpensslLib/OpensslLib.inf | 52 ++++++++++++++++++= +++- CryptoPkg/Library/OpensslLib/process_files.sh | 7 +-- 6 files changed, 75 insertions(+), 7 deletions(-) diff --git a/CryptoPkg/Include/OpenSslSupport.h b/CryptoPkg/Include/OpenSsl= Support.h index dad40e4..600578e 100644 --- a/CryptoPkg/Include/OpenSslSupport.h +++ b/CryptoPkg/Include/OpenSslSupport.h @@ -1,9 +1,9 @@ /** @file Root include file to support building OpenSSL Crypto Library. =20 -Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at http://opens= ource.org/licenses/bsd-license.php =20 @@ -116,10 +116,12 @@ typedef UINT32 ino_t; typedef UINT32 dev_t; typedef UINT16 nlink_t; typedef int pid_t; typedef void *DIR; typedef void __sighandler_t (int); +typedef UINT8 __uint8_t; +typedef UINT8 sa_family_t; =20 // // Structures from EFI Application Toolkit required to build Open SSL // = struct tm { @@ -170,10 +172,16 @@ struct stat { UINT32 st_gen; /* file generation number */ INT32 st_lspare; INT64 st_qspare[2]; }; =20 +struct sockaddr { + __uint8_t sa_len; /* total length */ + sa_family_t sa_family; /* address family */ + char sa_data[14]; /* actually longer; address value */ +}; + // // Externs from EFI Application Toolkit required to build Open SSL // ex= tern int errno; =20 @@ -271,7 +279,8 @@ extern FILE *stdout; #define abort() ASSERT (FALSE) #define assert(expression) #define localtime(timer) NULL #define gmtime_r(timer,result) (result =3D NULL) #define atoi(nptr) AsciiStrDecimalToUintn(nptr) +#define gettimeofday(tvp,tz) do { (tvp)->tv_sec =3D time(NULL= ); (tvp)->tv_usec =3D 0; } while (0) =20 #endif diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPk= g/Library/BaseCryptLib/SysCall/CrtWrapper.c index c0ccc0e..a2386bc 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c @@ -382,10 +382,15 @@ FILE *fopen (const char *c, const char *m) size_t fr= ead (void *b, size_t c, size_t i, FILE *f) { return 0; } =20 +int fputs (const char *s, FILE *f) +{ + return 0; +} + int fprintf (FILE *f, const char *s, ...) { return 0; } =20 @@ -446,5 +451,10 @@ void syslog (int a, const char *c, ...) =20 ssize_t write (int f, const void *b, size_t l) { return 0; } + +int printf (char const *fmt, ...) +{ + return 0; +} diff --git a/CryptoPkg/Library/OpensslLib/Install.cmd b/CryptoPkg/Library/O= pensslLib/Install.cmd index 3d86bc7..093414d 100755 --- a/CryptoPkg/Library/OpensslLib/Install.cmd +++ b/CryptoPkg/Library/OpensslLib/Install.cmd @@ -6,10 +6,11 @@ copy crypto\crypto.h include\openssl copy crypto\opensslv.h include\openssl copy crypto\opensslconf.h include\openssl copy crypto\ebcdic.h include\openssl copy crypto\symhacks.h include\openssl copy crypto\ossl_typ.h include\openssl +copy crypto\o_dir.h include copy crypto\objects\objects.h include\openssl copy crypto\objects\obj_mac.h include\openssl copy crypto\md4\md4.h include\openssl copy crypto\md5\md5.h include\openssl copy crypto\sha\sha.h include\openssl diff --git a/CryptoPkg/Library/OpensslLib/Install.sh b/CryptoPkg/Library/Op= ensslLib/Install.sh index e6703d1..7bd55f6 100755 --- a/CryptoPkg/Library/OpensslLib/Install.sh +++ b/CryptoPkg/Library/OpensslLib/Install.sh @@ -8,10 +8,11 @@ cp crypto/crypto.h include/openssl cp crypto/opensslv.h include/openssl cp crypto/opensslconf.h include/openssl cp crypto/ebcdic.h include/openssl cp crypto/symhacks.h include/openssl cp crypto/ossl_typ.h include/openssl +cp crypto/o_dir.h include cp crypto/objects/objects.h include/openssl cp crypto/objects/obj_mac.h include/openssl cp crypto/md4/md4.h include/openssl cp crypto/md5/md5.h include/openssl cp crypto/sha/sha.h include/openssl diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Librar= y/OpensslLib/OpensslLib.inf index 8121e83..c14e36d 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -468,13 +468,63 @@ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c $(OPENSSL_PATH)/crypto/krb5/krb5_asn.c + $(OPENSSL_PATH)/crypto/pqueue/pqueue.c $(OPENSSL_PATH)/crypto/cmac/cmac.c $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c + $(OPENSSL_PATH)/ssl/s2_meth.c + $(OPENSSL_PATH)/ssl/s2_srvr.c + $(OPENSSL_PATH)/ssl/s2_clnt.c + $(OPENSSL_PATH)/ssl/s2_lib.c + $(OPENSSL_PATH)/ssl/s2_enc.c + $(OPENSSL_PATH)/ssl/s2_pkt.c + $(OPENSSL_PATH)/ssl/s3_meth.c + $(OPENSSL_PATH)/ssl/s3_srvr.c + $(OPENSSL_PATH)/ssl/s3_clnt.c + $(OPENSSL_PATH)/ssl/s3_lib.c + $(OPENSSL_PATH)/ssl/s3_enc.c + $(OPENSSL_PATH)/ssl/s3_pkt.c + $(OPENSSL_PATH)/ssl/s3_both.c + $(OPENSSL_PATH)/ssl/s3_cbc.c + $(OPENSSL_PATH)/ssl/s23_meth.c + $(OPENSSL_PATH)/ssl/s23_srvr.c + $(OPENSSL_PATH)/ssl/s23_clnt.c + $(OPENSSL_PATH)/ssl/s23_lib.c + $(OPENSSL_PATH)/ssl/s23_pkt.c + $(OPENSSL_PATH)/ssl/t1_meth.c + $(OPENSSL_PATH)/ssl/t1_srvr.c + $(OPENSSL_PATH)/ssl/t1_clnt.c + $(OPENSSL_PATH)/ssl/t1_lib.c + $(OPENSSL_PATH)/ssl/t1_enc.c + $(OPENSSL_PATH)/ssl/t1_ext.c + $(OPENSSL_PATH)/ssl/d1_meth.c + $(OPENSSL_PATH)/ssl/d1_srvr.c + $(OPENSSL_PATH)/ssl/d1_clnt.c + $(OPENSSL_PATH)/ssl/d1_lib.c + $(OPENSSL_PATH)/ssl/d1_pkt.c + $(OPENSSL_PATH)/ssl/d1_both.c + $(OPENSSL_PATH)/ssl/d1_srtp.c + $(OPENSSL_PATH)/ssl/ssl_lib.c + $(OPENSSL_PATH)/ssl/ssl_err2.c + $(OPENSSL_PATH)/ssl/ssl_cert.c + $(OPENSSL_PATH)/ssl/ssl_sess.c + $(OPENSSL_PATH)/ssl/ssl_ciph.c + $(OPENSSL_PATH)/ssl/ssl_stat.c + $(OPENSSL_PATH)/ssl/ssl_rsa.c + $(OPENSSL_PATH)/ssl/ssl_asn1.c + $(OPENSSL_PATH)/ssl/ssl_txt.c + $(OPENSSL_PATH)/ssl/ssl_algs.c + $(OPENSSL_PATH)/ssl/bio_ssl.c + $(OPENSSL_PATH)/ssl/ssl_err.c + $(OPENSSL_PATH)/ssl/kssl.c + $(OPENSSL_PATH)/ssl/t1_reneg.c + $(OPENSSL_PATH)/ssl/tls_srp.c + $(OPENSSL_PATH)/ssl/t1_trce.c + $(OPENSSL_PATH)/ssl/ssl_utst.c =20 # Autogenerated files list ends here =20 [Packages] MdePkg/MdePkg.dec @@ -498,11 +548,11 @@ # C4305: truncation from type1 to type2 of smaller size # C4306: conversion from type1 to type2 of greater size # C4702: Potentially uninitialized local variable name used # C4311: pointer truncation from 'type' to 'type' # - MSFT:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLA= GS) /wd4244 /wd4701 /wd4702 /wd4706 + MSFT:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLA= GS) /wd4244 /wd4245 /wd4701 /wd4702 /wd4706 MSFT:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLA= GS) /wd4133 /wd4244 /wd4245 /wd4267 /wd4701 /wd4305 /wd4306 /wd4702 /wd4706= /wd4311 MSFT:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLA= GS) /wd4133 /wd4244 /wd4245 /wd4267 /wd4701 /wd4305 /wd4306 /wd4702 /wd4706 =20 INTEL:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPE= NSSL_FLAGS) /w INTEL:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPE= NSSL_FLAGS) /w diff --git a/CryptoPkg/Library/OpensslLib/process_files.sh b/CryptoPkg/Libr= ary/OpensslLib/process_files.sh index 885adf3..6f069ce 100755 --- a/CryptoPkg/Library/OpensslLib/process_files.sh +++ b/CryptoPkg/Library/OpensslLib/process_files.sh @@ -40,11 +40,10 @@ fi no-jpake \ no-krb5 \ no-locking \ no-mdc2 \ no-posix-io \ - no-pqueue \ no-rc2 \ no-rcs \ no-rfc3779 \ no-ripemd \ no-scrypt \ @@ -75,17 +74,15 @@ function filelist () RELATIVE_DIRECTORY=3D*) eval "$LINE" ;; LIBSRC=3D*) LIBSRC=3D$(echo "$LINE" | sed s/^LIBSRC=3D//) - if [ "$RELATIVE_DIRECTORY" !=3D "ssl" ]; then - for FILE in $LIBSRC; do + for FILE in $LIBSRC; do if [ "$FILE" !=3D "b_print.c" ]; then echo -e ' $(OPENSSL_PATH)/'$RELATIVE_DIRECTORY/$FILE\\r\\ fi - done - fi + done ;; esac done echo -e \\r } -- 1.9.5.msysgit.1