Fix SuppressSignatureVerification spelling
Fixes 7358
Rob Mensching committed
Apr 3, 2023 at 23:43 UTC
533b554cd5af6ca64b3ca0d52f16434d9fd734d8
4 files changed
+76
-21
src/wix/WixToolset.Converters/WixConverter.cs
+12
-15
@@ -307,7 +307,7 @@ namespace WixToolset.Converters
307
{ WixConverter.OldProvidesElementName, this.ConvertProvidesElement },
308
{ WixConverter.OldRequiresElementName, this.ConvertRequiresElement },
309
{ WixConverter.OldRequiresRefElementName, this.ConvertRequiresRefElement },
310
- { WixConverter.PayloadElementName, this.ConvertSuppressSignatureValidation },
310
+ { WixConverter.PayloadElementName, this.ConvertSuppressSignatureVerification },
311
{ WixConverter.PermissionExElementName, this.ConvertPermissionExElement },
312
{ WixConverter.ProductElementName, this.ConvertProductElement },
313
{ WixConverter.ProgressTextElementName, this.ConvertProgressTextElement },
@@ -870,7 +870,7 @@ namespace WixToolset.Converters
870
871
private void ConvertCatalogElement(XElement element)
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
{
875
element.Remove();
876
}
@@ -1267,7 +1267,7 @@ namespace WixToolset.Converters
1267
1268
private void ConvertExePackageElement(XElement element)
1269
{
1270
- this.ConvertSuppressSignatureValidation(element);
1270
+ this.ConvertSuppressSignatureVerification(element);
1271
1272
this.UpdatePackageCacheAttribute(element);
1273
@@ -1350,7 +1350,7 @@ namespace WixToolset.Converters
1350
1351
private void ConvertMsuPackageElement(XElement element)
1352
{
1353
- this.ConvertSuppressSignatureValidation(element);
1353
+ this.ConvertSuppressSignatureVerification(element);
1354
1355
this.UpdatePackageCacheAttribute(element);
1356
@@ -1778,9 +1778,6 @@ namespace WixToolset.Converters
1778
}
1779
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.");
1781
}
1782
1783
private void ConvertRegistrySearchElement(XElement element)
@@ -1870,14 +1867,14 @@ namespace WixToolset.Converters
1867
}
1868
}
1869
1873
- private void ConvertSuppressSignatureValidation(XElement element)
1870
+ private void ConvertSuppressSignatureVerification(XElement element)
1871
{
1875
- var suppressSignatureValidation = element.Attribute("SuppressSignatureValidation");
1872
+ var suppressSignatureVerification = element.Attribute("SuppressSignatureVerification");
1873
1877
- if (null != suppressSignatureValidation
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))
1874
+ if (null != suppressSignatureVerification
1875
+ && this.OnInformation(ConverterTestType.SuppressSignatureVerificationObsolete, element, "The chain package element contains obsolete '{0}' attribute. The attribute will be removed.", suppressSignatureVerification.Name))
1876
{
1880
- suppressSignatureValidation.Remove();
1877
+ suppressSignatureVerification.Remove();
1878
}
1879
}
1880
@@ -1913,7 +1910,7 @@ namespace WixToolset.Converters
1910
1911
private void ConvertWindowsInstallerPackageElement(XElement element)
1912
{
1916
- this.ConvertSuppressSignatureValidation(element);
1913
+ this.ConvertSuppressSignatureVerification(element);
1914
1915
this.UpdatePackageCacheAttribute(element);
1916
@@ -3045,9 +3042,9 @@ namespace WixToolset.Converters
3042
AssignAnonymousFileId,
3043
3044
/// <summary>
3048
- /// SuppressSignatureValidation attribute is obsolete and corresponding functionality removed.
3045
+ /// SuppressSignatureVerification attribute is obsolete and corresponding functionality removed.
3046
/// </summary>
3050
- BundleSignatureValidationObsolete,
3047
+ SuppressSignatureVerificationObsolete,
3048
3049
/// <summary>
3050
/// WixCA Binary/@Id has been renamed to UtilCA.
src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs
+4
-4
@@ -388,11 +388,11 @@ namespace WixToolsetTest.Converters
388
}
389
390
[Fact]
391
- public void CanConvertSuppressSignatureValidationNo()
391
+ public void CanConvertSuppressSignatureVerificationNo()
392
{
393
var parse = String.Join(Environment.NewLine,
394
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
395
- " <MsiPackage SuppressSignatureValidation='no' />",
395
+ " <MsiPackage SuppressSignatureVerification='no' />",
396
"</Wix>");
397
398
var expected = new[]
@@ -416,11 +416,11 @@ namespace WixToolsetTest.Converters
416
}
417
418
[Fact]
419
- public void CanConvertSuppressSignatureValidationYes()
419
+ public void CanConvertSuppressSignatureVerificationYes()
420
{
421
var parse = String.Join(Environment.NewLine,
422
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
423
- " <Payload SuppressSignatureValidation='yes' />",
423
+ " <Payload SuppressSignatureVerification='yes' />",
424
"</Wix>");
425
426
var expected = new[]
src/wix/test/WixToolsetTest.Converters/MsiPackageFixture.cs
new
+58
@@ -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
+}
src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs
+2
-2
@@ -38,7 +38,7 @@ namespace WixToolsetTest.Converters
38
" <Fragment>",
39
" <PackageGroup Id=\"exe\">",
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>",
43
" </PackageGroup>",
44
" </Fragment>",
@@ -51,7 +51,7 @@ namespace WixToolsetTest.Converters
51
var converter = new WixConverter(messaging, 2, null, null);
52
53
var errors = converter.ConvertDocument(document);
54
- Assert.Equal(6, errors);
54
+ Assert.Equal(4, errors);
55
56
var actualLines = UnformattedDocumentLines(document);
57
WixAssert.CompareLineByLine(expected, actualLines);