render / rpms / edk2

Forked from rpms/edk2 2 months ago
Clone

Blame SOURCES/edk2-CryptoPkg-OpensslLib-Upgrade-OpenSSL-to-1.1.1g.patch

983fad
From e81751a1c303f5cd4bcae0ed1a38c60c38a0cf38 Mon Sep 17 00:00:00 2001
983fad
From: Guomin Jiang <guomin.jiang@intel.com>
983fad
Date: Fri, 10 Jul 2020 09:47:31 +0800
983fad
Subject: [PATCH 4/5] CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1g
983fad
983fad
RH-Author: Laszlo Ersek (lersek)
983fad
RH-MergeRequest: 2: [RHEL-8.4.0] bump OpenSSL dist-git submodule to 1.1.1g
983fad
RH-Commit: [1/2] 36d4bc34a3b5c421819e94c58ff84fd779a93bae (lersek/edk2)
983fad
RH-Bugzilla: 1893806
983fad
983fad
--v-- RHEL8 notes --v--
983fad
983fad
- The "CryptoPkg/Library/OpensslLib/openssl" hunk, advancing upstream
983fad
  edk2's OpenSSL submodule reference, has been stripped from this
983fad
  backport. (Refer to downstream commit c5d729df70f8 ("remove upstream
983fad
  edk2's openssl submodule (RH only)", 2020-06-05), as basis.) The
983fad
  corresponding RHEL8 OpenSSL dist-git bump is implemented in a subsequent
983fad
  patch in this series.
983fad
983fad
  This cherry-pick and the RHEL8 OpenSSL dist-git submodule bump are kept
983fad
  separate for easing the next rebase, even at the cost of introducing a
983fad
  brief interval in the git history where the downstream exploded tree
983fad
  does not build.
983fad
983fad
- Contextual difference in "OpensslLib.inf" due to downstream commit
983fad
  56c4bb81b311 ("CryptoPkg/OpensslLib: list RHEL8-specific OpenSSL files
983fad
  in the INFs (RH)", 2020-06-05); automatically resolved by
983fad
  git-cherry-pick.
983fad
983fad
--^-- RHEL8 notes --^--
983fad
983fad
Upgrade openssl to 1.1.1g. the directory have been reorganized,
983fad
openssl moved crypto/include/internal to include/crypto folder.
983fad
So we change directory to match the re-organization.
983fad
983fad
The dso_conf.h and opensslconf.h will generated in UNIX format,
983fad
change process_files.pl to covent the EOL automatically.
983fad
983fad
Cc: Jian J Wang <jian.j.wang@intel.com>
983fad
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
983fad
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
983fad
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
983fad
Tested-by: Laszlo Ersek <lersek@redhat.com>
983fad
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
983fad
(cherry picked from commit 8c30327debb28c0b6cfa2106b736774e0b20daac)
983fad
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
983fad
---
983fad
 CryptoPkg/CryptoPkg.dec                       |  1 -
983fad
 .../Library/BaseCryptLib/Hash/CryptSm3.c      |  2 +-
983fad
 .../BaseCryptLib/Pk/CryptPkcs7VerifyEku.c     |  4 +-
983fad
 .../Include/{internal => crypto}/dso_conf.h   | 32 +++++-----
983fad
 .../Library/Include/openssl/opensslconf.h     |  3 -
983fad
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 58 +++++++++----------
983fad
 .../Library/OpensslLib/OpensslLibCrypto.inf   | 50 ++++++++--------
983fad
 CryptoPkg/Library/OpensslLib/process_files.pl | 25 +++++---
983fad
 CryptoPkg/Library/OpensslLib/rand_pool.c      |  2 +-
983fad
 9 files changed, 90 insertions(+), 87 deletions(-)
983fad
 rename CryptoPkg/Library/Include/{internal => crypto}/dso_conf.h (76%)
983fad
983fad
diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec
983fad
index 4d1a1368a8..5888941bab 100644
983fad
--- a/CryptoPkg/CryptoPkg.dec
983fad
+++ b/CryptoPkg/CryptoPkg.dec
983fad
@@ -23,7 +23,6 @@
983fad
   Private
983fad
   Library/Include
983fad
   Library/OpensslLib/openssl/include
983fad
-  Library/OpensslLib/openssl/crypto/include
983fad
 
983fad
 [LibraryClasses]
983fad
   ##  @libraryclass  Provides basic library functions for cryptographic primitives.
983fad
diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c
983fad
index eacf4826c4..235331c2a0 100644
983fad
--- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c
983fad
+++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c
983fad
@@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
983fad
 **/
983fad
 
983fad
 #include "InternalCryptLib.h"
983fad
-#include "internal/sm3.h"
983fad
+#include "crypto/sm3.h"
983fad
 
983fad
 /**
983fad
   Retrieves the size, in bytes, of the context buffer required for SM3 hash operations.
983fad
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
983fad
index 229c244b26..c9fdb65b99 100644
983fad
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
983fad
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
983fad
@@ -15,13 +15,13 @@
983fad
 #include <openssl/asn1.h>
983fad
 #include <openssl/x509.h>
983fad
 #include <openssl/bio.h>
983fad
-#include <internal/x509_int.h>
983fad
+#include <crypto/x509.h>
983fad
 #include <openssl/pkcs7.h>
983fad
 #include <openssl/bn.h>
983fad
 #include <openssl/x509_vfy.h>
983fad
 #include <openssl/pem.h>
983fad
 #include <openssl/evp.h>
983fad
-#include <internal/asn1_int.h>
983fad
+#include <crypto/asn1.h>
983fad
 
983fad
 /**
983fad
   This function will return the leaf signer certificate in a chain.  This is
983fad
diff --git a/CryptoPkg/Library/Include/internal/dso_conf.h b/CryptoPkg/Library/Include/crypto/dso_conf.h
983fad
similarity index 76%
983fad
rename from CryptoPkg/Library/Include/internal/dso_conf.h
983fad
rename to CryptoPkg/Library/Include/crypto/dso_conf.h
983fad
index 43c891588b..95f4db2b15 100644
983fad
--- a/CryptoPkg/Library/Include/internal/dso_conf.h
983fad
+++ b/CryptoPkg/Library/Include/crypto/dso_conf.h
983fad
@@ -1,16 +1,16 @@
983fad
-/* WARNING: do not edit! */
983fad
-/* Generated from crypto/include/internal/dso_conf.h.in */
983fad
-/*
983fad
- * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
983fad
- *
983fad
- * Licensed under the OpenSSL license (the "License").  You may not use
983fad
- * this file except in compliance with the License.  You can obtain a copy
983fad
- * in the file LICENSE in the source distribution or at
983fad
- * https://www.openssl.org/source/license.html
983fad
- */
983fad
-
983fad
-#ifndef HEADER_DSO_CONF_H
983fad
-# define HEADER_DSO_CONF_H
983fad
-# define DSO_NONE
983fad
-# define DSO_EXTENSION ".so"
983fad
-#endif
983fad
+/* WARNING: do not edit! */
983fad
+/* Generated from include/crypto/dso_conf.h.in */
983fad
+/*
983fad
+ * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
983fad
+ *
983fad
+ * Licensed under the OpenSSL license (the "License").  You may not use
983fad
+ * this file except in compliance with the License.  You can obtain a copy
983fad
+ * in the file LICENSE in the source distribution or at
983fad
+ * https://www.openssl.org/source/license.html
983fad
+ */
983fad
+
983fad
+#ifndef OSSL_CRYPTO_DSO_CONF_H
983fad
+# define OSSL_CRYPTO_DSO_CONF_H
983fad
+# define DSO_NONE
983fad
+# define DSO_EXTENSION ".so"
983fad
+#endif
983fad
diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h b/CryptoPkg/Library/Include/openssl/opensslconf.h
983fad
index 62c2736cb0..3a2544ea5c 100644
983fad
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
983fad
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
983fad
@@ -247,9 +247,6 @@ extern "C" {
983fad
 #ifndef OPENSSL_NO_DYNAMIC_ENGINE
983fad
 # define OPENSSL_NO_DYNAMIC_ENGINE
983fad
 #endif
983fad
-#ifndef OPENSSL_NO_AFALGENG
983fad
-# define OPENSSL_NO_AFALGENG
983fad
-#endif
983fad
 
983fad
 
983fad
 /*
983fad
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
983fad
index 24e790b538..4c21b11d0a 100644
983fad
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
983fad
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
983fad
@@ -477,45 +477,45 @@
983fad
   $(OPENSSL_PATH)/crypto/s390x_arch.h
983fad
   $(OPENSSL_PATH)/crypto/sparc_arch.h
983fad
   $(OPENSSL_PATH)/crypto/vms_rms.h
983fad
-  $(OPENSSL_PATH)/crypto/aes/aes_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/aes/aes_local.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
983fad
-  $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/asn1/asn1_local.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/charmap.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
983fad
-  $(OPENSSL_PATH)/crypto/async/async_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/async/async_local.h
983fad
   $(OPENSSL_PATH)/crypto/async/arch/async_null.h
983fad
   $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
983fad
   $(OPENSSL_PATH)/crypto/async/arch/async_win.h
983fad
-  $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/bio/bio_local.h
983fad
+  $(OPENSSL_PATH)/crypto/bn/bn_local.h
983fad
   $(OPENSSL_PATH)/crypto/bn/bn_prime.h
983fad
   $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
983fad
-  $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/comp/comp_local.h
983fad
   $(OPENSSL_PATH)/crypto/conf/conf_def.h
983fad
-  $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/dh/dh_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/dso/dso_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/evp/evp_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/md5/md5_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/conf/conf_local.h
983fad
+  $(OPENSSL_PATH)/crypto/dh/dh_local.h
983fad
+  $(OPENSSL_PATH)/crypto/dso/dso_local.h
983fad
+  $(OPENSSL_PATH)/crypto/evp/evp_local.h
983fad
+  $(OPENSSL_PATH)/crypto/hmac/hmac_local.h
983fad
+  $(OPENSSL_PATH)/crypto/lhash/lhash_local.h
983fad
+  $(OPENSSL_PATH)/crypto/md5/md5_local.h
983fad
+  $(OPENSSL_PATH)/crypto/modes/modes_local.h
983fad
   $(OPENSSL_PATH)/crypto/objects/obj_dat.h
983fad
-  $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/objects/obj_local.h
983fad
   $(OPENSSL_PATH)/crypto/objects/obj_xref.h
983fad
-  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/sha/sha_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h
983fad
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h
983fad
+  $(OPENSSL_PATH)/crypto/rand/rand_local.h
983fad
+  $(OPENSSL_PATH)/crypto/rsa/rsa_local.h
983fad
+  $(OPENSSL_PATH)/crypto/sha/sha_local.h
983fad
   $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
983fad
-  $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/store/store_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/ui/ui_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/sm3/sm3_local.h
983fad
+  $(OPENSSL_PATH)/crypto/store/store_local.h
983fad
+  $(OPENSSL_PATH)/crypto/ui/ui_local.h
983fad
+  $(OPENSSL_PATH)/crypto/x509/x509_local.h
983fad
   $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
983fad
-  $(OPENSSL_PATH)/crypto/x509v3/pcy_int.h
983fad
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h
983fad
   $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
983fad
   $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h
983fad
   $(OPENSSL_PATH)/ssl/bio_ssl.c
983fad
@@ -562,13 +562,13 @@
983fad
   $(OPENSSL_PATH)/ssl/t1_trce.c
983fad
   $(OPENSSL_PATH)/ssl/tls13_enc.c
983fad
   $(OPENSSL_PATH)/ssl/tls_srp.c
983fad
-  $(OPENSSL_PATH)/ssl/packet_locl.h
983fad
+  $(OPENSSL_PATH)/ssl/packet_local.h
983fad
   $(OPENSSL_PATH)/ssl/ssl_cert_table.h
983fad
-  $(OPENSSL_PATH)/ssl/ssl_locl.h
983fad
+  $(OPENSSL_PATH)/ssl/ssl_local.h
983fad
   $(OPENSSL_PATH)/ssl/record/record.h
983fad
-  $(OPENSSL_PATH)/ssl/record/record_locl.h
983fad
+  $(OPENSSL_PATH)/ssl/record/record_local.h
983fad
   $(OPENSSL_PATH)/ssl/statem/statem.h
983fad
-  $(OPENSSL_PATH)/ssl/statem/statem_locl.h
983fad
+  $(OPENSSL_PATH)/ssl/statem/statem_local.h
983fad
 # Autogenerated files list ends here
983fad
 # RHEL8-specific OpenSSL file list starts here
983fad
   $(OPENSSL_PATH)/crypto/evp/kdf_lib.c
983fad
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
983fad
index 52e70a2d03..0c3b210d6a 100644
983fad
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
983fad
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
983fad
@@ -477,45 +477,45 @@
983fad
   $(OPENSSL_PATH)/crypto/s390x_arch.h
983fad
   $(OPENSSL_PATH)/crypto/sparc_arch.h
983fad
   $(OPENSSL_PATH)/crypto/vms_rms.h
983fad
-  $(OPENSSL_PATH)/crypto/aes/aes_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/aes/aes_local.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
983fad
-  $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/asn1/asn1_local.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/charmap.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
983fad
   $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
983fad
-  $(OPENSSL_PATH)/crypto/async/async_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/async/async_local.h
983fad
   $(OPENSSL_PATH)/crypto/async/arch/async_null.h
983fad
   $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
983fad
   $(OPENSSL_PATH)/crypto/async/arch/async_win.h
983fad
-  $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/bio/bio_local.h
983fad
+  $(OPENSSL_PATH)/crypto/bn/bn_local.h
983fad
   $(OPENSSL_PATH)/crypto/bn/bn_prime.h
983fad
   $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
983fad
-  $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/comp/comp_local.h
983fad
   $(OPENSSL_PATH)/crypto/conf/conf_def.h
983fad
-  $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/dh/dh_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/dso/dso_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/evp/evp_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/md5/md5_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/conf/conf_local.h
983fad
+  $(OPENSSL_PATH)/crypto/dh/dh_local.h
983fad
+  $(OPENSSL_PATH)/crypto/dso/dso_local.h
983fad
+  $(OPENSSL_PATH)/crypto/evp/evp_local.h
983fad
+  $(OPENSSL_PATH)/crypto/hmac/hmac_local.h
983fad
+  $(OPENSSL_PATH)/crypto/lhash/lhash_local.h
983fad
+  $(OPENSSL_PATH)/crypto/md5/md5_local.h
983fad
+  $(OPENSSL_PATH)/crypto/modes/modes_local.h
983fad
   $(OPENSSL_PATH)/crypto/objects/obj_dat.h
983fad
-  $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/objects/obj_local.h
983fad
   $(OPENSSL_PATH)/crypto/objects/obj_xref.h
983fad
-  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
983fad
-  $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/sha/sha_locl.h
983fad
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h
983fad
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h
983fad
+  $(OPENSSL_PATH)/crypto/rand/rand_local.h
983fad
+  $(OPENSSL_PATH)/crypto/rsa/rsa_local.h
983fad
+  $(OPENSSL_PATH)/crypto/sha/sha_local.h
983fad
   $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
983fad
-  $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/store/store_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/ui/ui_locl.h
983fad
-  $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
983fad
+  $(OPENSSL_PATH)/crypto/sm3/sm3_local.h
983fad
+  $(OPENSSL_PATH)/crypto/store/store_local.h
983fad
+  $(OPENSSL_PATH)/crypto/ui/ui_local.h
983fad
+  $(OPENSSL_PATH)/crypto/x509/x509_local.h
983fad
   $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
983fad
-  $(OPENSSL_PATH)/crypto/x509v3/pcy_int.h
983fad
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h
983fad
   $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
983fad
   $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h
983fad
 # Autogenerated files list ends here
983fad
diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl
983fad
index 65d07a2aed..57ce195394 100755
983fad
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
983fad
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
983fad
@@ -111,8 +111,8 @@ BEGIN {
983fad
             # Generate dso_conf.h per config data
983fad
             system(
983fad
                 "perl -I. -Mconfigdata util/dofile.pl " .
983fad
-                "crypto/include/internal/dso_conf.h.in " .
983fad
-                "> include/internal/dso_conf.h"
983fad
+                "include/crypto/dso_conf.h.in " .
983fad
+                "> include/crypto/dso_conf.h"
983fad
                 ) == 0 ||
983fad
                     die "Failed to generate dso_conf.h!\n";
983fad
 
983fad
@@ -263,14 +263,21 @@ print "Done!";
983fad
 # Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration
983fad
 #
983fad
 print "\n--> Duplicating opensslconf.h into Include/openssl ... ";
983fad
-copy($OPENSSL_PATH . "/include/openssl/opensslconf.h",
983fad
-     $OPENSSL_PATH . "/../../Include/openssl/") ||
983fad
-   die "Cannot copy opensslconf.h!";
983fad
+system(
983fad
+    "perl -pe 's/\\n/\\r\\n/' " .
983fad
+    "< " . $OPENSSL_PATH . "/include/openssl/opensslconf.h " .
983fad
+    "> " . $OPENSSL_PATH . "/../../Include/openssl/opensslconf.h"
983fad
+    ) == 0 ||
983fad
+    die "Cannot copy opensslconf.h!";
983fad
 print "Done!";
983fad
-print "\n--> Duplicating dso_conf.h into Include/internal ... ";
983fad
-copy($OPENSSL_PATH . "/include/internal/dso_conf.h",
983fad
-     $OPENSSL_PATH . "/../../Include/internal/") ||
983fad
-   die "Cannot copy dso_conf.h!";
983fad
+
983fad
+print "\n--> Duplicating dso_conf.h into Include/crypto ... ";
983fad
+system(
983fad
+    "perl -pe 's/\\n/\\r\\n/' " .
983fad
+    "< " . $OPENSSL_PATH . "/include/crypto/dso_conf.h" .
983fad
+    "> " . $OPENSSL_PATH . "/../../Include/crypto/dso_conf.h"
983fad
+    ) == 0 ||
983fad
+    die "Cannot copy dso_conf.h!";
983fad
 print "Done!\n";
983fad
 
983fad
 print "\nProcessing Files Done!\n";
983fad
diff --git a/CryptoPkg/Library/OpensslLib/rand_pool.c b/CryptoPkg/Library/OpensslLib/rand_pool.c
983fad
index 9f3983f7c3..9e0179b034 100644
983fad
--- a/CryptoPkg/Library/OpensslLib/rand_pool.c
983fad
+++ b/CryptoPkg/Library/OpensslLib/rand_pool.c
983fad
@@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
983fad
 
983fad
 **/
983fad
 
983fad
-#include "internal/rand_int.h"
983fad
+#include "crypto/rand.h"
983fad
 #include <openssl/aes.h>
983fad
 
983fad
 #include <Uefi.h>
983fad
-- 
983fad
2.27.0
983fad