public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/8] CryptoPkg updates for openssl 3.0
@ 2022-04-08 11:16 Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 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-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, 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.

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        | 16 +++++++++++++++-
 CryptoPkg/Library/Include/fcntl.h                |  9 +++++++++
 .../Test/UnitTest/Library/BaseCryptLib/DhTests.c |  6 +++---
 CryptoPkg/CryptoPkg.ci.yaml                      |  1 +
 4 files changed, 28 insertions(+), 4 deletions(-)
 create mode 100644 CryptoPkg/Library/Include/fcntl.h

-- 
2.35.1


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

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

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 v2 2/8] CryptoPkg/CrtLibSupport: add strstr()
  2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
@ 2022-04-08 11:16 ` Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 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-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, Gerd Hoffmann

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 v2 3/8] CryptoPkg/CrtLibSupport: add INT_MIN
  2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 2/8] CryptoPkg/CrtLibSupport: add strstr() Gerd Hoffmann
@ 2022-04-08 11:16 ` Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 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-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, Gerd Hoffmann

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 v2 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX
  2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2022-04-08 11:16 ` [PATCH v2 3/8] CryptoPkg/CrtLibSupport: add INT_MIN Gerd Hoffmann
@ 2022-04-08 11:16 ` Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, Gerd Hoffmann

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 v2 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR
  2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2022-04-08 11:16 ` [PATCH v2 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX Gerd Hoffmann
@ 2022-04-08 11:16 ` Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 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-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, Gerd Hoffmann

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 v2 6/8] CryptoPkg/CrtLibSupport: add off_t
  2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2022-04-08 11:16 ` [PATCH v2 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
@ 2022-04-08 11:16 ` Gerd Hoffmann
  2022-04-08 11:16 ` [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, Gerd Hoffmann

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy
  2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2022-04-08 11:16 ` [PATCH v2 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
@ 2022-04-08 11:16 ` Gerd Hoffmann
  2022-04-08 12:18   ` Yao, Jiewen
  2022-04-08 11:16 ` [PATCH v2 8/8] CryptoPkg/UnitTest: fix DH testcase Gerd Hoffmann
  2022-04-08 12:18 ` [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Yao, Jiewen
  8 siblings, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-08 11:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Jiewen Yao, Guomin Jiang, Jian J Wang, Xiaoyu Lu,
	Pawel Polawski, Gerd Hoffmann

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 287d7f76bfb3..7c1bc7755b1c 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -395,6 +395,16 @@ inet_pton   (
   void *
   );
 
+static inline char *
+strcpy (
+  char *restrict  strDest,
+  const char      *strSource
+  )
+{
+  AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource);
+  return strDest;
+}
+
 //
 // Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions
 //
@@ -404,7 +414,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)))
-- 
2.35.1


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

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

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>
---
 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: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy
  2022-04-08 11:16 ` [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
@ 2022-04-08 12:18   ` Yao, Jiewen
  2022-04-11  6:58     ` Gerd Hoffmann
  0 siblings, 1 reply; 13+ messages in thread
From: Yao, Jiewen @ 2022-04-08 12:18 UTC (permalink / raw)
  To: Gerd Hoffmann, devel@edk2.groups.io
  Cc: Oliver Steffen, Jiang, Guomin, Wang, Jian J, Xiaoyu Lu,
	Pawel Polawski

Can we remove inline keyword?

I don't think it is really needed in EDKII project.

Thank you
Yao Jiewen

> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Friday, April 8, 2022 7:16 PM
> To: devel@edk2.groups.io
> Cc: Oliver Steffen <osteffen@redhat.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Wang, Jian
> J <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Pawel Polawski
> <ppolawsk@redhat.com>; Gerd Hoffmann <kraxel@redhat.com>
> Subject: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy
> 
> strcpy() returns a pointer to the destination string, AsciiStrCpyS()
> does not.  So a simple #define does not work.  Create a inline function
> instead.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  CryptoPkg/Library/Include/CrtLibSupport.h | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h
> b/CryptoPkg/Library/Include/CrtLibSupport.h
> index 287d7f76bfb3..7c1bc7755b1c 100644
> --- a/CryptoPkg/Library/Include/CrtLibSupport.h
> +++ b/CryptoPkg/Library/Include/CrtLibSupport.h
> @@ -395,6 +395,16 @@ inet_pton   (
>    void *
>    );
> 
> +static inline char *
> +strcpy (
> +  char *restrict  strDest,
> +  const char      *strSource
> +  )
> +{
> +  AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource);
> +  return strDest;
> +}
> +
>  //
>  // Macros that directly map functions to BaseLib, BaseMemoryLib, and
> DebugLib functions
>  //
> @@ -404,7 +414,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)))
> --
> 2.35.1


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

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

With inline keyword removed in patch-7/8,
Series reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>



> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Friday, April 8, 2022 7:16 PM
> To: devel@edk2.groups.io
> Cc: Oliver Steffen <osteffen@redhat.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Wang, Jian
> J <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Pawel Polawski
> <ppolawsk@redhat.com>; Gerd Hoffmann <kraxel@redhat.com>
> Subject: [PATCH v2 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.
> 
> 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        | 16 +++++++++++++++-
>  CryptoPkg/Library/Include/fcntl.h                |  9 +++++++++
>  .../Test/UnitTest/Library/BaseCryptLib/DhTests.c |  6 +++---
>  CryptoPkg/CryptoPkg.ci.yaml                      |  1 +
>  4 files changed, 28 insertions(+), 4 deletions(-)
>  create mode 100644 CryptoPkg/Library/Include/fcntl.h
> 
> --
> 2.35.1


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

* Re: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy
  2022-04-08 12:18   ` Yao, Jiewen
@ 2022-04-11  6:58     ` Gerd Hoffmann
  2022-04-11  7:26       ` Yao, Jiewen
  0 siblings, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2022-04-11  6:58 UTC (permalink / raw)
  To: Yao, Jiewen
  Cc: devel@edk2.groups.io, Oliver Steffen, Jiang, Guomin, Wang, Jian J,
	Xiaoyu Lu, Pawel Polawski

On Fri, Apr 08, 2022 at 12:18:17PM +0000, Yao, Jiewen wrote:
> Can we remove inline keyword?
> 
> I don't think it is really needed in EDKII project.

Well, in the header file it is, otherwise we'll get duplicate symbol
errors.

We could probably move the implementation from
CryptoPkg/Library/Include/CrtLibSupport.h to
CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c,
then drop the inline keyword.

take care,
  Gerd


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

* Re: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy
  2022-04-11  6:58     ` Gerd Hoffmann
@ 2022-04-11  7:26       ` Yao, Jiewen
  0 siblings, 0 replies; 13+ messages in thread
From: Yao, Jiewen @ 2022-04-11  7:26 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: devel@edk2.groups.io, Oliver Steffen, Jiang, Guomin, Wang, Jian J,
	Xiaoyu Lu, Pawel Polawski, Yao, Jiewen

OK. Having implementation in .h is not allowed in EDKII. Sorry, I missed that.

Please move it to CrtWrapper.c and drop inline.

> -----Original Message-----
> From: Gerd Hoffmann <kraxel@redhat.com>
> Sent: Monday, April 11, 2022 2:59 PM
> To: Yao, Jiewen <jiewen.yao@intel.com>
> Cc: devel@edk2.groups.io; Oliver Steffen <osteffen@redhat.com>; Jiang,
> Guomin <guomin.jiang@intel.com>; Wang, Jian J <jian.j.wang@intel.com>;
> Xiaoyu Lu <xiaoyux.lu@intel.com>; Pawel Polawski <ppolawsk@redhat.com>
> Subject: Re: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy
> 
> On Fri, Apr 08, 2022 at 12:18:17PM +0000, Yao, Jiewen wrote:
> > Can we remove inline keyword?
> >
> > I don't think it is really needed in EDKII project.
> 
> Well, in the header file it is, otherwise we'll get duplicate symbol
> errors.
> 
> We could probably move the implementation from
> CryptoPkg/Library/Include/CrtLibSupport.h to
> CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c,
> then drop the inline keyword.
> 
> take care,
>   Gerd


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

end of thread, other threads:[~2022-04-11  7:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-08 11:16 [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 2/8] CryptoPkg/CrtLibSupport: add strstr() Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 3/8] CryptoPkg/CrtLibSupport: add INT_MIN Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
2022-04-08 11:16 ` [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
2022-04-08 12:18   ` Yao, Jiewen
2022-04-11  6:58     ` Gerd Hoffmann
2022-04-11  7:26       ` Yao, Jiewen
2022-04-08 11:16 ` [PATCH v2 8/8] CryptoPkg/UnitTest: fix DH testcase Gerd Hoffmann
2022-04-08 12:18 ` [PATCH v2 0/8] CryptoPkg updates for openssl 3.0 Yao, Jiewen

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