diff options
author | kavsrf <kavsrf@gmail.com> | 2017-04-17 23:30:06 +0300 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-06-18 15:41:16 +0200 |
commit | 3058711f8b12cf11585e0eda2a1b573f0d871667 (patch) | |
tree | 3bfcf8f345924c10e0e11fd266b7b4ab133fbe54 /Library/DcsCfgLib | |
parent | 3cddd24df26085682c819a3c8e9e3ce21a2872da (diff) | |
download | VeraCrypt-DCS-3058711f8b12cf11585e0eda2a1b573f0d871667.tar.gz VeraCrypt-DCS-3058711f8b12cf11585e0eda2a1b573f0d871667.zip |
TPM 2.0
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;
}
|