summaryrefslogtreecommitdiff
path: root/Cryptlib/Rand
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2015-05-06 09:49:41 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2015-05-06 09:49:41 -0400
commita14921c5944c340056312f2f5b1728d698f628b1 (patch)
tree110242b91b3ade02e586bd65b9aedb05511bd34a /Cryptlib/Rand
parent72bb39c0237f8bcc3afa8b623e8b097eec6d69cd (diff)
parent7361f67dbd7f7fe98a807d3d12f90a87262124d6 (diff)
downloadefi-boot-shim-a14921c5944c340056312f2f5b1728d698f628b1.tar.gz
efi-boot-shim-a14921c5944c340056312f2f5b1728d698f628b1.zip
Import upstream version 0.8
Diffstat (limited to 'Cryptlib/Rand')
-rw-r--r--Cryptlib/Rand/CryptRand.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Cryptlib/Rand/CryptRand.c b/Cryptlib/Rand/CryptRand.c
index dc3ab992..895ce83f 100644
--- a/Cryptlib/Rand/CryptRand.c
+++ b/Cryptlib/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.
//