diff options
author | Rob Mensching <rob@firegiant.com> | 2023-04-03 23:43:00 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2023-04-04 15:07:56 -0700 |
commit | 533b554cd5af6ca64b3ca0d52f16434d9fd734d8 (patch) | |
tree | 5910bf90ea0dab49c9a99bf4156a1f8857636882 | |
parent | 124ca82017417b21e0dafea0c47d11a363f4fcb3 (diff) | |
download | wix-533b554cd5af6ca64b3ca0d52f16434d9fd734d8.tar.gz wix-533b554cd5af6ca64b3ca0d52f16434d9fd734d8.tar.bz2 wix-533b554cd5af6ca64b3ca0d52f16434d9fd734d8.zip |
Fix SuppressSignatureVerification spelling
Fixes 7358
4 files changed, 76 insertions, 21 deletions
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 | |||
307 | { WixConverter.OldProvidesElementName, this.ConvertProvidesElement }, | 307 | { WixConverter.OldProvidesElementName, this.ConvertProvidesElement }, |
308 | { WixConverter.OldRequiresElementName, this.ConvertRequiresElement }, | 308 | { WixConverter.OldRequiresElementName, this.ConvertRequiresElement }, |
309 | { WixConverter.OldRequiresRefElementName, this.ConvertRequiresRefElement }, | 309 | { WixConverter.OldRequiresRefElementName, this.ConvertRequiresRefElement }, |
310 | { WixConverter.PayloadElementName, this.ConvertSuppressSignatureValidation }, | 310 | { WixConverter.PayloadElementName, this.ConvertSuppressSignatureVerification }, |
311 | { WixConverter.PermissionExElementName, this.ConvertPermissionExElement }, | 311 | { WixConverter.PermissionExElementName, this.ConvertPermissionExElement }, |
312 | { WixConverter.ProductElementName, this.ConvertProductElement }, | 312 | { WixConverter.ProductElementName, this.ConvertProductElement }, |
313 | { WixConverter.ProgressTextElementName, this.ConvertProgressTextElement }, | 313 | { WixConverter.ProgressTextElementName, this.ConvertProgressTextElement }, |
@@ -870,7 +870,7 @@ namespace WixToolset.Converters | |||
870 | 870 | ||
871 | private void ConvertCatalogElement(XElement element) | 871 | private void ConvertCatalogElement(XElement element) |
872 | { | 872 | { |
873 | if (this.OnInformation(ConverterTestType.BundleSignatureValidationObsolete, element, "The Catalog element is obsolete. Signature validation is no longer supported. The element will be removed.")) | 873 | if (this.OnInformation(ConverterTestType.SuppressSignatureVerificationObsolete, element, "The Catalog element is obsolete. The element will be removed.")) |
874 | { | 874 | { |
875 | element.Remove(); | 875 | element.Remove(); |
876 | } | 876 | } |
@@ -1267,7 +1267,7 @@ namespace WixToolset.Converters | |||
1267 | 1267 | ||
1268 | private void ConvertExePackageElement(XElement element) | 1268 | private void ConvertExePackageElement(XElement element) |
1269 | { | 1269 | { |
1270 | this.ConvertSuppressSignatureValidation(element); | 1270 | this.ConvertSuppressSignatureVerification(element); |
1271 | 1271 | ||
1272 | this.UpdatePackageCacheAttribute(element); | 1272 | this.UpdatePackageCacheAttribute(element); |
1273 | 1273 | ||
@@ -1350,7 +1350,7 @@ namespace WixToolset.Converters | |||
1350 | 1350 | ||
1351 | private void ConvertMsuPackageElement(XElement element) | 1351 | private void ConvertMsuPackageElement(XElement element) |
1352 | { | 1352 | { |
1353 | this.ConvertSuppressSignatureValidation(element); | 1353 | this.ConvertSuppressSignatureVerification(element); |
1354 | 1354 | ||
1355 | this.UpdatePackageCacheAttribute(element); | 1355 | this.UpdatePackageCacheAttribute(element); |
1356 | 1356 | ||
@@ -1778,9 +1778,6 @@ namespace WixToolset.Converters | |||
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | this.OnInformation(ConverterTestType.BurnHashAlgorithmChanged, element, "The hash algorithm for bundles changed from SHA1 to SHA512."); | 1780 | this.OnInformation(ConverterTestType.BurnHashAlgorithmChanged, element, "The hash algorithm for bundles changed from SHA1 to SHA512."); |
1781 | |||
1782 | this.RemoveAttributeIfPresent(element, "CertificatePublicKey", ConverterTestType.BundleSignatureValidationObsolete, "The {0} element contains obsolete '{1}' attribute. Signature validation is no longer supported. The attribute will be removed."); | ||
1783 | this.RemoveAttributeIfPresent(element, "CertificateThumbprint", ConverterTestType.BundleSignatureValidationObsolete, "The {0} element contains obsolete '{1}' attribute. Signature validation is no longer supported. The attribute will be removed."); | ||
1784 | } | 1781 | } |
1785 | 1782 | ||
1786 | private void ConvertRegistrySearchElement(XElement element) | 1783 | private void ConvertRegistrySearchElement(XElement element) |
@@ -1870,14 +1867,14 @@ namespace WixToolset.Converters | |||
1870 | } | 1867 | } |
1871 | } | 1868 | } |
1872 | 1869 | ||
1873 | private void ConvertSuppressSignatureValidation(XElement element) | 1870 | private void ConvertSuppressSignatureVerification(XElement element) |
1874 | { | 1871 | { |
1875 | var suppressSignatureValidation = element.Attribute("SuppressSignatureValidation"); | 1872 | var suppressSignatureVerification = element.Attribute("SuppressSignatureVerification"); |
1876 | 1873 | ||
1877 | if (null != suppressSignatureValidation | 1874 | if (null != suppressSignatureVerification |
1878 | && 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)) | 1875 | && this.OnInformation(ConverterTestType.SuppressSignatureVerificationObsolete, element, "The chain package element contains obsolete '{0}' attribute. The attribute will be removed.", suppressSignatureVerification.Name)) |
1879 | { | 1876 | { |
1880 | suppressSignatureValidation.Remove(); | 1877 | suppressSignatureVerification.Remove(); |
1881 | } | 1878 | } |
1882 | } | 1879 | } |
1883 | 1880 | ||
@@ -1913,7 +1910,7 @@ namespace WixToolset.Converters | |||
1913 | 1910 | ||
1914 | private void ConvertWindowsInstallerPackageElement(XElement element) | 1911 | private void ConvertWindowsInstallerPackageElement(XElement element) |
1915 | { | 1912 | { |
1916 | this.ConvertSuppressSignatureValidation(element); | 1913 | this.ConvertSuppressSignatureVerification(element); |
1917 | 1914 | ||
1918 | this.UpdatePackageCacheAttribute(element); | 1915 | this.UpdatePackageCacheAttribute(element); |
1919 | 1916 | ||
@@ -3045,9 +3042,9 @@ namespace WixToolset.Converters | |||
3045 | AssignAnonymousFileId, | 3042 | AssignAnonymousFileId, |
3046 | 3043 | ||
3047 | /// <summary> | 3044 | /// <summary> |
3048 | /// SuppressSignatureValidation attribute is obsolete and corresponding functionality removed. | 3045 | /// SuppressSignatureVerification attribute is obsolete and corresponding functionality removed. |
3049 | /// </summary> | 3046 | /// </summary> |
3050 | BundleSignatureValidationObsolete, | 3047 | SuppressSignatureVerificationObsolete, |
3051 | 3048 | ||
3052 | /// <summary> | 3049 | /// <summary> |
3053 | /// WixCA Binary/@Id has been renamed to UtilCA. | 3050 | /// 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 | |||
388 | } | 388 | } |
389 | 389 | ||
390 | [Fact] | 390 | [Fact] |
391 | public void CanConvertSuppressSignatureValidationNo() | 391 | public void CanConvertSuppressSignatureVerificationNo() |
392 | { | 392 | { |
393 | var parse = String.Join(Environment.NewLine, | 393 | var parse = String.Join(Environment.NewLine, |
394 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | 394 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", |
395 | " <MsiPackage SuppressSignatureValidation='no' />", | 395 | " <MsiPackage SuppressSignatureVerification='no' />", |
396 | "</Wix>"); | 396 | "</Wix>"); |
397 | 397 | ||
398 | var expected = new[] | 398 | var expected = new[] |
@@ -416,11 +416,11 @@ namespace WixToolsetTest.Converters | |||
416 | } | 416 | } |
417 | 417 | ||
418 | [Fact] | 418 | [Fact] |
419 | public void CanConvertSuppressSignatureValidationYes() | 419 | public void CanConvertSuppressSignatureVerificationYes() |
420 | { | 420 | { |
421 | var parse = String.Join(Environment.NewLine, | 421 | var parse = String.Join(Environment.NewLine, |
422 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | 422 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", |
423 | " <Payload SuppressSignatureValidation='yes' />", | 423 | " <Payload SuppressSignatureVerification='yes' />", |
424 | "</Wix>"); | 424 | "</Wix>"); |
425 | 425 | ||
426 | var expected = new[] | 426 | 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 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolsetTest.Converters | ||
4 | { | ||
5 | using System; | ||
6 | using System.Linq; | ||
7 | using System.Xml.Linq; | ||
8 | using WixInternal.TestSupport; | ||
9 | using WixToolset.Converters; | ||
10 | using WixToolsetTest.Converters.Mocks; | ||
11 | using Xunit; | ||
12 | |||
13 | public class MsiPackageFixture : BaseConverterFixture | ||
14 | { | ||
15 | [Fact] | ||
16 | public void CanRemoveSuppressSignatureVerificationAttributes() | ||
17 | { | ||
18 | var parse = String.Join(Environment.NewLine, | ||
19 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
20 | " <Fragment>", | ||
21 | " <PackageGroup Id='msi'>", | ||
22 | " <MsiPackage Id='MsiPackage1' SuppressSignatureVerification='yes'>", | ||
23 | " </MsiPackage>", | ||
24 | " </PackageGroup>", | ||
25 | " </Fragment>", | ||
26 | "</Wix>"); | ||
27 | |||
28 | var expected = new[] | ||
29 | { | ||
30 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
31 | " <Fragment>", | ||
32 | " <PackageGroup Id=\"msi\">", | ||
33 | " <MsiPackage Id=\"MsiPackage1\">", | ||
34 | " </MsiPackage>", | ||
35 | " </PackageGroup>", | ||
36 | " </Fragment>", | ||
37 | "</Wix>" | ||
38 | }; | ||
39 | |||
40 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
41 | |||
42 | var messaging = new MockMessaging(); | ||
43 | var converter = new WixConverter(messaging, 2, null, null); | ||
44 | |||
45 | var errors = converter.ConvertDocument(document); | ||
46 | |||
47 | var actualLines = UnformattedDocumentLines(document); | ||
48 | WixAssert.CompareLineByLine(expected, actualLines); | ||
49 | |||
50 | WixAssert.CompareLineByLine(new[] | ||
51 | { | ||
52 | "[Converted] The chain package element contains obsolete 'SuppressSignatureVerification' attribute. The attribute will be removed. (SuppressSignatureVerificationObsolete)", | ||
53 | }, messaging.Messages.Select(m => m.ToString()).ToArray()); | ||
54 | |||
55 | Assert.Equal(1, errors); | ||
56 | } | ||
57 | } | ||
58 | } | ||
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 | |||
38 | " <Fragment>", | 38 | " <Fragment>", |
39 | " <PackageGroup Id=\"exe\">", | 39 | " <PackageGroup Id=\"exe\">", |
40 | " <ExePackage>", | 40 | " <ExePackage>", |
41 | " <ExePackagePayload Description=\"Microsoft ASP.NET Core 3.1.8 - Shared Framework\" Hash=\"61DC9EAA0C8968E48E13C5913ED202A2F8F94DBA\" ProductName=\"Microsoft ASP.NET Core 3.1.8 - Shared Framework\" Size=\"7841880\" Version=\"3.1.8.20421\" Name=\"example.exe\" DownloadUrl=\"example.com\" />", | 41 | " <ExePackagePayload Description=\"Microsoft ASP.NET Core 3.1.8 - Shared Framework\" Hash=\"61DC9EAA0C8968E48E13C5913ED202A2F8F94DBA\" CertificatePublicKey=\"3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18\" CertificateThumbprint=\"2485A7AFA98E178CB8F30C9838346B514AEA4769\" ProductName=\"Microsoft ASP.NET Core 3.1.8 - Shared Framework\" Size=\"7841880\" Version=\"3.1.8.20421\" Name=\"example.exe\" DownloadUrl=\"example.com\" />", |
42 | " </ExePackage>", | 42 | " </ExePackage>", |
43 | " </PackageGroup>", | 43 | " </PackageGroup>", |
44 | " </Fragment>", | 44 | " </Fragment>", |
@@ -51,7 +51,7 @@ namespace WixToolsetTest.Converters | |||
51 | var converter = new WixConverter(messaging, 2, null, null); | 51 | var converter = new WixConverter(messaging, 2, null, null); |
52 | 52 | ||
53 | var errors = converter.ConvertDocument(document); | 53 | var errors = converter.ConvertDocument(document); |
54 | Assert.Equal(6, errors); | 54 | Assert.Equal(4, errors); |
55 | 55 | ||
56 | var actualLines = UnformattedDocumentLines(document); | 56 | var actualLines = UnformattedDocumentLines(document); |
57 | WixAssert.CompareLineByLine(expected, actualLines); | 57 | WixAssert.CompareLineByLine(expected, actualLines); |