Reviewed-by: Jiewen Yao <[email protected]> > -----Original Message----- > From: Xu, Min M <[email protected]> > Sent: Sunday, June 12, 2022 7:25 PM > To: [email protected] > Cc: Xu, Min M <[email protected]>; Gerd Hoffmann <[email protected]>; > Yao, Jiewen <[email protected]>; Wang, Jian J <[email protected]> > Subject: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is > not Tdx guest > > From: Min M Xu <[email protected]> > > HashLibTdx is designed for the Tdx guest. So if is not a Tdx guest, > return EFI_UNSUPPORTED in RegisterHashInterfaceLib. > > Cc: Gerd Hoffmann <[email protected]> > Cc: Jiewen Yao <[email protected]> > Cc: Jian J Wang <[email protected]> > Signed-off-by: Min Xu <[email protected]> > --- > SecurityPkg/Library/HashLibTdx/HashLibTdx.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > index 75d96ee64b44..3cebbc70d3ec 100644 > --- a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > +++ b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > @@ -186,7 +186,13 @@ RegisterHashInterfaceLib ( > IN HASH_INTERFACE *HashInterface > ) > { > - ASSERT (TdIsEnabled ()); > + // > + // HashLibTdx is designed for Tdx guest. So if it is not Tdx guest, > + // return EFI_UNSUPPORTED. > + // > + if (!TdIsEnabled ()) { > + return EFI_UNSUPPORTED; > + } > > // > // Only SHA384 is allowed. > -- > 2.29.2.windows.2
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90464): https://edk2.groups.io/g/devel/message/90464 Mute This Topic: https://groups.io/mt/91704053/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
