Revision: 16429
          http://sourceforge.net/p/edk2/code/16429
Author:   vanjeff
Date:     2014-11-25 07:11:03 +0000 (Tue, 25 Nov 2014)
Log Message:
-----------
Sync patch r16220 from main trunk.

Add PubKey index check before touching PubKey cache. Internal PubKey Variable 
PubkeyIndex is always 0, causing Index ?\226?\128?\147 1 overflow. Update 
corresponding comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <[email protected]>
Reviewed-by: Dong Guo <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>

(cherry picked from commit 13f6b584f5ab78f349c2d480093aae122e3ea949)

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/16220

Modified Paths:
--------------
    
branches/UDK2014.SP1/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c

Modified: 
branches/UDK2014.SP1/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c
===================================================================
--- 
branches/UDK2014.SP1/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c 
    2014-11-25 05:12:54 UTC (rev 16428)
+++ 
branches/UDK2014.SP1/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c 
    2014-11-25 07:11:03 UTC (rev 16429)
@@ -1410,9 +1410,11 @@
 
   if (!IsFirstTime) {
     //
-    // Check input PubKey.
+    // 2 cases need to check here
+    //   1. Internal PubKey variable. PubKeyIndex is always 0 
+    //   2. Other counter-based AuthVariable. Check input PubKey.
     //
-    if (CompareMem (PubKey, mPubKeyStore + (KeyIndex - 1) * 
EFI_CERT_TYPE_RSA2048_SIZE, EFI_CERT_TYPE_RSA2048_SIZE) != 0) {
+    if (KeyIndex == 0 || CompareMem (PubKey, mPubKeyStore + (KeyIndex - 1) * 
EFI_CERT_TYPE_RSA2048_SIZE, EFI_CERT_TYPE_RSA2048_SIZE) != 0) {
       return EFI_SECURITY_VIOLATION;
     }
     //


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to