<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle21
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Do we need wait UEFI spec update for SHA-384/512 before we commit to EDK2?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If this patch series is for *<b>EDK2-staging</b>*, Acked-by: Jiewen Yao <Jiewen.yao@intel.com><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Kinney, Michael D <michael.d.kinney@intel.com> <br>
<b>Sent:</b> Thursday, December 10, 2020 5:47 AM<br>
<b>To:</b> Bret Barkelew <Bret.Barkelew@microsoft.com>; devel@edk2.groups.io; Wadhawan, Divneil R <divneil.r.wadhawan@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com><br>
<b>Cc:</b> Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Xu, Min M <min.m.xu@intel.com><br>
<b>Subject:</b> RE: [EXTERNAL] [edk2-devel] [Patch 2/2] SecurityPkg: Add support for SHA-384/SHA-512 digest algos<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Bret,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think these patches are intended for an edk2-staging branch following Code First Process.  Not root of edk2 repo.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Though unit tests for auth variables in their current form could be something that could be considered for edk2 repo now and add the unit tests for SHA extensions to edk2-staging.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Mike<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Bret Barkelew <<a href="mailto:Bret.Barkelew@microsoft.com">Bret.Barkelew@microsoft.com</a>>
<br>
<b>Sent:</b> Wednesday, December 9, 2020 12:21 PM<br>
<b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; Wadhawan, Divneil R <<a href="mailto:divneil.r.wadhawan@intel.com">divneil.r.wadhawan@intel.com</a>><br>
<b>Cc:</b> Yao, Jiewen <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>>; Wang, Jian J <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>>; Xu, Min M <<a href="mailto:min.m.xu@intel.com">min.m.xu@intel.com</a>>; Kinney, Michael
 D <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>><br>
<b>Subject:</b> RE: [EXTERNAL] [edk2-devel] [Patch 2/2] SecurityPkg: Add support for SHA-384/SHA-512 digest algos<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What’s with the Markdown file being added to the root directory? Is that a mistake or part of a different release process?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- Bret <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:divneil.r.wadhawan=intel.com@groups.io">Wadhawan, Divneil R via groups.io</a><br>
<b>Sent: </b>Wednesday, December 9, 2020 10:33 AM<br>
<b>To: </b><a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Cc: </b><a href="mailto:jiewen.yao@intel.com">Yao, Jiewen</a>; <a href="mailto:jian.j.wang@intel.com">
Jian J Wang</a>; <a href="mailto:min.m.xu@intel.com">Min Xu</a>; <a href="mailto:michael.d.kinney@intel.com">
Kinney, Michael D</a><br>
<b>Subject: </b>[EXTERNAL] [edk2-devel] [Patch 2/2] SecurityPkg: Add support for SHA-384/SHA-512 digest algos<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">o Existing implementation of Authenticated Variables only<br>
  support SHA-256 digest algorithms in signing scheme.<br>
<br>
o This has been extended to support SHA-384 and SHA-512 algorithms<br>
<br>
Cc: Jiewen Yao <<a href="mailto:jiewen.yao@intel.com">jiewen.yao@intel.com</a>><br>
Cc: Jian J Wang <<a href="mailto:jian.j.wang@intel.com">jian.j.wang@intel.com</a>><br>
Cc: Min Xu <<a href="mailto:min.m.xu@intel.com">min.m.xu@intel.com</a>><br>
Cc: Michael D Kinney <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>><br>
<br>
Signed-off-by: Divneil Rai Wadhawan <<a href="mailto:divneil.r.wadhawan@intel.com">divneil.r.wadhawan@intel.com</a>><br>
---<br>
 SecurityPkg/Library/AuthVariableLib/AuthService.c |  8 +++--<br>
 AuthVariableDigestUpdate.md                       | 41 +++++++++++++++++++++++<br>
 2 files changed, 47 insertions(+), 2 deletions(-)<br>
 create mode 100644 AuthVariableDigestUpdate.md<br>
<br>
diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c<br>
index 4fb609504d..8f024c42a8 100644<br>
--- a/SecurityPkg/Library/AuthVariableLib/AuthService.c<br>
+++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c<br>
@@ -35,6 +35,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent<br>
 CONST UINT8 mRsaE[] = { 0x01, 0x00, 0x01 };<br>
 <br>
 CONST UINT8 mSha256OidValue[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01 };<br>
+CONST UINT8 mSha384OidValue[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02 };<br>
+CONST UINT8 mSha512OidValue[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03 };<br>
 <br>
 //<br>
 // Requirement for different signature type which have been defined in UEFI spec.<br>
@@ -1901,7 +1903,7 @@ VerifyTimeBasedPayload (<br>
 <br>
   //<br>
   // SignedData.digestAlgorithms shall contain the digest algorithm used when preparing the<br>
-  // signature. Only a digest algorithm of SHA-256 is accepted.<br>
+  // signature. Digest algorithm of SHA-256, SHA-384, SHA-512 are accepted.<br>
   //<br>
   //    According to PKCS#7 Definition:<br>
   //        SignedData ::= SEQUENCE {<br>
@@ -1916,7 +1918,9 @@ VerifyTimeBasedPayload (<br>
   if ((Attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) != 0) {<br>
     if (SigDataSize >= (13 + sizeof (mSha256OidValue))) {<br>
       if (((*(SigData + 1) & TWO_BYTE_ENCODE) != TWO_BYTE_ENCODE) ||<br>
-           (CompareMem (SigData + 13, &mSha256OidValue, sizeof (mSha256OidValue)) != 0)) {<br>
+           ((CompareMem (SigData + 13, &mSha256OidValue, sizeof (mSha256OidValue)) != 0) &&<br>
+            (CompareMem (SigData + 13, &mSha384OidValue, sizeof (mSha384OidValue)) != 0) &&<br>
+            (CompareMem (SigData + 13, &mSha512OidValue, sizeof (mSha512OidValue)) != 0))) {<br>
           return EFI_SECURITY_VIOLATION;<br>
         }<br>
     }<br>
diff --git a/AuthVariableDigestUpdate.md b/AuthVariableDigestUpdate.md<br>
new file mode 100644<br>
index 0000000000..10992845a4<br>
--- /dev/null<br>
+++ b/AuthVariableDigestUpdate.md<br>
@@ -0,0 +1,41 @@<br>
+# Title: Digest Algorithm flexibility in Authenticated Variable signatures<br>
+<br>
+# Status: Draft<br>
+<br>
+# Document: UEFI Specification Version 2.8<br>
+<br>
+# License<br>
+<br>
+SPDX-License-Identifier: CC-BY-4.0<br>
+<br>
+# Submitter: [TianoCore Community](<a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.tianocore.org%2F&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C5b6eb98d1288493a5f7f08d89c70f78b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637431356285650012%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7mtSkIFgxu5iIg519YwkxjFfx6DeXOVJT67j58dHSK4%3D&amp;reserved=0">https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.tianocore.org%2F&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C5b6eb98d1288493a5f7f08d89c70f78b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637431356285650012%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7mtSkIFgxu5iIg519YwkxjFfx6DeXOVJT67j58dHSK4%3D&amp;reserved=0</a>)<br>
+<br>
+# Summary of the change<br>
+EFI_VARIABLE_AUTHENTICATION_2 specifies the SignedData.digestAlgorithms to be always<br>
+SHA256. The implication is that the signing algorithm can use RSA keys greater than<br>
+2048 bits, but the digest algorithm remains SHA256. The proposed change is to allow<br>
+digest algorithm to be greater than SHA256.<br>
+<br>
+# Benefits of the change<br>
+This brings agility to the signing mechanism of Authenticated variables by allowing<br>
+it to sign a larger digest.<br>
+<br>
+# Impact of the change<br>
+There is no impact on the existing Authenticated variables.<br>
+<br>
+# Detailed description of the change [normative updates]<br>
+<br>
+<b>Bold text</b> indicates the proposed change<br>
+<br>
+8.2.2 Using the EFI_VARIABLE_AUTHENTICATION_2 descriptor<br>
+When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is set, then the Data buffer shall begin with an instance of a complete (and serialized) ...<br>
+<br>
+Construct a DER-encoded PKCS #7 version 1.5 SignedData (see [RFC2315]) with the signed content as follows:<br>
+<br>
+a. SignedData.version shall be set to 1<br>
+<br>
+b. SignedData.digestAlgorithms shall contain the digest algorithm used when preparing the signature. <b>Only a digest algorithm greater than or equal to SHA-256 is accepted.</b><br>
+<br>
+<br>
+# Special Instructions<br>
+NA<br>
-- <br>
2.16.2.windows.1<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/68606">View/Reply Online (#68606)</a> |    |  <a target="_blank" href="https://groups.io/mt/78838684/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>