From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::342; helo=mail-wm1-x342.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EE6D721179231 for ; Mon, 15 Oct 2018 19:28:31 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id r63-v6so20767946wma.4 for ; Mon, 15 Oct 2018 19:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7aEBiXh75z5Y+p4MjtPsY5jygNzXwBA/eJnxKsvfLvc=; b=PqoplVlEjBZpnbOCpyJ6+LDe2sl8711Qiw438daYJymT6QBjoxkfKRNzqzaD4flSE+ EAV9buFfmcOJKribKGHJ8pvmmi4PWRRGO+Jzd7amS8ycROaMhdIsdcx3WKrMjVE6D08B EI6bnFCOXWTA4GPaT/y7sYC12+gW8yPMjGhqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7aEBiXh75z5Y+p4MjtPsY5jygNzXwBA/eJnxKsvfLvc=; b=JJqGI0EXcHhVxkvszJ5638+OI9l0+Qbu2fRqTwqH+2PyEEsfnmhfoDeBkMNOnfXOIN Tmu8kiYBOUmpDhDLqNWAD3478IAbV2G5p4HvF/W/BbvInRW6yx/akO3xDtbvwvTG18bn II3/Akybz42nPnI9DrkUnu6n2oh1ftDZv7tBJtm48uf4Gk+Ngf5/aJ/RNj+HjzXqPrwJ Mn+aF/5FT60z293GmIfGd/EaP/JN+KGH6FIzLtWerU4bNlGYy68zVudHxekN86gDbv+j QPygLWy4pcuX2l+PEClHD2mBYzGs5DpK+6Y4yAPcZdaUc6rWPMJGyXmjSDy44R1non7c GHcA== X-Gm-Message-State: ABuFfoh6Y0fUW1HAwRsIwPDYKXe2s+W8x0xWjTYsURUyLFXbiIglcY3n 8iEpPtnWtn9MIiEYzkiJ6GHpjw== X-Google-Smtp-Source: ACcGV607Sq/cjxcP4/xmCkp9gbSeu9B2Q7OzU0ZdpzMmKIhnAJJlkQ36Ao8sPSxfWkFLacxPD2mzxA== X-Received: by 2002:a1c:d04e:: with SMTP id h75-v6mr15525579wmg.92.1539656910303; Mon, 15 Oct 2018 19:28:30 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o7-v6sm8612622wma.17.2018.10.15.19.28.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 19:28:28 -0700 (PDT) Date: Tue, 16 Oct 2018 03:28:27 +0100 From: Leif Lindholm To: Eric Jin Cc: edk2-devel@lists.01.org, Jiaxin Wu , lersek@redhat.com Message-ID: <20181016022826.kj63jctabgoxcf2h@bivouac.eciton.net> References: <20181013151936.15784-1-eric.jin@intel.com> MIME-Version: 1.0 In-Reply-To: <20181013151936.15784-1-eric.jin@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 02:28:32 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > Cc: Jiaxin Wu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Jin > --- > .../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.
> - Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > 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.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > 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.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > 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