public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.
@ 2018-10-13 15:19 Eric Jin
  2018-10-15  2:46 ` Supreeth Venkatesh
  2018-10-16  2:28 ` Leif Lindholm
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Jin @ 2018-10-13 15:19 UTC (permalink / raw)
  To: edk2-devel; +Cc: Supreeth Venkatesh, Jiaxin Wu

Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <eric.jin@intel.com>
---
 .../AuthVariableServicesBBTestConformance.c   | 143 ++++++++++++++----
 .../VariableServices/BlackBoxTest/Guid.c      |   6 +-
 .../VariableServices/BlackBoxTest/Guid.h      |  11 +-
 3 files changed, 132 insertions(+), 28 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
index 05281054..a1d1c4c3 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -151,6 +151,44 @@ AuthVariableDERConfTest (
   EFI_TEST_LOGGING_LIBRARY_PROTOCOL   *LoggingLib;
   UINT32                              Attr;
   EFI_TEST_ASSERTION                  Result;
+  UINTN                               Index;
+  UINTN                               MaximumVariableStorageSize;
+  UINTN                               RemainingVariableStorageSize;
+  UINTN                               MaximumVariableSize;
+  UINT32                              AttrArray[] = {
+    //
+    //  For 1 attribute.
+    //
+    EFI_VARIABLE_NON_VOLATILE,
+    EFI_VARIABLE_RUNTIME_ACCESS,
+    EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    //
+    //  For 2 attributes.
+    //
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    //
+    //  For 3 attributes.
+    //
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    //
+    //  For 4 attributes.
+    //
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+  };
 
   Status = GetTestSupportLibrary (
              SupportHandle,
@@ -192,33 +230,86 @@ AuthVariableDERConfTest (
                  Status
                  );
 
-  Attr = EFI_VARIABLE_NON_VOLATILE | 
-         EFI_VARIABLE_RUNTIME_ACCESS | 
-         EFI_VARIABLE_BOOTSERVICE_ACCESS |
-         EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
+  for (Index = 0; Index < sizeof (AttrArray) / sizeof (AttrArray[0]); Index = Index + 1) {
+    Attr = AttrArray[Index];
+    Attr |= EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
+
+    Status = RT->SetVariable (
+                   L"AuthVarDER",
+                   &mVarVendorGuid,
+                   Attr,
+                   sizeof (mValidAuthVarDERCreate),
+                   (VOID *) mValidAuthVarDERCreate
+                   );
+    if (Status == EFI_UNSUPPORTED) {
+      Result = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      Result = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   Result,
+                   gVariableServicesBbTestConformanceAssertionGuid020,
+                   L"RT.SetVariable - Set Auth Variable with valid cert.",
+                   L"Attributes = Array[%d]. %a:%d:Status - %r",
+                   Index,
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+
+    Status = RT->SetVariable (
+                   L"AuthVarDER",
+                   &mVarVendorGuid,
+                   Attr,
+                   sizeof (mInvalidAuthVarDERCreate),
+                   (VOID *) mInvalidAuthVarDERCreate
+                   );
+    if (Status == EFI_UNSUPPORTED) {
+      Result = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      Result = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   Result,
+                   gVariableServicesBbTestConformanceAssertionGuid023,
+                   L"RT.SetVariable - Set Auth Variable with invalid cert.",
+                   L"Attributes = Array[%d]. %a:%d:Status - %r",
+                   Index,
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+
+    Status = RT->QueryVariableInfo (
+                   Attr,
+                   &MaximumVariableStorageSize,
+                   &RemainingVariableStorageSize,
+                   &MaximumVariableSize
+                   );
+
+    if (Status == EFI_UNSUPPORTED) {
+      Result = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      Result = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   Result,
+                   gVariableServicesBbTestConformanceAssertionGuid024,
+                   L"RT.QueryVariableInfo - Query Auth Variable.",
+                   L"Attributes = Array[%d]. %a:%d:Status - %r",
+                   Index,
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
 
-  Status = RT->SetVariable(
-                 L"AuthVarDER", 
-                 &mVarVendorGuid, 
-                 Attr, 
-                 sizeof(mValidAuthVarDERCreate), 
-                 (VOID*) mValidAuthVarDERCreate
-                 );
-  if (Status == EFI_SECURITY_VIOLATION) {
-    Result = EFI_TEST_ASSERTION_PASSED;
-  } else {
-    Result = EFI_TEST_ASSERTION_FAILED;
   }
-  StandardLib->RecordAssertion (
-                 StandardLib,
-                 Result,
-                 gVariableServicesBbTestConformanceAssertionGuid020,
-                 L"RT.SetVariable - Set Auth Variable with invalid Attr",
-                 L"%a:%d:Status - %r",
-                 __FILE__,
-                 (UINTN)__LINE__,
-                 Status
-                 );
 
   return EFI_SUCCESS;
 }
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
index 6e14012a..4bbbb6e8 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -84,6 +84,10 @@ EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021 = EFI_TEST_VARIABLES
 
 EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_022_GUID;
 
+EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID;
+
+EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID;
+
 EFI_GUID gVariableServicesBbTestFunctionAssertionGuid001 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID;
 
 EFI_GUID gVariableServicesBbTestFunctionAssertionGuid002 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_002_GUID;
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
index 1d213905..4e43fbc9 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -167,6 +167,15 @@ extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021;
 
 extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022;
 
+#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID \
+{ 0x55af8fad, 0x1b12, 0x45ad, { 0xb0, 0x42, 0xa6, 0x43, 0x96, 0x2f, 0x4, 0x70 }}
+
+extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023;
+
+#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID \
+{ 0x6d0740fb, 0x388a, 0x491f, { 0xb8, 0x18, 0x9b, 0x5c, 0xb5, 0x17, 0xf, 0x95 }}
+
+extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024;
 
 
 #define EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID \
-- 
2.18.0.windows.1



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

* Re: [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.
  2018-10-13 15:19 [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute Eric Jin
@ 2018-10-15  2:46 ` Supreeth Venkatesh
  2018-10-15 13:09   ` Supreeth Venkatesh
  2018-10-16  2:28 ` Leif Lindholm
  1 sibling, 1 reply; 6+ messages in thread
From: Supreeth Venkatesh @ 2018-10-15  2:46 UTC (permalink / raw)
  To: Eric Jin, edk2-devel; +Cc: Jiaxin Wu

Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

If the commit message is broken down into multiple lines less than 80 cols.


On 10/13/2018 04:19 PM, Eric Jin wrote:
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin <eric.jin@intel.com>
> ---
>   .../AuthVariableServicesBBTestConformance.c   | 143 ++++++++++++++----
>   .../VariableServices/BlackBoxTest/Guid.c      |   6 +-
>   .../VariableServices/BlackBoxTest/Guid.h      |  11 +-
>   3 files changed, 132 insertions(+), 28 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> index 05281054..a1d1c4c3 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> @@ -1,7 +1,7 @@
>   /** @file
>   
>     Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, 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
> @@ -151,6 +151,44 @@ AuthVariableDERConfTest (
>     EFI_TEST_LOGGING_LIBRARY_PROTOCOL   *LoggingLib;
>     UINT32                              Attr;
>     EFI_TEST_ASSERTION                  Result;
> +  UINTN                               Index;
> +  UINTN                               MaximumVariableStorageSize;
> +  UINTN                               RemainingVariableStorageSize;
> +  UINTN                               MaximumVariableSize;
> +  UINT32                              AttrArray[] = {
> +    //
> +    //  For 1 attribute.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE,
> +    EFI_VARIABLE_RUNTIME_ACCESS,
> +    EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    //
> +    //  For 2 attributes.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    //
> +    //  For 3 attributes.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    //
> +    //  For 4 attributes.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +  };
>   
>     Status = GetTestSupportLibrary (
>                SupportHandle,
> @@ -192,33 +230,86 @@ AuthVariableDERConfTest (
>                    Status
>                    );
>   
> -  Attr = EFI_VARIABLE_NON_VOLATILE |
> -         EFI_VARIABLE_RUNTIME_ACCESS |
> -         EFI_VARIABLE_BOOTSERVICE_ACCESS |
> -         EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
> +  for (Index = 0; Index < sizeof (AttrArray) / sizeof (AttrArray[0]); Index = Index + 1) {
> +    Attr = AttrArray[Index];
> +    Attr |= EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
> +
> +    Status = RT->SetVariable (
> +                   L"AuthVarDER",
> +                   &mVarVendorGuid,
> +                   Attr,
> +                   sizeof (mValidAuthVarDERCreate),
> +                   (VOID *) mValidAuthVarDERCreate
> +                   );
> +    if (Status == EFI_UNSUPPORTED) {
> +      Result = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      Result = EFI_TEST_ASSERTION_FAILED;
> +    }
> +
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   Result,
> +                   gVariableServicesBbTestConformanceAssertionGuid020,
> +                   L"RT.SetVariable - Set Auth Variable with valid cert.",
> +                   L"Attributes = Array[%d]. %a:%d:Status - %r",
> +                   Index,
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
> +
> +    Status = RT->SetVariable (
> +                   L"AuthVarDER",
> +                   &mVarVendorGuid,
> +                   Attr,
> +                   sizeof (mInvalidAuthVarDERCreate),
> +                   (VOID *) mInvalidAuthVarDERCreate
> +                   );
> +    if (Status == EFI_UNSUPPORTED) {
> +      Result = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      Result = EFI_TEST_ASSERTION_FAILED;
> +    }
> +
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   Result,
> +                   gVariableServicesBbTestConformanceAssertionGuid023,
> +                   L"RT.SetVariable - Set Auth Variable with invalid cert.",
> +                   L"Attributes = Array[%d]. %a:%d:Status - %r",
> +                   Index,
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
> +
> +    Status = RT->QueryVariableInfo (
> +                   Attr,
> +                   &MaximumVariableStorageSize,
> +                   &RemainingVariableStorageSize,
> +                   &MaximumVariableSize
> +                   );
> +
> +    if (Status == EFI_UNSUPPORTED) {
> +      Result = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      Result = EFI_TEST_ASSERTION_FAILED;
> +    }
> +
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   Result,
> +                   gVariableServicesBbTestConformanceAssertionGuid024,
> +                   L"RT.QueryVariableInfo - Query Auth Variable.",
> +                   L"Attributes = Array[%d]. %a:%d:Status - %r",
> +                   Index,
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>   
> -  Status = RT->SetVariable(
> -                 L"AuthVarDER",
> -                 &mVarVendorGuid,
> -                 Attr,
> -                 sizeof(mValidAuthVarDERCreate),
> -                 (VOID*) mValidAuthVarDERCreate
> -                 );
> -  if (Status == EFI_SECURITY_VIOLATION) {
> -    Result = EFI_TEST_ASSERTION_PASSED;
> -  } else {
> -    Result = EFI_TEST_ASSERTION_FAILED;
>     }
> -  StandardLib->RecordAssertion (
> -                 StandardLib,
> -                 Result,
> -                 gVariableServicesBbTestConformanceAssertionGuid020,
> -                 L"RT.SetVariable - Set Auth Variable with invalid Attr",
> -                 L"%a:%d:Status - %r",
> -                 __FILE__,
> -                 (UINTN)__LINE__,
> -                 Status
> -                 );
>   
>     return EFI_SUCCESS;
>   }
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
> index 6e14012a..4bbbb6e8 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
> @@ -1,7 +1,7 @@
>   /** @file
>   
>     Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, 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
> @@ -84,6 +84,10 @@ EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021 = EFI_TEST_VARIABLES
>   
>   EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_022_GUID;
>   
> +EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID;
> +
> +EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID;
> +
>   EFI_GUID gVariableServicesBbTestFunctionAssertionGuid001 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID;
>   
>   EFI_GUID gVariableServicesBbTestFunctionAssertionGuid002 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_002_GUID;
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
> index 1d213905..4e43fbc9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
> @@ -1,7 +1,7 @@
>   /** @file
>   
>     Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, 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
> @@ -167,6 +167,15 @@ extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021;
>   
>   extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022;
>   
> +#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID \
> +{ 0x55af8fad, 0x1b12, 0x45ad, { 0xb0, 0x42, 0xa6, 0x43, 0x96, 0x2f, 0x4, 0x70 }}
> +
> +extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023;
> +
> +#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID \
> +{ 0x6d0740fb, 0x388a, 0x491f, { 0xb8, 0x18, 0x9b, 0x5c, 0xb5, 0x17, 0xf, 0x95 }}
> +
> +extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024;
>   
>   
>   #define EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID \



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

* Re: [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.
  2018-10-15  2:46 ` Supreeth Venkatesh
@ 2018-10-15 13:09   ` Supreeth Venkatesh
  0 siblings, 0 replies; 6+ messages in thread
From: Supreeth Venkatesh @ 2018-10-15 13:09 UTC (permalink / raw)
  To: Eric Jin, edk2-devel@lists.01.org; +Cc: Jiaxin Wu, Supreeth Venkatesh

FYI

On 10/15/2018 03:46 AM, Supreeth Venkatesh wrote:
Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com><mailto:supreeth.venkatesh@arm.com>

If the commit message is broken down into multiple lines less than 80 cols.


On 10/13/2018 04:19 PM, Eric Jin wrote:

Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com><mailto:supreeth.venkatesh@arm.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com><mailto:jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <eric.jin@intel.com><mailto:eric.jin@intel.com>
---
  .../AuthVariableServicesBBTestConformance.c   | 143 ++++++++++++++----
  .../VariableServices/BlackBoxTest/Guid.c      |   6 +-
  .../VariableServices/BlackBoxTest/Guid.h      |  11 +-
  3 files changed, 132 insertions(+), 28 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
index 05281054..a1d1c4c3 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
@@ -1,7 +1,7 @@
  /** @file
      Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -151,6 +151,44 @@ AuthVariableDERConfTest (
    EFI_TEST_LOGGING_LIBRARY_PROTOCOL   *LoggingLib;
    UINT32                              Attr;
    EFI_TEST_ASSERTION                  Result;
+  UINTN                               Index;
+  UINTN                               MaximumVariableStorageSize;
+  UINTN                               RemainingVariableStorageSize;
+  UINTN                               MaximumVariableSize;
+  UINT32                              AttrArray[] = {
+    //
+    //  For 1 attribute.
+    //
+    EFI_VARIABLE_NON_VOLATILE,
+    EFI_VARIABLE_RUNTIME_ACCESS,
+    EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    //
+    //  For 2 attributes.
+    //
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    //
+    //  For 3 attributes.
+    //
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+    //
+    //  For 4 attributes.
+    //
+    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+  };
      Status = GetTestSupportLibrary (
               SupportHandle,
@@ -192,33 +230,86 @@ AuthVariableDERConfTest (
                   Status
                   );
  -  Attr = EFI_VARIABLE_NON_VOLATILE |
-         EFI_VARIABLE_RUNTIME_ACCESS |
-         EFI_VARIABLE_BOOTSERVICE_ACCESS |
-         EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
+  for (Index = 0; Index < sizeof (AttrArray) / sizeof (AttrArray[0]); Index = Index + 1) {
+    Attr = AttrArray[Index];
+    Attr |= EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
+
+    Status = RT->SetVariable (
+                   L"AuthVarDER",
+                   &mVarVendorGuid,
+                   Attr,
+                   sizeof (mValidAuthVarDERCreate),
+                   (VOID *) mValidAuthVarDERCreate
+                   );
+    if (Status == EFI_UNSUPPORTED) {
+      Result = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      Result = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   Result,
+                   gVariableServicesBbTestConformanceAssertionGuid020,
+                   L"RT.SetVariable - Set Auth Variable with valid cert.",
+                   L"Attributes = Array[%d]. %a:%d:Status - %r",
+                   Index,
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+
+    Status = RT->SetVariable (
+                   L"AuthVarDER",
+                   &mVarVendorGuid,
+                   Attr,
+                   sizeof (mInvalidAuthVarDERCreate),
+                   (VOID *) mInvalidAuthVarDERCreate
+                   );
+    if (Status == EFI_UNSUPPORTED) {
+      Result = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      Result = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   Result,
+                   gVariableServicesBbTestConformanceAssertionGuid023,
+                   L"RT.SetVariable - Set Auth Variable with invalid cert.",
+                   L"Attributes = Array[%d]. %a:%d:Status - %r",
+                   Index,
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+
+    Status = RT->QueryVariableInfo (
+                   Attr,
+                   &MaximumVariableStorageSize,
+                   &RemainingVariableStorageSize,
+                   &MaximumVariableSize
+                   );
+
+    if (Status == EFI_UNSUPPORTED) {
+      Result = EFI_TEST_ASSERTION_PASSED;
+    } else {
+      Result = EFI_TEST_ASSERTION_FAILED;
+    }
+
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   Result,
+                   gVariableServicesBbTestConformanceAssertionGuid024,
+                   L"RT.QueryVariableInfo - Query Auth Variable.",
+                   L"Attributes = Array[%d]. %a:%d:Status - %r",
+                   Index,
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
  -  Status = RT->SetVariable(
-                 L"AuthVarDER",
-                 &mVarVendorGuid,
-                 Attr,
-                 sizeof(mValidAuthVarDERCreate),
-                 (VOID*) mValidAuthVarDERCreate
-                 );
-  if (Status == EFI_SECURITY_VIOLATION) {
-    Result = EFI_TEST_ASSERTION_PASSED;
-  } else {
-    Result = EFI_TEST_ASSERTION_FAILED;
    }
-  StandardLib->RecordAssertion (
-                 StandardLib,
-                 Result,
-                 gVariableServicesBbTestConformanceAssertionGuid020,
-                 L"RT.SetVariable - Set Auth Variable with invalid Attr",
-                 L"%a:%d:Status - %r",
-                 __FILE__,
-                 (UINTN)__LINE__,
-                 Status
-                 );
      return EFI_SUCCESS;
  }
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
index 6e14012a..4bbbb6e8 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
  /** @file
      Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -84,6 +84,10 @@ EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021 = EFI_TEST_VARIABLES
    EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_022_GUID;
  +EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID;
+
+EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID;
+
  EFI_GUID gVariableServicesBbTestFunctionAssertionGuid001 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID;
    EFI_GUID gVariableServicesBbTestFunctionAssertionGuid002 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_002_GUID;
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
index 1d213905..4e43fbc9 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
  /** @file
      Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -167,6 +167,15 @@ extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021;
    extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022;
  +#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID \
+{ 0x55af8fad, 0x1b12, 0x45ad, { 0xb0, 0x42, 0xa6, 0x43, 0x96, 0x2f, 0x4, 0x70 }}
+
+extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023;
+
+#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID \
+{ 0x6d0740fb, 0x388a, 0x491f, { 0xb8, 0x18, 0x9b, 0x5c, 0xb5, 0x17, 0xf, 0x95 }}
+
+extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024;
      #define EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID \


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.
  2018-10-13 15:19 [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute Eric Jin
  2018-10-15  2:46 ` Supreeth Venkatesh
@ 2018-10-16  2:28 ` Leif Lindholm
  2018-10-17 12:04   ` Laszlo Ersek
  1 sibling, 1 reply; 6+ messages in thread
From: Leif Lindholm @ 2018-10-16  2:28 UTC (permalink / raw)
  To: Eric Jin; +Cc: edk2-devel, Jiaxin Wu, lersek

Hi Eric,

1) Really happy to see the first SCT patch out for public review!

2) Could you go through Laszlo's excellent guide for contributions at
   https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers
   ?

Specifically the bits affecting patch generation and sending helps a
lot with reviewing.

Laszlo: a few years ago, you also posted a _really_ useful email about
the process of being a maintainer, and helpful workflows (like "sort
emails to review immediately on reception, even if you don't have time
to review now"). I have since failed to find it in my history (or via
google). Since you're very organised - do you have it lying around,
and if so would you be able to re-post it?

On Sat, Oct 13, 2018 at 11:19:36PM +0800, Eric Jin wrote:
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin <eric.jin@intel.com>
> ---
>  .../AuthVariableServicesBBTestConformance.c   | 143 ++++++++++++++----
>  .../VariableServices/BlackBoxTest/Guid.c      |   6 +-
>  .../VariableServices/BlackBoxTest/Guid.h      |  11 +-

For example, the --stat* options make sure we always see full paths to
affected files, and the orderFile ensures we see more fundamental
changes to structs and APIs before we see them used.

Secondly, I realise it is likely that there are many unrelated minor
fixes queued up from the long time during which the relicensing was
being worked on. Nevertheless, it is useful to bundle them together in
patch sets in order to make it easier to keep track of them.

(This is not something that affects patches already sent out, but it
would be appreciated for future postings.)

I am also attending the plufegest in Taipei this week, seated a couple
of rows behind you to the right, if you would like to meet up and chat
:)

Best Regards,

Leif

>  3 files changed, 132 insertions(+), 28 deletions(-)
> 
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> index 05281054..a1d1c4c3 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
> @@ -1,7 +1,7 @@
>  /** @file
>  
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, 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
> @@ -151,6 +151,44 @@ AuthVariableDERConfTest (
>    EFI_TEST_LOGGING_LIBRARY_PROTOCOL   *LoggingLib;
>    UINT32                              Attr;
>    EFI_TEST_ASSERTION                  Result;
> +  UINTN                               Index;
> +  UINTN                               MaximumVariableStorageSize;
> +  UINTN                               RemainingVariableStorageSize;
> +  UINTN                               MaximumVariableSize;
> +  UINT32                              AttrArray[] = {
> +    //
> +    //  For 1 attribute.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE,
> +    EFI_VARIABLE_RUNTIME_ACCESS,
> +    EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    //
> +    //  For 2 attributes.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    //
> +    //  For 3 attributes.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +
> +    //
> +    //  For 4 attributes.
> +    //
> +    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
> +  };
>  
>    Status = GetTestSupportLibrary (
>               SupportHandle,
> @@ -192,33 +230,86 @@ AuthVariableDERConfTest (
>                   Status
>                   );
>  
> -  Attr = EFI_VARIABLE_NON_VOLATILE | 
> -         EFI_VARIABLE_RUNTIME_ACCESS | 
> -         EFI_VARIABLE_BOOTSERVICE_ACCESS |
> -         EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
> +  for (Index = 0; Index < sizeof (AttrArray) / sizeof (AttrArray[0]); Index = Index + 1) {
> +    Attr = AttrArray[Index];
> +    Attr |= EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
> +
> +    Status = RT->SetVariable (
> +                   L"AuthVarDER",
> +                   &mVarVendorGuid,
> +                   Attr,
> +                   sizeof (mValidAuthVarDERCreate),
> +                   (VOID *) mValidAuthVarDERCreate
> +                   );
> +    if (Status == EFI_UNSUPPORTED) {
> +      Result = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      Result = EFI_TEST_ASSERTION_FAILED;
> +    }
> +
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   Result,
> +                   gVariableServicesBbTestConformanceAssertionGuid020,
> +                   L"RT.SetVariable - Set Auth Variable with valid cert.",
> +                   L"Attributes = Array[%d]. %a:%d:Status - %r",
> +                   Index,
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
> +
> +    Status = RT->SetVariable (
> +                   L"AuthVarDER",
> +                   &mVarVendorGuid,
> +                   Attr,
> +                   sizeof (mInvalidAuthVarDERCreate),
> +                   (VOID *) mInvalidAuthVarDERCreate
> +                   );
> +    if (Status == EFI_UNSUPPORTED) {
> +      Result = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      Result = EFI_TEST_ASSERTION_FAILED;
> +    }
> +
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   Result,
> +                   gVariableServicesBbTestConformanceAssertionGuid023,
> +                   L"RT.SetVariable - Set Auth Variable with invalid cert.",
> +                   L"Attributes = Array[%d]. %a:%d:Status - %r",
> +                   Index,
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
> +
> +    Status = RT->QueryVariableInfo (
> +                   Attr,
> +                   &MaximumVariableStorageSize,
> +                   &RemainingVariableStorageSize,
> +                   &MaximumVariableSize
> +                   );
> +
> +    if (Status == EFI_UNSUPPORTED) {
> +      Result = EFI_TEST_ASSERTION_PASSED;
> +    } else {
> +      Result = EFI_TEST_ASSERTION_FAILED;
> +    }
> +
> +    StandardLib->RecordAssertion (
> +                   StandardLib,
> +                   Result,
> +                   gVariableServicesBbTestConformanceAssertionGuid024,
> +                   L"RT.QueryVariableInfo - Query Auth Variable.",
> +                   L"Attributes = Array[%d]. %a:%d:Status - %r",
> +                   Index,
> +                   __FILE__,
> +                   (UINTN)__LINE__,
> +                   Status
> +                   );
>  
> -  Status = RT->SetVariable(
> -                 L"AuthVarDER", 
> -                 &mVarVendorGuid, 
> -                 Attr, 
> -                 sizeof(mValidAuthVarDERCreate), 
> -                 (VOID*) mValidAuthVarDERCreate
> -                 );
> -  if (Status == EFI_SECURITY_VIOLATION) {
> -    Result = EFI_TEST_ASSERTION_PASSED;
> -  } else {
> -    Result = EFI_TEST_ASSERTION_FAILED;
>    }
> -  StandardLib->RecordAssertion (
> -                 StandardLib,
> -                 Result,
> -                 gVariableServicesBbTestConformanceAssertionGuid020,
> -                 L"RT.SetVariable - Set Auth Variable with invalid Attr",
> -                 L"%a:%d:Status - %r",
> -                 __FILE__,
> -                 (UINTN)__LINE__,
> -                 Status
> -                 );
>  
>    return EFI_SUCCESS;
>  }
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
> index 6e14012a..4bbbb6e8 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.c
> @@ -1,7 +1,7 @@
>  /** @file
>  
>    Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, 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
> @@ -84,6 +84,10 @@ EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021 = EFI_TEST_VARIABLES
>  
>  EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_022_GUID;
>  
> +EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID;
> +
> +EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024 = EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID;
> +
>  EFI_GUID gVariableServicesBbTestFunctionAssertionGuid001 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID;
>  
>  EFI_GUID gVariableServicesBbTestFunctionAssertionGuid002 = EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_002_GUID;
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
> index 1d213905..4e43fbc9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Guid.h
> @@ -1,7 +1,7 @@
>  /** @file
>  
>    Copyright 2006 - 2016 Unified EFI, Inc.<BR>
> -  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2018, 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
> @@ -167,6 +167,15 @@ extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid021;
>  
>  extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid022;
>  
> +#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_023_GUID \
> +{ 0x55af8fad, 0x1b12, 0x45ad, { 0xb0, 0x42, 0xa6, 0x43, 0x96, 0x2f, 0x4, 0x70 }}
> +
> +extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid023;
> +
> +#define EFI_TEST_VARIABLESERVICESBBTESTCONFORMANCE_ASSERTION_024_GUID \
> +{ 0x6d0740fb, 0x388a, 0x491f, { 0xb8, 0x18, 0x9b, 0x5c, 0xb5, 0x17, 0xf, 0x95 }}
> +
> +extern EFI_GUID gVariableServicesBbTestConformanceAssertionGuid024;
>  
>  
>  #define EFI_TEST_VARIABLESERVICESBBTESTFUNCTION_ASSERTION_001_GUID \
> -- 
> 2.18.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.
  2018-10-16  2:28 ` Leif Lindholm
@ 2018-10-17 12:04   ` Laszlo Ersek
  2018-10-26 11:50     ` Leif Lindholm
  0 siblings, 1 reply; 6+ messages in thread
From: Laszlo Ersek @ 2018-10-17 12:04 UTC (permalink / raw)
  To: Leif Lindholm, Eric Jin; +Cc: edk2-devel, Jiaxin Wu

Hi Leif,

On 10/16/18 04:28, Leif Lindholm wrote:

> Laszlo: a few years ago, you also posted a _really_ useful email about
> the process of being a maintainer, and helpful workflows (like "sort
> emails to review immediately on reception, even if you don't have time
> to review now"). I have since failed to find it in my history (or via
> google). Since you're very organised - do you have it lying around,
> and if so would you be able to re-post it?

I'm sure I still have the email, if I sent it; however, I can't find it
now, because I don't personally remember the *specific* email you refer
to, and so I can't come up with good search terms, for the program that
indexes my mailbox ("recoll").

Anyway, what I generally do is:

- I maintain a set of tagged emails that present work items. This set
(of emails) exists in addition to bugzillas that are assigned to me.

- I process emails in batches. I sync my mailbox, and then turn off
synching, until I have covered everything possible, at that point, that
relate to my mailbox.

- In every new batch in my INBOX, I go over the emails as quickly as
possible, trying to triage emails as I go. If I can take care of an
email immediately, I do. If it needs more work (especially focused
work), then I tag the email, and archive it at once. If the tagged email
is private (not on any list), then I'll let it sit tagged in my personal
archive folder. If the email is also on some list, then I might choose
to tag the email in that folder instead, and archive the personal copy
without tagging it.

- I go over all the new emails in my list folders as well (i.e. emails
that I'm not personally CC'd on). Dependent on list, I dedicate
different amounts of attention.

- Once I'm done triaging / tagging the new batch (and therefore I have
no unread messages in my entire mailbox), I search my mailbox for all
tagged messages. I usually list those hits in chronological order, but
not always (e.g., sometimes I group them by containing folder). I work
my way through these items slowly. Importantly, I shut out interruptions
while I do this -- no more email synching, no phone, no IRC. And the
FIFO processing order of the tagged messages mostly ensures good
responsiveness from my side, despite this process being quite OK at
throughput as well.

(Your present email fell in the "take care of it at once" category :) )

Thanks,
Laszlo


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

* Re: [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.
  2018-10-17 12:04   ` Laszlo Ersek
@ 2018-10-26 11:50     ` Leif Lindholm
  0 siblings, 0 replies; 6+ messages in thread
From: Leif Lindholm @ 2018-10-26 11:50 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Eric Jin, edk2-devel, Evan Lloyd, Sami Mujawar,
	Supreeth Venkatesh, Achin Gupta

Laszlo, many thanks for this.

Cc:ing some new(ish) maintainers.

/
    Leif

On Wed, Oct 17, 2018 at 02:04:01PM +0200, Laszlo Ersek wrote:
> Hi Leif,
> 
> On 10/16/18 04:28, Leif Lindholm wrote:
> 
> > Laszlo: a few years ago, you also posted a _really_ useful email about
> > the process of being a maintainer, and helpful workflows (like "sort
> > emails to review immediately on reception, even if you don't have time
> > to review now"). I have since failed to find it in my history (or via
> > google). Since you're very organised - do you have it lying around,
> > and if so would you be able to re-post it?
> 
> I'm sure I still have the email, if I sent it; however, I can't find it
> now, because I don't personally remember the *specific* email you refer
> to, and so I can't come up with good search terms, for the program that
> indexes my mailbox ("recoll").
> 
> Anyway, what I generally do is:
> 
> - I maintain a set of tagged emails that present work items. This set
> (of emails) exists in addition to bugzillas that are assigned to me.
> 
> - I process emails in batches. I sync my mailbox, and then turn off
> synching, until I have covered everything possible, at that point, that
> relate to my mailbox.
> 
> - In every new batch in my INBOX, I go over the emails as quickly as
> possible, trying to triage emails as I go. If I can take care of an
> email immediately, I do. If it needs more work (especially focused
> work), then I tag the email, and archive it at once. If the tagged email
> is private (not on any list), then I'll let it sit tagged in my personal
> archive folder. If the email is also on some list, then I might choose
> to tag the email in that folder instead, and archive the personal copy
> without tagging it.
> 
> - I go over all the new emails in my list folders as well (i.e. emails
> that I'm not personally CC'd on). Dependent on list, I dedicate
> different amounts of attention.
> 
> - Once I'm done triaging / tagging the new batch (and therefore I have
> no unread messages in my entire mailbox), I search my mailbox for all
> tagged messages. I usually list those hits in chronological order, but
> not always (e.g., sometimes I group them by containing folder). I work
> my way through these items slowly. Importantly, I shut out interruptions
> while I do this -- no more email synching, no phone, no IRC. And the
> FIFO processing order of the tagged messages mostly ensures good
> responsiveness from my side, despite this process being quite OK at
> throughput as well.
> 
> (Your present email fell in the "take care of it at once" category :) )
> 
> Thanks,
> Laszlo


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

end of thread, other threads:[~2018-10-26 11:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-13 15:19 [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute Eric Jin
2018-10-15  2:46 ` Supreeth Venkatesh
2018-10-15 13:09   ` Supreeth Venkatesh
2018-10-16  2:28 ` Leif Lindholm
2018-10-17 12:04   ` Laszlo Ersek
2018-10-26 11:50     ` Leif Lindholm

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