public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable.
@ 2018-03-13  7:36 chenc2
  2018-03-13 14:48 ` Carsey, Jaben
  2018-03-14  8:46 ` Zhang, Chao B
  0 siblings, 2 replies; 3+ messages in thread
From: chenc2 @ 2018-03-13  7:36 UTC (permalink / raw)
  To: edk2-devel; +Cc: chenc2, Ni Ruiyu, Zhang Chao

Add "EA" flag for dumping auth3 variable. When dumping Auth3 variable, it
will not only displaying variable content but also in addition to metadata.
Give a warning message when dumping auth3 variable.

Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Zhang Chao <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: chenc2 <chen.a.chen@intel.com>
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c           | 9 +++++++++
 .../UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni    | 1 +
 2 files changed, 10 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
index 5791da9acc..adcec41992 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
@@ -69,6 +69,9 @@ GetAttrType (
   if ((Atts & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) != 0) {
     StrnCatGrow (&RetString, &BufLen, L"+AT", 0);
   }
+  if ((Atts & EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS) != 0) {
+    StrnCatGrow(&RetString, &BufLen, L"+EA", 0);
+  }
 
   if (RetString == NULL) {
     RetString = StrnCatGrow(&RetString, &BufLen, L"Invalid", 0);
@@ -507,6 +510,12 @@ CascadeProcessVariables (
     if (Type == DmpStoreDisplay) {
       if (!EFI_ERROR(Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
         AttrString = GetAttrType(Atts);
+        if (StrStr (AttrString, L"EA") != NULL) {
+            ShellPrintHiiEx (
+              -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_VAR_EA_WARNING), gShellDebug1HiiHandle
+              );
+        }
+
         if (StandardFormatOutput) {
           HexString = AllocatePool ((DataSize * 2 + 1) * sizeof (CHAR16));
           if (HexString != NULL) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
index 011a7bfc2d..90ce69c932 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
@@ -394,6 +394,7 @@
 #string STR_DMPSTORE_NO_VAR_FOUND_G    #language en-US "%H%s%N: No matching variables found. Guid %g\r\n"
 #string STR_DMPSTORE_NO_VAR_FOUND_G_SFO #language en-US "VariableInfo,\"\",\"%g\",\"\",\"\",\"\"\r\n"
 #string STR_DMPSTORE_VAR_SFO           #language en-US "VariableInfo,\"%s\",\"%g\",\"0x%x\",\"0x%x\",\"%s\"\r\n"
+#string STR_DMPSTORE_VAR_EA_WARNING    #language en-US "(Enhanced Authenticated Variable, Should be interpreted according to the metadata headers!)\r\n"
 
 #string STR_GET_HELP_COMP         #language en-US ""
 ".TH comp 0 "Compare 2 files"\r\n"
-- 
2.13.2.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable.
  2018-03-13  7:36 [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable chenc2
@ 2018-03-13 14:48 ` Carsey, Jaben
  2018-03-14  8:46 ` Zhang, Chao B
  1 sibling, 0 replies; 3+ messages in thread
From: Carsey, Jaben @ 2018-03-13 14:48 UTC (permalink / raw)
  To: Chen, Chen A, edk2-devel@lists.01.org; +Cc: Ni, Ruiyu, Zhang, Chao B

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

Looks good.   Please clarify that this is an output flag, not a command line flag in the commit log.

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> chenc2
> Sent: Tuesday, March 13, 2018 12:37 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Zhang, Chao B
> <chao.b.zhang@intel.com>
> Subject: [edk2] [PATCH] ShellPkg/Dmpstore: Enhance display information for
> Auth3 variable.
> Importance: High
> 
> Add "EA" flag for dumping auth3 variable. When dumping Auth3 variable, it
> will not only displaying variable content but also in addition to metadata.
> Give a warning message when dumping auth3 variable.
> 
> Cc: Ni Ruiyu <ruiyu.ni@intel.com>
> Cc: Zhang Chao <chao.b.zhang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: chenc2 <chen.a.chen@intel.com>
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c           | 9
> +++++++++
>  .../UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni    | 1 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> index 5791da9acc..adcec41992 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> @@ -69,6 +69,9 @@ GetAttrType (
>    if ((Atts & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
> != 0) {
>      StrnCatGrow (&RetString, &BufLen, L"+AT", 0);
>    }
> +  if ((Atts & EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS) != 0) {
> +    StrnCatGrow(&RetString, &BufLen, L"+EA", 0);
> +  }
> 
>    if (RetString == NULL) {
>      RetString = StrnCatGrow(&RetString, &BufLen, L"Invalid", 0);
> @@ -507,6 +510,12 @@ CascadeProcessVariables (
>      if (Type == DmpStoreDisplay) {
>        if (!EFI_ERROR(Status) && (DataBuffer != NULL) && (FoundVarName !=
> NULL)) {
>          AttrString = GetAttrType(Atts);
> +        if (StrStr (AttrString, L"EA") != NULL) {
> +            ShellPrintHiiEx (
> +              -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_VAR_EA_WARNING),
> gShellDebug1HiiHandle
> +              );
> +        }
> +
>          if (StandardFormatOutput) {
>            HexString = AllocatePool ((DataSize * 2 + 1) * sizeof (CHAR16));
>            if (HexString != NULL) {
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> index 011a7bfc2d..90ce69c932 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> @@ -394,6 +394,7 @@
>  #string STR_DMPSTORE_NO_VAR_FOUND_G    #language en-US "%H%s%N:
> No matching variables found. Guid %g\r\n"
>  #string STR_DMPSTORE_NO_VAR_FOUND_G_SFO #language en-US
> "VariableInfo,\"\",\"%g\",\"\",\"\",\"\"\r\n"
>  #string STR_DMPSTORE_VAR_SFO           #language en-US
> "VariableInfo,\"%s\",\"%g\",\"0x%x\",\"0x%x\",\"%s\"\r\n"
> +#string STR_DMPSTORE_VAR_EA_WARNING    #language en-US
> "(Enhanced Authenticated Variable, Should be interpreted according to the
> metadata headers!)\r\n"
> 
>  #string STR_GET_HELP_COMP         #language en-US ""
>  ".TH comp 0 "Compare 2 files"\r\n"
> --
> 2.13.2.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable.
  2018-03-13  7:36 [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable chenc2
  2018-03-13 14:48 ` Carsey, Jaben
@ 2018-03-14  8:46 ` Zhang, Chao B
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, Chao B @ 2018-03-14  8:46 UTC (permalink / raw)
  To: Chen, Chen A, edk2-devel@lists.01.org; +Cc: Ni, Ruiyu

Chen Chen:
  Please update license header. Others are good to me. 
  Reviewed-by: Chao Zhang<chao.b.zhang@intel.com>


-----Original Message-----
From: Chen, Chen A 
Sent: Tuesday, March 13, 2018 3:37 PM
To: edk2-devel@lists.01.org
Cc: Chen, Chen A <chen.a.chen@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
Subject: [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable.

Add "EA" flag for dumping auth3 variable. When dumping Auth3 variable, it will not only displaying variable content but also in addition to metadata.
Give a warning message when dumping auth3 variable.

Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Zhang Chao <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: chenc2 <chen.a.chen@intel.com>
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c           | 9 +++++++++
 .../UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni    | 1 +
 2 files changed, 10 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
index 5791da9acc..adcec41992 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
@@ -69,6 +69,9 @@ GetAttrType (
   if ((Atts & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) != 0) {
     StrnCatGrow (&RetString, &BufLen, L"+AT", 0);
   }
+  if ((Atts & EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS) != 0) {
+    StrnCatGrow(&RetString, &BufLen, L"+EA", 0);  }
 
   if (RetString == NULL) {
     RetString = StrnCatGrow(&RetString, &BufLen, L"Invalid", 0); @@ -507,6 +510,12 @@ CascadeProcessVariables (
     if (Type == DmpStoreDisplay) {
       if (!EFI_ERROR(Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
         AttrString = GetAttrType(Atts);
+        if (StrStr (AttrString, L"EA") != NULL) {
+            ShellPrintHiiEx (
+              -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_VAR_EA_WARNING), gShellDebug1HiiHandle
+              );
+        }
+
         if (StandardFormatOutput) {
           HexString = AllocatePool ((DataSize * 2 + 1) * sizeof (CHAR16));
           if (HexString != NULL) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
index 011a7bfc2d..90ce69c932 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Command
+++ sLib.uni
@@ -394,6 +394,7 @@
 #string STR_DMPSTORE_NO_VAR_FOUND_G    #language en-US "%H%s%N: No matching variables found. Guid %g\r\n"
 #string STR_DMPSTORE_NO_VAR_FOUND_G_SFO #language en-US "VariableInfo,\"\",\"%g\",\"\",\"\",\"\"\r\n"
 #string STR_DMPSTORE_VAR_SFO           #language en-US "VariableInfo,\"%s\",\"%g\",\"0x%x\",\"0x%x\",\"%s\"\r\n"
+#string STR_DMPSTORE_VAR_EA_WARNING    #language en-US "(Enhanced Authenticated Variable, Should be interpreted according to the metadata headers!)\r\n"
 
 #string STR_GET_HELP_COMP         #language en-US ""
 ".TH comp 0 "Compare 2 files"\r\n"
--
2.13.2.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-14  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-13  7:36 [PATCH] ShellPkg/Dmpstore: Enhance display information for Auth3 variable chenc2
2018-03-13 14:48 ` Carsey, Jaben
2018-03-14  8:46 ` Zhang, Chao B

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox