From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (NAM02-BL2-obe.outbound.protection.outlook.com [40.92.3.64]) by mx.groups.io with SMTP id smtpd.web10.4417.1585105200489483617 for ; Tue, 24 Mar 2020 20:00:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=PxBhKO21; spf=pass (domain: outlook.com, ip: 40.92.3.64, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gre0Xlcf8NDJd9BpIfNgt1TZYFX2VZyfdjPR/1YdfL5aJGp7Iiig91zyLUb5g883PxPbKx2AQbdA+aTg3335qrkIRaxytksEmb4IPisCe6rEOfxUE5fsdrSAAPdS4Rl6skYa7LZ/iSN5kiogh3FJXh+ZeLcezafGSR5GD6jUq8uKEr4v6ZYO4LFTcu2c5hkGC8xfoDOr/yyo83SSNPcTtulAfsDIR4rNU1zHwHhF85bykYfz+tmzolTLqW0inqxa/C/FUf9503Juw0FECQVktxfKo+I+XGbEOfYkX96T/FponeOuc+e5Wk6xHHzVa/d4GVXydICeWIJpNYoiUTTt8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZnZKZp6+NwHrAhQmtSn7ZgXQpIqQ0OtI4LQYQjZzQ1Y=; b=XU+IkHiDToP3aoYVAy8I2Ces2Wdb/dP/obKdlfOHorkSJTpf3oHzN8vds6EQdFv2zTvEjWMM5Oo1mefrlKCy0uGpI3hB7vnhbshCzOe+3TWy+R2qeKtaQCZ5TdQ9yqLU3PjUwudkXG5KlKTGoTSrRLB58TgJ3feBv4tI8FDOz8045u02GummJktYe+0HE1YOTcW5oXZzp/ci/LuH+d4ULKIQv2uPCqGa6X+xzbhiCIPvtAdvOjq46LJnTyq1jxhpmw1NnVSbri3j59MBjdLuE1mj6iUCa/TqMMzF4dTZZGvQt70k4ZJvRYX9anb8/uGNMgGQgZxoEnwtRC2JQPYadw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZnZKZp6+NwHrAhQmtSn7ZgXQpIqQ0OtI4LQYQjZzQ1Y=; b=PxBhKO212fgtZ7qQMfXP4viWBzghnTC/cbAa59rRnhjXmNs+jyJP8UMuWaSdrl6wrQPCvi7O34DxNdZnKW5hH5VBrYUj3s4Wgxa8FlHWcR550uZA54EmRlsdrhQ0OQtb258Szrj0tw5/YK8IB3mQgAsjogMpmAHy+yUf2ks73Ri1BS4CQGGCmid/KNjRbmicgiTeK2xbHtxAVVXP+WU/NUIzTIz3bZot9/I/DXeyWLfN+aPaCoI4PKTlN6YCek7i2IPqkf0uKUh8oyQZ2GBJjcKG5qyeM/TgDe1gt/dbNF5u1EgaUzT2LywtiKe94STLLv8P0wmXB1pt7/apZgIUvQ== Received: from SN1NAM02FT035.eop-nam02.prod.protection.outlook.com (10.152.72.60) by SN1NAM02HT022.eop-nam02.prod.protection.outlook.com (10.152.72.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.13; Wed, 25 Mar 2020 02:59:59 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:7e44::33) by SN1NAM02FT035.mail.protection.outlook.com (2a01:111:e400:7e44::145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 02:59:59 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:523E7CBC4B418BB6825FA5AA4DC2C0A5D44C04F5C632285A75DCCFA162C84EB1;UpperCasedChecksum:4AE295C2D1D5897DE43FB2F1B89C9A970C406CACFB82BA321ED0973BDCC658B6;SizeAsReceived:7749;Count:49 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::f5a7:e51b:e22a:959f]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::f5a7:e51b:e22a:959f%7]) with mapi id 15.20.2835.023; Wed, 25 Mar 2020 02:59:59 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Laszlo Ersek , Siyuan Fu , Maciej Rabeda , Jiaxin Wu Subject: [PATCH v2 2/2] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" Date: Tue, 24 Mar 2020 19:59:32 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 In-Reply-To: <20200325025932.13828-1-michael.kubacki@outlook.com> References: <20200325025932.13828-1-michael.kubacki@outlook.com> X-ClientProxiedBy: CO2PR18CA0045.namprd18.prod.outlook.com (2603:10b6:104:2::13) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200325025932.13828-2-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (131.107.159.121) by CO2PR18CA0045.namprd18.prod.outlook.com (2603:10b6:104:2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20 via Frontend Transport; Wed, 25 Mar 2020 02:59:58 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200325025932.13828-2-michael.kubacki@outlook.com> X-TMN: [p8FQ0V4WUjx/HCTvziYSWtF6ZyLmZMqcej8RfNMyNk0=] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0b265df0-2e73-469b-9c06-08d7d0689ace X-MS-TrafficTypeDiagnostic: SN1NAM02HT022: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KWoNqM07w32RCWXZIhRZ3zeP2pAWdQXSMYbotudQBEhYOpgi7Kvud/zMUEUpeYkGDBH5/vdl5a+UCIsxDeSj2c8hxxjgJLRC2OPQ5jCjHSkGQLTyZEJCYMBWed/xgLA+jVZ/M8ct+S2LYTyeonAJgrEtvFAJdQS71Gui68lkImnRMZNC0+cFp4iJNkAq/YCcqnfva1Tk+yjv/bhSQA+mJAxgqrwj4LtIl9BRRpQSE2k= X-MS-Exchange-AntiSpam-MessageData: VHpl+zNt0aFmrE88EeZ3zgtr0HFWxEItS4LJXa1OeesmGvRyOzDo8zKwIGEg/+tXRh3UUVIfMDgF+wNR1Fktk3vvpoK1qbAJ4TCqN6ScdMG9p4DTkv6v40k4fNss+df814CZxtykPiM54e9X4HN05A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b265df0-2e73-469b-9c06-08d7d0689ace X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2020 02:59:59.0061 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT022 Content-Type: text/plain From: Michael Kubacki This reverts commit 6896efdec2709e530b23c688cf0f31706709a0c5. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2062 GetVariable() now returns attributes when it fails with EFI_BUFFER_TOO_SMALL. Therefore, commit 6896efdec270 is reverted since it is no longer relevant. Cc: Laszlo Ersek Cc: Siyuan Fu Cc: Maciej Rabeda Cc: Jiaxin Wu Signed-off-by: Michael Kubacki --- NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 27 +------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c index 715bc3a0a941..2481d1098fa3 100644 --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c @@ -657,7 +657,6 @@ EnrollX509toVariable ( EFI_SIGNATURE_LIST *CACert; EFI_SIGNATURE_DATA *CACertData; VOID *Data; - VOID *CurrentData; UINTN DataSize; UINTN SigDataSize; UINT32 Attr; @@ -669,7 +668,6 @@ EnrollX509toVariable ( CACert = NULL; CACertData = NULL; Data = NULL; - CurrentData = NULL; Attr = 0; Status = ReadFileContent ( @@ -712,30 +710,11 @@ EnrollX509toVariable ( Status = gRT->GetVariable( VariableName, &gEfiTlsCaCertificateGuid, - NULL, + &Attr, &DataSize, NULL ); if (Status == EFI_BUFFER_TOO_SMALL) { - // - // Per spec, we have to fetch the variable's contents, even though we're - // only interested in the variable's attributes. - // - CurrentData = AllocatePool (DataSize); - if (CurrentData == NULL) { - Status = EFI_OUT_OF_RESOURCES; - goto ON_EXIT; - } - Status = gRT->GetVariable( - VariableName, - &gEfiTlsCaCertificateGuid, - &Attr, - &DataSize, - CurrentData - ); - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } Attr |= EFI_VARIABLE_APPEND_WRITE; } else if (Status == EFI_NOT_FOUND) { Attr = TLS_AUTH_CONFIG_VAR_BASE_ATTR; @@ -766,10 +745,6 @@ ON_EXIT: FreePool (Data); } - if (CurrentData != NULL) { - FreePool (CurrentData); - } - if (X509Data != NULL) { FreePool (X509Data); } -- 2.16.3.windows.1