diff options
Diffstat (limited to 'Library/DcsCfgLib')
-rw-r--r-- | Library/DcsCfgLib/DcsRandom.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Library/DcsCfgLib/DcsRandom.c b/Library/DcsCfgLib/DcsRandom.c index f4eb2e0..4362e6d 100644 --- a/Library/DcsCfgLib/DcsRandom.c +++ b/Library/DcsCfgLib/DcsRandom.c @@ -402,8 +402,8 @@ RndTpmPrepare( {
UINT64 rndTmp;
UINT32 sz = sizeof(rndTmp);
- if (rnd != NULL && rnd->Type == RndTypeTpm) {
- return Tpm12GetRandom(&sz, (UINT8*)&rndTmp);
+ if (rnd != NULL && rnd->Type == RndTypeTpm && !EFI_ERROR(GetTpm())) {
+ return gTpm->GetRandom(gTpm, sz, (UINT8*)&rndTmp);
}
return EFI_NOT_READY;
}
@@ -414,9 +414,8 @@ RndTpmGetBytes( OUT UINT8 *buf,
IN UINTN len)
{
- UINT32 sz = (UINT32)len;
- if (rnd != NULL && rnd->Type == RndTypeTpm) {
- return Tpm12GetRandom(&sz, buf);
+ if (rnd != NULL && rnd->Type == RndTypeTpm && !EFI_ERROR(GetTpm())) {
+ return gTpm->GetRandom(gTpm, (UINT32)len, buf);
}
return EFI_NOT_READY;
}
|