]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fixed one typo in MathRShiftU64.S stub implementation; Add one digest algorithm regis...
authorLong, Qin <qin.long@intel.com>
Tue, 19 Nov 2013 02:57:19 +0000 (02:57 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Nov 2013 02:57:19 +0000 (02:57 +0000)
Signed-off-by: Long, Qin <qin.long@intel.com>
Reviewed-by: Fu, Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14860 6f19259b-4bc3-4df7-8a09-765794883524

CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S

index dc3ab992d024fe28fe9d5e9ccc73dc43ad91e289..895ce83faedee5ef7d6787a2ea3d2e5d5895d9c0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pseudorandom Number Generator Wrapper Implementation over OpenSSL.\r
 \r
-Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "InternalCryptLib.h"\r
 #include <openssl/rand.h>\r
+#include <openssl/evp.h>\r
 \r
 //\r
 // Default seed for UEFI Crypto Library\r
@@ -47,6 +48,14 @@ RandomSeed (
     return FALSE;\r
   }\r
 \r
+  //\r
+  // The software PRNG implementation built in OpenSSL depends on message digest algorithm.\r
+  // Make sure SHA-1 digest algorithm is available here.\r
+  //\r
+  if (EVP_add_digest (EVP_sha1 ()) == 0) {\r
+    return FALSE;\r
+  }\r
+\r
   //\r
   // Seed the pseudorandom number generator with user-supplied value.\r
   // NOTE: A cryptographic PRNG must be seeded with unpredictable data.\r
index 0f27f253d21c2e83735b1b865cd56c59c87988f8..9f87087445fe2622a6b7cbfef91489138533bcb4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pseudorandom Number Generator Wrapper Implementation over OpenSSL.\r
 \r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "InternalCryptLib.h"\r
 #include <openssl/rand.h>\r
+#include <openssl/evp.h>\r
 #include <Library/PrintLib.h>\r
 \r
 /**\r
@@ -45,6 +46,14 @@ RandomSeed (
     return FALSE;\r
   }\r
 \r
+  //\r
+  // The software PRNG implementation built in OpenSSL depends on message digest algorithm.\r
+  // Make sure SHA-1 digest algorithm is available here.\r
+  //\r
+  if (EVP_add_digest (EVP_sha1 ()) == 0) {\r
+    return FALSE;\r
+  }\r
+\r
   //\r
   // Seed the pseudorandom number generator with user-supplied value.\r
   // NOTE: A cryptographic PRNG must be seeded with unpredictable data.\r
index dbdd6383a4d654f284718ebf0b8a9acfe6dd96b4..9bd349df4e13b5fa3dedd322bb28586c755b6052 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pseudorandom Number Generator Wrapper Implementation over OpenSSL.\r
 \r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "InternalCryptLib.h"\r
 #include <openssl/rand.h>\r
+#include <openssl/evp.h>\r
 #include <Library/PrintLib.h>\r
 \r
 /**\r
@@ -45,6 +46,14 @@ RandomSeed (
     return FALSE;\r
   }\r
 \r
+  //\r
+  // The software PRNG implementation built in OpenSSL depends on message digest algorithm.\r
+  // Make sure SHA-1 digest algorithm is available here.\r
+  //\r
+  if (EVP_add_digest (EVP_sha1 ()) == 0) {\r
+    return FALSE;\r
+  }\r
+\r
   //\r
   // Seed the pseudorandom number generator with user-supplied value.\r
   // NOTE: A cryptographic PRNG must be seeded with unpredictable data.\r
index 3a8a132564c388c56539d790014a95b10bacea90..bf0587502fe75cb3f1e3516fd78678fb0af5be3e 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -53,7 +53,7 @@ ASM_PFX(__ashrdi3):
 More32:\r
     movl    %edx, %eax\r
     xor     %edx, %edx\r
-    and     $32, %cl\r
+    and     $31, %cl\r
     shr     %cl, %eax\r
     ret\r
 \r