public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
@ 2022-04-11 11:24 Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann

First batch of patches which update CrtLibSupport so it has everything
needed to build openssl3.  Also a testcase update for openssl3.

This does not update the openssl submodule, that'll happen in a
followup patch series.

v3:
 - move strcpy() from .h to .c file.
 - pick up review tags
v2:
 - rebase to latest master.
 - add codestyle exception for fcntl.h.

Gerd Hoffmann (8):
  CryptoPkg/CrtLibSupport: add fcntl.h
  CryptoPkg/CrtLibSupport: add strstr()
  CryptoPkg/CrtLibSupport: add INT_MIN
  CryptoPkg/CrtLibSupport: add UINT_MAX
  CryptoPkg/CrtLibSupport: add MODULESDIR
  CryptoPkg/CrtLibSupport: add off_t
  CryptoPkg/CrtLibSupport: fix strcpy
  CryptoPkg/UnitTest: fix DH testcase

 CryptoPkg/Library/Include/CrtLibSupport.h            | 12 +++++++++++-
 CryptoPkg/Library/Include/fcntl.h                    |  9 +++++++++
 CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c  | 10 ++++++++++
 .../Test/UnitTest/Library/BaseCryptLib/DhTests.c     |  6 +++---
 CryptoPkg/CryptoPkg.ci.yaml                          |  1 +
 5 files changed, 34 insertions(+), 4 deletions(-)
 create mode 100644 CryptoPkg/Library/Include/fcntl.h

-- 
2.35.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 1/8] CryptoPkg/CrtLibSupport: add fcntl.h
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 2/8] CryptoPkg/CrtLibSupport: add strstr() Gerd Hoffmann
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

Add fcntl.h header file.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/fcntl.h | 9 +++++++++
 CryptoPkg/CryptoPkg.ci.yaml       | 1 +
 2 files changed, 10 insertions(+)
 create mode 100644 CryptoPkg/Library/Include/fcntl.h

diff --git a/CryptoPkg/Library/Include/fcntl.h b/CryptoPkg/Library/Include/fcntl.h
new file mode 100644
index 000000000000..040ecfa5193d
--- /dev/null
+++ b/CryptoPkg/Library/Include/fcntl.h
@@ -0,0 +1,9 @@
+/** @file
+  Include file to support building the third-party cryptographic library.
+
+Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <CrtLibSupport.h>
diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml
index e21fafac1efe..396ca93dbe49 100644
--- a/CryptoPkg/CryptoPkg.ci.yaml
+++ b/CryptoPkg/CryptoPkg.ci.yaml
@@ -36,6 +36,7 @@
             "Library/Include/CrtLibSupport.h",
             # This has OpenSSL interfaces that aren't UEFI spec compliant
             "Library/BaseCryptLib/Hash/CryptParallelHash.h",
+            "Library/Include/fcntl.h",
             # These directories contain auto-generated OpenSSL content
             "Library/OpensslLib",
             "Library/IntrinsicLib",
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 2/8] CryptoPkg/CrtLibSupport: add strstr()
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 3/8] CryptoPkg/CrtLibSupport: add INT_MIN Gerd Hoffmann
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

Add #define for strstr().
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 75172b920b67..a47befbb907e 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -405,6 +405,7 @@ inet_pton   (
 #define strcat(strDest, strSource)          AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
 #define strncmp(string1, string2, count)    (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
 #define strcasecmp(str1, str2)              (int)AsciiStriCmp(str1,str2)
+#define strstr(s1, s2)                      AsciiStrStr(s1,s2)
 #define sprintf(buf, ...)                   AsciiSPrint(buf,MAX_STRING_SIZE,__VA_ARGS__)
 #define localtime(timer)                    NULL
 #define assert(expression)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 3/8] CryptoPkg/CrtLibSupport: add INT_MIN
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 2/8] CryptoPkg/CrtLibSupport: add strstr() Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX Gerd Hoffmann
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

Add #define for INT_MIN.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index a47befbb907e..b1db70a269ff 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -79,6 +79,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define EINVAL        22              /* Invalid argument */
 #define EAFNOSUPPORT  47              /* Address family not supported by protocol family */
 #define INT_MAX       0x7FFFFFFF      /* Maximum (signed) int value */
+#define INT_MIN       (-INT_MAX-1)    /* Minimum (signed) int value */
 #define LONG_MAX      0X7FFFFFFFL     /* max value for a long */
 #define LONG_MIN      (-LONG_MAX-1)   /* min value for a long */
 #define ULONG_MAX     0xFFFFFFFF      /* Maximum unsigned long value */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2022-04-11 11:24 ` [PATCH v3 3/8] CryptoPkg/CrtLibSupport: add INT_MIN Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

Add define for UINT_MAX.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index b1db70a269ff..aed21932278e 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -82,6 +82,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define INT_MIN       (-INT_MAX-1)    /* Minimum (signed) int value */
 #define LONG_MAX      0X7FFFFFFFL     /* max value for a long */
 #define LONG_MIN      (-LONG_MAX-1)   /* min value for a long */
+#define UINT_MAX      0xFFFFFFFF      /* Maximum unsigned int value */
 #define ULONG_MAX     0xFFFFFFFF      /* Maximum unsigned long value */
 #define CHAR_BIT      8               /* Number of bits in a char */
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2022-04-11 11:24 ` [PATCH v3 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

Add dummy MODULESDIR #define
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index aed21932278e..9829ec010aee 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -18,6 +18,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #define OPENSSLDIR  ""
 #define ENGINESDIR  ""
+#define MODULESDIR  ""
 
 #define MAX_STRING_SIZE  0x1000
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 6/8] CryptoPkg/CrtLibSupport: add off_t
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2022-04-11 11:24 ` [PATCH v3 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 20:12   ` [edk2-devel] " Pedro Falcato
  2022-04-11 11:24 ` [PATCH v3 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

Add typedef for off_t.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 9829ec010aee..287d7f76bfb3 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -104,6 +104,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 // Basic types mapping
 //
 typedef UINTN   size_t;
+typedef UINTN   off_t;
 typedef UINTN   u_int;
 typedef INTN    ptrdiff_t;
 typedef INTN    ssize_t;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 7/8] CryptoPkg/CrtLibSupport: fix strcpy
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2022-04-11 11:24 ` [PATCH v3 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-11 11:24 ` [PATCH v3 8/8] CryptoPkg/UnitTest: fix DH testcase Gerd Hoffmann
  2022-04-12 14:40 ` [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Yao, Jiewen
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

strcpy() returns a pointer to the destination string, AsciiStrCpyS()
does not.  So a simple #define does not work.  Create a function
instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h           |  7 ++++++-
 CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c | 10 ++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 287d7f76bfb3..bdc2654b6eef 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -395,6 +395,12 @@ inet_pton   (
   void *
   );
 
+char *
+strcpy (
+  char *restrict  strDest,
+  const char      *strSource
+  );
+
 //
 // Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions
 //
@@ -404,7 +410,6 @@ inet_pton   (
 #define memcmp(buf1, buf2, count)           (int)(CompareMem(buf1,buf2,(UINTN)(count)))
 #define memmove(dest, source, count)        CopyMem(dest,source,(UINTN)(count))
 #define strlen(str)                         (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
-#define strcpy(strDest, strSource)          AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)
 #define strncpy(strDest, strSource, count)  AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
 #define strcat(strDest, strSource)          AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
 #define strncmp(string1, string2, count)    (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
index bac477da070b..6fcbe5885e7b 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
@@ -265,6 +265,16 @@ strcspn (
   return Count;
 }
 
+char *
+strcpy (
+  char *restrict  strDest,
+  const char      *strSource
+  )
+{
+  AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource);
+  return strDest;
+}
+
 //
 // -- Character Classification Routines --
 //
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 8/8] CryptoPkg/UnitTest: fix DH testcase
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (6 preceding siblings ...)
  2022-04-11 11:24 ` [PATCH v3 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
@ 2022-04-11 11:24 ` Gerd Hoffmann
  2022-04-12 14:40 ` [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Yao, Jiewen
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11 11:24 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang, Gerd Hoffmann, Jiewen Yao

openssl 3.0 wants at least 512 bytes, otherwise it throws an error:

error:0280007E:Diffie-Hellman routines::modulus too small

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
---
 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c b/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c
index 5cfe8d70535b..29e892a1514c 100644
--- a/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c
+++ b/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c
@@ -53,7 +53,7 @@ TestVerifyDhGenerateKey (
   UNIT_TEST_CONTEXT  Context
   )
 {
-  UINT8    Prime[64];
+  UINT8    Prime[512];
   UINT8    PublicKey1[64];
   UINTN    PublicKey1Length;
   UINT8    PublicKey2[64];
@@ -72,10 +72,10 @@ TestVerifyDhGenerateKey (
   Key1Length       = sizeof (Key1);
   Key2Length       = sizeof (Key2);
 
-  Status = DhGenerateParameter (mDh1, 2, 64, Prime);
+  Status = DhGenerateParameter (mDh1, 2, sizeof (Prime), Prime);
   UT_ASSERT_TRUE (Status);
 
-  Status = DhSetParameter (mDh2, 2, 64, Prime);
+  Status = DhSetParameter (mDh2, 2, sizeof (Prime), Prime);
   UT_ASSERT_TRUE (Status);
 
   Status = DhGenerateKey (mDh1, PublicKey1, &PublicKey1Length);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [PATCH v3 6/8] CryptoPkg/CrtLibSupport: add off_t
  2022-04-11 11:24 ` [PATCH v3 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
@ 2022-04-11 20:12   ` Pedro Falcato
  0 siblings, 0 replies; 13+ messages in thread
From: Pedro Falcato @ 2022-04-11 20:12 UTC (permalink / raw)
  To: edk2-devel-groups-io, Gerd Hoffmann
  Cc: Oliver Steffen, Pawel Polawski, Jian J Wang, Xiaoyu Lu,
	Jiewen Yao, Guomin Jiang

[-- Attachment #1: Type: text/plain, Size: 959 bytes --]

Hi Gerd,

According to POSIX, off_t should be a signed integer type, so I suggest we
use INTN there.

On Mon, Apr 11, 2022 at 12:25 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> Add typedef for off_t.
> Will be needed by openssl 3.0.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
> ---
>  CryptoPkg/Library/Include/CrtLibSupport.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h
> b/CryptoPkg/Library/Include/CrtLibSupport.h
> index 9829ec010aee..287d7f76bfb3 100644
> --- a/CryptoPkg/Library/Include/CrtLibSupport.h
> +++ b/CryptoPkg/Library/Include/CrtLibSupport.h
> @@ -104,6 +104,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  // Basic types mapping
>  //
>  typedef UINTN   size_t;
> +typedef UINTN   off_t;
>  typedef UINTN   u_int;
>  typedef INTN    ptrdiff_t;
>  typedef INTN    ssize_t;
> --
> 2.35.1
>
>
>
> 
>
>
>

-- 
Pedro Falcato

[-- Attachment #2: Type: text/html, Size: 1596 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
  2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (7 preceding siblings ...)
  2022-04-11 11:24 ` [PATCH v3 8/8] CryptoPkg/UnitTest: fix DH testcase Gerd Hoffmann
@ 2022-04-12 14:40 ` Yao, Jiewen
  2022-04-19  9:27   ` [edk2-devel] " duntan
  8 siblings, 1 reply; 13+ messages in thread
From: Yao, Jiewen @ 2022-04-12 14:40 UTC (permalink / raw)
  To: Gerd Hoffmann, devel@edk2.groups.io
  Cc: Oliver Steffen, Pawel Polawski, Wang, Jian J, Xiaoyu Lu,
	Jiang, Guomin

Thanks for the contribution.
Merged https://github.com/tianocore/edk2/pull/2766

> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Monday, April 11, 2022 7:25 PM
> To: devel@edk2.groups.io
> Cc: Oliver Steffen <osteffen@redhat.com>; Pawel Polawski
> <ppolawsk@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Xiaoyu Lu
> <xiaoyux.lu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Jiang, Guomin
> <guomin.jiang@intel.com>; Gerd Hoffmann <kraxel@redhat.com>
> Subject: [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
> 
> First batch of patches which update CrtLibSupport so it has everything
> needed to build openssl3.  Also a testcase update for openssl3.
> 
> This does not update the openssl submodule, that'll happen in a
> followup patch series.
> 
> v3:
>  - move strcpy() from .h to .c file.
>  - pick up review tags
> v2:
>  - rebase to latest master.
>  - add codestyle exception for fcntl.h.
> 
> Gerd Hoffmann (8):
>   CryptoPkg/CrtLibSupport: add fcntl.h
>   CryptoPkg/CrtLibSupport: add strstr()
>   CryptoPkg/CrtLibSupport: add INT_MIN
>   CryptoPkg/CrtLibSupport: add UINT_MAX
>   CryptoPkg/CrtLibSupport: add MODULESDIR
>   CryptoPkg/CrtLibSupport: add off_t
>   CryptoPkg/CrtLibSupport: fix strcpy
>   CryptoPkg/UnitTest: fix DH testcase
> 
>  CryptoPkg/Library/Include/CrtLibSupport.h            | 12 +++++++++++-
>  CryptoPkg/Library/Include/fcntl.h                    |  9 +++++++++
>  CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c  | 10 ++++++++++
>  .../Test/UnitTest/Library/BaseCryptLib/DhTests.c     |  6 +++---
>  CryptoPkg/CryptoPkg.ci.yaml                          |  1 +
>  5 files changed, 34 insertions(+), 4 deletions(-)
>  create mode 100644 CryptoPkg/Library/Include/fcntl.h
> 
> --
> 2.35.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
  2022-04-12 14:40 ` [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Yao, Jiewen
@ 2022-04-19  9:27   ` duntan
  2022-04-20  2:40     ` Yao, Jiewen
  0 siblings, 1 reply; 13+ messages in thread
From: duntan @ 2022-04-19  9:27 UTC (permalink / raw)
  To: devel@edk2.groups.io, Yao, Jiewen, Gerd Hoffmann
  Cc: Oliver Steffen, Pawel Polawski, Wang, Jian J, Xiaoyu Lu,
	Jiang, Guomin, Liu, Zhiguang, Zeng, Star

Hi Hoffmann,

When building CryptoPkg, I found a build failure caused by this patch " CryptoPkg/CrtLibSupport: fix strcpy" https://github.com/tianocore/edk2/commit/fab6285a73c4c73bb131792d0afb20be369082d1.
When building CryptoPkg with the command " build -p CryptoPkg/CryptoPkg.dsc -b DEBUG -t VS2015x86 -a IA32 -a X64 ", it failed with the following log:
c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error C2146: syntax error: missing ')' before identifier 'strDest'
c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error C2061: syntax error: identifier 'strDest'
c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error C2059: syntax error: ';'
c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error C2059: syntax error: ','
c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(402): error C2059: syntax error: ')'

I guess the root cause is the "restrict" keyword in this patch is not supported by VS2015.
Can you please to fix this issue?

Thanks,
Dun
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao, Jiewen
Sent: Tuesday, April 12, 2022 10:41 PM
To: Gerd Hoffmann <kraxel@redhat.com>; devel@edk2.groups.io
Cc: Oliver Steffen <osteffen@redhat.com>; Pawel Polawski <ppolawsk@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
Subject: Re: [edk2-devel] [PATCH v3 0/8] CryptoPkg updates for openssl 3.0

Thanks for the contribution.
Merged https://github.com/tianocore/edk2/pull/2766

> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Monday, April 11, 2022 7:25 PM
> To: devel@edk2.groups.io
> Cc: Oliver Steffen <osteffen@redhat.com>; Pawel Polawski 
> <ppolawsk@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Xiaoyu Lu 
> <xiaoyux.lu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Jiang, 
> Guomin <guomin.jiang@intel.com>; Gerd Hoffmann <kraxel@redhat.com>
> Subject: [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
> 
> First batch of patches which update CrtLibSupport so it has everything 
> needed to build openssl3.  Also a testcase update for openssl3.
> 
> This does not update the openssl submodule, that'll happen in a 
> followup patch series.
> 
> v3:
>  - move strcpy() from .h to .c file.
>  - pick up review tags
> v2:
>  - rebase to latest master.
>  - add codestyle exception for fcntl.h.
> 
> Gerd Hoffmann (8):
>   CryptoPkg/CrtLibSupport: add fcntl.h
>   CryptoPkg/CrtLibSupport: add strstr()
>   CryptoPkg/CrtLibSupport: add INT_MIN
>   CryptoPkg/CrtLibSupport: add UINT_MAX
>   CryptoPkg/CrtLibSupport: add MODULESDIR
>   CryptoPkg/CrtLibSupport: add off_t
>   CryptoPkg/CrtLibSupport: fix strcpy
>   CryptoPkg/UnitTest: fix DH testcase
> 
>  CryptoPkg/Library/Include/CrtLibSupport.h            | 12 +++++++++++-
>  CryptoPkg/Library/Include/fcntl.h                    |  9 +++++++++
>  CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c  | 10 ++++++++++
>  .../Test/UnitTest/Library/BaseCryptLib/DhTests.c     |  6 +++---
>  CryptoPkg/CryptoPkg.ci.yaml                          |  1 +
>  5 files changed, 34 insertions(+), 4 deletions(-)  create mode 100644 
> CryptoPkg/Library/Include/fcntl.h
> 
> --
> 2.35.1







^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
  2022-04-19  9:27   ` [edk2-devel] " duntan
@ 2022-04-20  2:40     ` Yao, Jiewen
  0 siblings, 0 replies; 13+ messages in thread
From: Yao, Jiewen @ 2022-04-20  2:40 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io, Gerd Hoffmann
  Cc: Oliver Steffen, Pawel Polawski, Wang, Jian J, Xiaoyu Lu,
	Jiang, Guomin, Liu, Zhiguang, Zeng, Star

Hi Gerd
Do you have any comment for the regression issue?

I think we should remove "restrict" keyword.

Thank you
Yao Jiewen

> -----Original Message-----
> From: Tan, Dun <dun.tan@intel.com>
> Sent: Tuesday, April 19, 2022 5:27 PM
> To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>
> Cc: Oliver Steffen <osteffen@redhat.com>; Pawel Polawski
> <ppolawsk@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Xiaoyu Lu
> <xiaoyux.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Liu,
> Zhiguang <zhiguang.liu@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: RE: [edk2-devel] [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
> 
> Hi Hoffmann,
> 
> When building CryptoPkg, I found a build failure caused by this patch "
> CryptoPkg/CrtLibSupport: fix strcpy"
> https://github.com/tianocore/edk2/commit/fab6285a73c4c73bb131792d0afb2
> 0be369082d1.
> When building CryptoPkg with the command " build -p CryptoPkg/CryptoPkg.dsc
> -b DEBUG -t VS2015x86 -a IA32 -a X64 ", it failed with the following log:
> c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error
> C2146: syntax error: missing ')' before identifier 'strDest'
> c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error
> C2061: syntax error: identifier 'strDest'
> c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error
> C2059: syntax error: ';'
> c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(400): error
> C2059: syntax error: ','
> c:\code\edk2\edk2\CryptoPkg\Library\Include\CrtLibSupport.h(402): error
> C2059: syntax error: ')'
> 
> I guess the root cause is the "restrict" keyword in this patch is not supported by
> VS2015.
> Can you please to fix this issue?
> 
> Thanks,
> Dun
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao, Jiewen
> Sent: Tuesday, April 12, 2022 10:41 PM
> To: Gerd Hoffmann <kraxel@redhat.com>; devel@edk2.groups.io
> Cc: Oliver Steffen <osteffen@redhat.com>; Pawel Polawski
> <ppolawsk@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Xiaoyu Lu
> <xiaoyux.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> Subject: Re: [edk2-devel] [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
> 
> Thanks for the contribution.
> Merged https://github.com/tianocore/edk2/pull/2766
> 
> > -----Original Message-----
> > From: Gerd Hoffmann <kraxel@redhat.com>
> > Sent: Monday, April 11, 2022 7:25 PM
> > To: devel@edk2.groups.io
> > Cc: Oliver Steffen <osteffen@redhat.com>; Pawel Polawski
> > <ppolawsk@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Xiaoyu Lu
> > <xiaoyux.lu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Jiang,
> > Guomin <guomin.jiang@intel.com>; Gerd Hoffmann <kraxel@redhat.com>
> > Subject: [PATCH v3 0/8] CryptoPkg updates for openssl 3.0
> >
> > First batch of patches which update CrtLibSupport so it has everything
> > needed to build openssl3.  Also a testcase update for openssl3.
> >
> > This does not update the openssl submodule, that'll happen in a
> > followup patch series.
> >
> > v3:
> >  - move strcpy() from .h to .c file.
> >  - pick up review tags
> > v2:
> >  - rebase to latest master.
> >  - add codestyle exception for fcntl.h.
> >
> > Gerd Hoffmann (8):
> >   CryptoPkg/CrtLibSupport: add fcntl.h
> >   CryptoPkg/CrtLibSupport: add strstr()
> >   CryptoPkg/CrtLibSupport: add INT_MIN
> >   CryptoPkg/CrtLibSupport: add UINT_MAX
> >   CryptoPkg/CrtLibSupport: add MODULESDIR
> >   CryptoPkg/CrtLibSupport: add off_t
> >   CryptoPkg/CrtLibSupport: fix strcpy
> >   CryptoPkg/UnitTest: fix DH testcase
> >
> >  CryptoPkg/Library/Include/CrtLibSupport.h            | 12 +++++++++++-
> >  CryptoPkg/Library/Include/fcntl.h                    |  9 +++++++++
> >  CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c  | 10 ++++++++++
> >  .../Test/UnitTest/Library/BaseCryptLib/DhTests.c     |  6 +++---
> >  CryptoPkg/CryptoPkg.ci.yaml                          |  1 +
> >  5 files changed, 34 insertions(+), 4 deletions(-)  create mode 100644
> > CryptoPkg/Library/Include/fcntl.h
> >
> > --
> > 2.35.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-04-20  2:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 11:24 [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 2/8] CryptoPkg/CrtLibSupport: add strstr() Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 3/8] CryptoPkg/CrtLibSupport: add INT_MIN Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
2022-04-11 20:12   ` [edk2-devel] " Pedro Falcato
2022-04-11 11:24 ` [PATCH v3 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
2022-04-11 11:24 ` [PATCH v3 8/8] CryptoPkg/UnitTest: fix DH testcase Gerd Hoffmann
2022-04-12 14:40 ` [PATCH v3 0/8] CryptoPkg updates for openssl 3.0 Yao, Jiewen
2022-04-19  9:27   ` [edk2-devel] " duntan
2022-04-20  2:40     ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox