summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c11
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c11
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c11
-rw-r--r--CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S4
4 files changed, 32 insertions, 5 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
index dc3ab992d0..895ce83fae 100644
--- a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
+++ b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
@@ -1,7 +1,7 @@
/** @file
Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
-Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2013, 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
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "InternalCryptLib.h"
#include <openssl/rand.h>
+#include <openssl/evp.h>
//
// Default seed for UEFI Crypto Library
@@ -48,6 +49,14 @@ RandomSeed (
}
//
+ // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
+ // Make sure SHA-1 digest algorithm is available here.
+ //
+ if (EVP_add_digest (EVP_sha1 ()) == 0) {
+ return FALSE;
+ }
+
+ //
// Seed the pseudorandom number generator with user-supplied value.
// NOTE: A cryptographic PRNG must be seeded with unpredictable data.
//
diff --git a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
index 0f27f253d2..9f87087445 100644
--- a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
+++ b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
@@ -1,7 +1,7 @@
/** @file
Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2013, 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
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "InternalCryptLib.h"
#include <openssl/rand.h>
+#include <openssl/evp.h>
#include <Library/PrintLib.h>
/**
@@ -46,6 +47,14 @@ RandomSeed (
}
//
+ // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
+ // Make sure SHA-1 digest algorithm is available here.
+ //
+ if (EVP_add_digest (EVP_sha1 ()) == 0) {
+ return FALSE;
+ }
+
+ //
// Seed the pseudorandom number generator with user-supplied value.
// NOTE: A cryptographic PRNG must be seeded with unpredictable data.
//
diff --git a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
index dbdd6383a4..9bd349df4e 100644
--- a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
+++ b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
@@ -1,7 +1,7 @@
/** @file
Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2013, 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
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "InternalCryptLib.h"
#include <openssl/rand.h>
+#include <openssl/evp.h>
#include <Library/PrintLib.h>
/**
@@ -46,6 +47,14 @@ RandomSeed (
}
//
+ // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
+ // Make sure SHA-1 digest algorithm is available here.
+ //
+ if (EVP_add_digest (EVP_sha1 ()) == 0) {
+ return FALSE;
+ }
+
+ //
// Seed the pseudorandom number generator with user-supplied value.
// NOTE: A cryptographic PRNG must be seeded with unpredictable data.
//
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
index 3a8a132564..bf0587502f 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2013, 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
@@ -53,7 +53,7 @@ ASM_PFX(__ashrdi3):
More32:
movl %edx, %eax
xor %edx, %edx
- and $32, %cl
+ and $31, %cl
shr %cl, %eax
ret