From 533b554cd5af6ca64b3ca0d52f16434d9fd734d8 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 3 Apr 2023 23:43:00 -0700 Subject: Fix SuppressSignatureVerification spelling Fixes 7358 --- src/wix/WixToolset.Converters/WixConverter.cs | 27 +++++----- .../WixToolsetTest.Converters/ConverterFixture.cs | 8 +-- .../WixToolsetTest.Converters/MsiPackageFixture.cs | 58 ++++++++++++++++++++++ .../RemotePayloadFixture.cs | 4 +- 4 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 src/wix/test/WixToolsetTest.Converters/MsiPackageFixture.cs diff --git a/src/wix/WixToolset.Converters/WixConverter.cs b/src/wix/WixToolset.Converters/WixConverter.cs index 4e591f8a..f3675ecc 100644 --- a/src/wix/WixToolset.Converters/WixConverter.cs +++ b/src/wix/WixToolset.Converters/WixConverter.cs @@ -307,7 +307,7 @@ namespace WixToolset.Converters { WixConverter.OldProvidesElementName, this.ConvertProvidesElement }, { WixConverter.OldRequiresElementName, this.ConvertRequiresElement }, { WixConverter.OldRequiresRefElementName, this.ConvertRequiresRefElement }, - { WixConverter.PayloadElementName, this.ConvertSuppressSignatureValidation }, + { WixConverter.PayloadElementName, this.ConvertSuppressSignatureVerification }, { WixConverter.PermissionExElementName, this.ConvertPermissionExElement }, { WixConverter.ProductElementName, this.ConvertProductElement }, { WixConverter.ProgressTextElementName, this.ConvertProgressTextElement }, @@ -870,7 +870,7 @@ namespace WixToolset.Converters private void ConvertCatalogElement(XElement element) { - if (this.OnInformation(ConverterTestType.BundleSignatureValidationObsolete, element, "The Catalog element is obsolete. Signature validation is no longer supported. The element will be removed.")) + if (this.OnInformation(ConverterTestType.SuppressSignatureVerificationObsolete, element, "The Catalog element is obsolete. The element will be removed.")) { element.Remove(); } @@ -1267,7 +1267,7 @@ namespace WixToolset.Converters private void ConvertExePackageElement(XElement element) { - this.ConvertSuppressSignatureValidation(element); + this.ConvertSuppressSignatureVerification(element); this.UpdatePackageCacheAttribute(element); @@ -1350,7 +1350,7 @@ namespace WixToolset.Converters private void ConvertMsuPackageElement(XElement element) { - this.ConvertSuppressSignatureValidation(element); + this.ConvertSuppressSignatureVerification(element); this.UpdatePackageCacheAttribute(element); @@ -1778,9 +1778,6 @@ namespace WixToolset.Converters } this.OnInformation(ConverterTestType.BurnHashAlgorithmChanged, element, "The hash algorithm for bundles changed from SHA1 to SHA512."); - - this.RemoveAttributeIfPresent(element, "CertificatePublicKey", ConverterTestType.BundleSignatureValidationObsolete, "The {0} element contains obsolete '{1}' attribute. Signature validation is no longer supported. The attribute will be removed."); - this.RemoveAttributeIfPresent(element, "CertificateThumbprint", ConverterTestType.BundleSignatureValidationObsolete, "The {0} element contains obsolete '{1}' attribute. Signature validation is no longer supported. The attribute will be removed."); } private void ConvertRegistrySearchElement(XElement element) @@ -1870,14 +1867,14 @@ namespace WixToolset.Converters } } - private void ConvertSuppressSignatureValidation(XElement element) + private void ConvertSuppressSignatureVerification(XElement element) { - var suppressSignatureValidation = element.Attribute("SuppressSignatureValidation"); + var suppressSignatureVerification = element.Attribute("SuppressSignatureVerification"); - if (null != suppressSignatureValidation - && this.OnInformation(ConverterTestType.BundleSignatureValidationObsolete, element, "The chain package element contains obsolete '{0}' attribute. Signature validation is no longer supported. The attribute will be removed.", suppressSignatureValidation.Name)) + if (null != suppressSignatureVerification + && this.OnInformation(ConverterTestType.SuppressSignatureVerificationObsolete, element, "The chain package element contains obsolete '{0}' attribute. The attribute will be removed.", suppressSignatureVerification.Name)) { - suppressSignatureValidation.Remove(); + suppressSignatureVerification.Remove(); } } @@ -1913,7 +1910,7 @@ namespace WixToolset.Converters private void ConvertWindowsInstallerPackageElement(XElement element) { - this.ConvertSuppressSignatureValidation(element); + this.ConvertSuppressSignatureVerification(element); this.UpdatePackageCacheAttribute(element); @@ -3045,9 +3042,9 @@ namespace WixToolset.Converters AssignAnonymousFileId, /// - /// SuppressSignatureValidation attribute is obsolete and corresponding functionality removed. + /// SuppressSignatureVerification attribute is obsolete and corresponding functionality removed. /// - BundleSignatureValidationObsolete, + SuppressSignatureVerificationObsolete, /// /// WixCA Binary/@Id has been renamed to UtilCA. diff --git a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs index 1705a1ed..66b9a581 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs @@ -388,11 +388,11 @@ namespace WixToolsetTest.Converters } [Fact] - public void CanConvertSuppressSignatureValidationNo() + public void CanConvertSuppressSignatureVerificationNo() { var parse = String.Join(Environment.NewLine, "", - " ", + " ", ""); var expected = new[] @@ -416,11 +416,11 @@ namespace WixToolsetTest.Converters } [Fact] - public void CanConvertSuppressSignatureValidationYes() + public void CanConvertSuppressSignatureVerificationYes() { var parse = String.Join(Environment.NewLine, "", - " ", + " ", ""); var expected = new[] diff --git a/src/wix/test/WixToolsetTest.Converters/MsiPackageFixture.cs b/src/wix/test/WixToolsetTest.Converters/MsiPackageFixture.cs new file mode 100644 index 00000000..dc9e84c9 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Converters/MsiPackageFixture.cs @@ -0,0 +1,58 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Converters +{ + using System; + using System.Linq; + using System.Xml.Linq; + using WixInternal.TestSupport; + using WixToolset.Converters; + using WixToolsetTest.Converters.Mocks; + using Xunit; + + public class MsiPackageFixture : BaseConverterFixture + { + [Fact] + public void CanRemoveSuppressSignatureVerificationAttributes() + { + var parse = String.Join(Environment.NewLine, + "", + " ", + " ", + " ", + " ", + " ", + " ", + ""); + + var expected = new[] + { + "", + " ", + " ", + " ", + " ", + " ", + " ", + "" + }; + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new MockMessaging(); + var converter = new WixConverter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actualLines = UnformattedDocumentLines(document); + WixAssert.CompareLineByLine(expected, actualLines); + + WixAssert.CompareLineByLine(new[] + { + "[Converted] The chain package element contains obsolete 'SuppressSignatureVerification' attribute. The attribute will be removed. (SuppressSignatureVerificationObsolete)", + }, messaging.Messages.Select(m => m.ToString()).ToArray()); + + Assert.Equal(1, errors); + } + } +} diff --git a/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs b/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs index 3e39e5f3..baf50fdd 100644 --- a/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs @@ -38,7 +38,7 @@ namespace WixToolsetTest.Converters " ", " ", " ", - " ", + " ", " ", " ", " ", @@ -51,7 +51,7 @@ namespace WixToolsetTest.Converters var converter = new WixConverter(messaging, 2, null, null); var errors = converter.ConvertDocument(document); - Assert.Equal(6, errors); + Assert.Equal(4, errors); var actualLines = UnformattedDocumentLines(document); WixAssert.CompareLineByLine(expected, actualLines); -- cgit v1.2.3-55-g6feb