Revision: 14860
http://sourceforge.net/p/edk2/code/14860
Author: sfu5
Date: 2013-11-19 02:57:19 +0000 (Tue, 19 Nov 2013)
Log Message:
-----------
Fixed one typo in MathRShiftU64.S stub implementation; Add one digest algorithm
registration to make sure the underlying algorithm is available for the default
OpenSSL software PRNG implementation.
Signed-off-by: Long, Qin <[email protected]>
Reviewed-by: Fu, Siyuan <[email protected]>
Modified Paths:
--------------
trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c 2013-11-19
02:37:37 UTC (rev 14859)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c 2013-11-19
02:57:19 UTC (rev 14860)
@@ -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 @@
#include "InternalCryptLib.h"
#include <openssl/rand.h>
+#include <openssl/evp.h>
//
// Default seed for UEFI Crypto Library
@@ -48,6 +49,14 @@
}
//
+ // 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.
//
Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
2013-11-19 02:37:37 UTC (rev 14859)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
2013-11-19 02:57:19 UTC (rev 14860)
@@ -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 @@
#include "InternalCryptLib.h"
#include <openssl/rand.h>
+#include <openssl/evp.h>
#include <Library/PrintLib.h>
/**
@@ -46,6 +47,14 @@
}
//
+ // 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.
//
Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
2013-11-19 02:37:37 UTC (rev 14859)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
2013-11-19 02:57:19 UTC (rev 14860)
@@ -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 @@
#include "InternalCryptLib.h"
#include <openssl/rand.h>
+#include <openssl/evp.h>
#include <Library/PrintLib.h>
/**
@@ -46,6 +47,14 @@
}
//
+ // 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.
//
Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
2013-11-19 02:37:37 UTC (rev 14859)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRShiftU64.S
2013-11-19 02:57:19 UTC (rev 14860)
@@ -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 @@
More32:
movl %edx, %eax
xor %edx, %edx
- and $32, %cl
+ and $31, %cl
shr %cl, %eax
ret
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits