public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
To: edk2-devel@lists.01.org
Subject: [RFC PATCH 9/9] CryptoPkg/BaseCryptLib: allow MM_STANDALONE drivers to use this library
Date: Wed, 31 Oct 2018 16:39:47 +0530	[thread overview]
Message-ID: <20181031110947.6305-10-jagadeesh.ujja@arm.com> (raw)
In-Reply-To: <20181031110947.6305-1-jagadeesh.ujja@arm.com>

“BaseCryptLib” library can be used by MM_STANDALONE drivers as well.
So add MM_STANDALONE as the module type this library supports

A new inf file is added for this because the UefiRuntimeServicesTableLib
library class cannot be used along with MM_STANDALONE modules.

Change-Id: Ib7562bf4592493fb443cca9ac783c80d786f498e
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
---
 .../BaseCryptLib/BaseCryptLibMmStandalone.inf      | 106 +++++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 CryptoPkg/Library/BaseCryptLib/BaseCryptLibMmStandalone.inf

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLibMmStandalone.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLibMmStandalone.inf
new file mode 100644
index 0000000..a8aa49c
--- /dev/null
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLibMmStandalone.inf
@@ -0,0 +1,106 @@
+## @file
+#  Cryptographic Library Instance for DXE_DRIVER.
+#
+#  Caution: This module requires additional review when modified.
+#  This library will have external input - signature.
+#  This external input must be validated carefully to avoid security issues such as
+#  buffer overflow or integer overflow.
+#
+#  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2018, ARM Limited. All rights reserved.<BR>
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD License
+#  which accompanies this distribution.  The full text of the license may be found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = BaseCryptLib
+  MODULE_UNI_FILE                = BaseCryptLib.uni
+  FILE_GUID                      = be3bb803-91b6-4da0-bd91-a8b21c18ca5d
+  MODULE_TYPE                    = DXE_DRIVER
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = BaseCryptLib|DXE_DRIVER DXE_CORE UEFI_APPLICATION UEFI_DRIVER MM_STANDALONE
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+#  VALID_ARCHITECTURES           = IA32 X64 IPF ARM AARCH64
+#
+
+[Sources]
+  InternalCryptLib.h
+  Hash/CryptMd4.c
+  Hash/CryptMd5.c
+  Hash/CryptSha1.c
+  Hash/CryptSha256.c
+  Hash/CryptSha512.c
+  Hmac/CryptHmacMd5.c
+  Hmac/CryptHmacSha1.c
+  Hmac/CryptHmacSha256.c
+  Cipher/CryptAes.c
+  Cipher/CryptTdes.c
+  Cipher/CryptArc4.c
+  Pk/CryptRsaBasic.c
+  Pk/CryptRsaExt.c
+  Pk/CryptPkcs5Pbkdf2.c
+  Pk/CryptPkcs7Sign.c
+  Pk/CryptPkcs7Verify.c
+  Pk/CryptDh.c
+  Pk/CryptX509.c
+  Pk/CryptAuthenticode.c
+  Pk/CryptTs.c
+  Pem/CryptPem.c
+
+  SysCall/CrtWrapper.c
+  SysCall/TimerWrapper.c
+  SysCall/BaseMemAllocation.c
+
+[Sources.Ia32]
+  Rand/CryptRandTsc.c
+
+[Sources.X64]
+  Rand/CryptRandTsc.c
+
+[Sources.IPF]
+  Rand/CryptRandItc.c
+
+[Sources.ARM]
+  Rand/CryptRand.c
+
+[Sources.AARCH64]
+  Rand/CryptRand.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  CryptoPkg/CryptoPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  MemoryAllocationLib
+  DebugLib
+  OpensslLib
+  IntrinsicLib
+  PrintLib
+
+#
+# Remove these [BuildOptions] after this library is cleaned up
+#
+[BuildOptions]
+  #
+  # suppress the following warnings so we do not break the build with warnings-as-errors:
+  # C4090: 'function' : different 'const' qualifiers
+  #
+  MSFT:*_*_*_CC_FLAGS = /wd4090
+
+  GCC:*_GCC44_IA32_CC_FLAGS = "-D__cdecl=__attribute__((cdecl))" "-D__declspec(t)=__attribute__((t))"
+
+  # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
+  # --diag_remark=1     : Reduce severity of "#1-D: last line of file ends without a newline"
+  RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
-- 
1.9.1



  parent reply	other threads:[~2018-10-31 11:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 11:09 [RFC PATCH 0/9] Extend secure variable service to be usable from Standalone MM Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 1/9] StandaloneMmPkg: Pull in additonal libraries from staging branch Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 2/9] ArmPlatformPkg/NorFlashDxe: allow reusability as a MM driver Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 3/9] MdeModulePkg/FaultTolerantWriteDxe: " Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 4/9] MdeModulePkg/Variable/RuntimeDxe: adapt for usability with MM Standalone Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 5/9] MdeModulePkg/Variable/RuntimeDxe: adapt as a MM Standalone driver Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 6/9] CryptoPkg/BaseCryptLib: Hack to get time in MM Standalone mode Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 7/9] SecurityPkg/AuthVariableLib:allow reusability as MM_STANDALONE Jagadeesh Ujja
2018-11-09  6:04   ` Zhang, Chao B
2018-10-31 11:09 ` [RFC PATCH 8/9] MdeModulePkg VarCheckLib: allow " Jagadeesh Ujja
2018-10-31 11:09 ` Jagadeesh Ujja [this message]
2018-10-31 13:58 ` [RFC PATCH 0/9] Extend secure variable service to be usable from Standalone MM Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181031110947.6305-10-jagadeesh.ujja@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox