Reviewed-by: Jiaxin Wu <[email protected]>

Thanks.

-----Original Message-----
From: Gao, Liming 
Sent: Wednesday, September 2, 2015 4:26 PM
To: [email protected]
Cc: Long, Qin; Wu, Jiaxin
Subject: [Patch] CryptoPkg: Fix one wrong parameter for weak key checking

Fix one wrong offset which is passed into DES weak key checking in TdesInit().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <[email protected]>
CC: Jiaxin Wu <[email protected]>
---
 CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c 
b/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c
index f89094a..8025a49 100644
--- a/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c
+++ b/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c
@@ -1,9 +1,9 @@
 /** @file
   TDES Wrapper Implementation over OpenSSL.
 
-Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2015, Intel Corporation. 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
 
@@ -88,22 +88,22 @@ TdesInit (
     CopyMem (KeySchedule + 1, KeySchedule, sizeof (DES_key_schedule));
     CopyMem (KeySchedule + 2, KeySchedule, sizeof (DES_key_schedule));
     return TRUE;
   }
 
-  if (DES_is_weak_key ((const_DES_cblock *) Key + 8) == 1) {
+  if (DES_is_weak_key ((const_DES_cblock *) (Key + 8)) == 1) {
     return FALSE;
   }
 
   DES_set_key_unchecked ((const_DES_cblock *) (Key + 8), KeySchedule + 1);
 
   if (KeyLength == 128) {
     CopyMem (KeySchedule + 2, KeySchedule, sizeof (DES_key_schedule));
     return TRUE;
   }
 
-  if (DES_is_weak_key ((const_DES_cblock *) Key + 16) == 1) {
+  if (DES_is_weak_key ((const_DES_cblock *) (Key + 16)) == 1) {
     return FALSE;
   }
 
   DES_set_key_unchecked ((const_DES_cblock *) (Key + 16), KeySchedule + 2);
 
--
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to