Skip to content

Commit

Permalink
(chocolatey#18) Remove licenses that are not used
Browse files Browse the repository at this point in the history
Remove the license types that Chocolatey doesn't use.

This includes Floating and Subscription licenses.
Removes validating with a server (subscription).
Also removes the license reassertion that's caused issues in the past.
  • Loading branch information
corbob committed May 24, 2022
1 parent 0305f02 commit d8bc2e7
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 1,400 deletions.
404 changes: 9 additions & 395 deletions src/Rhino.Licensing/AbstractLicenseValidator.cs

Large diffs are not rendered by default.

49 changes: 0 additions & 49 deletions src/Rhino.Licensing/Discovery/DiscoveryClient.cs

This file was deleted.

170 changes: 0 additions & 170 deletions src/Rhino.Licensing/Discovery/DiscoveryHost.cs

This file was deleted.

49 changes: 0 additions & 49 deletions src/Rhino.Licensing/FloatingLicenseNotAvailableException.cs

This file was deleted.

22 changes: 0 additions & 22 deletions src/Rhino.Licensing/ILicensingService.cs

This file was deleted.

20 changes: 0 additions & 20 deletions src/Rhino.Licensing/ISubscriptionLicensingService.cs

This file was deleted.

18 changes: 0 additions & 18 deletions src/Rhino.Licensing/InvalidationType.cs

This file was deleted.

38 changes: 0 additions & 38 deletions src/Rhino.Licensing/LicenseGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,6 @@ public LicenseGenerator(string privateKey)
this.privateKey = privateKey;
}

/// <summary>
/// Generates a new floating license.
/// </summary>
/// <param name="name">Name of the license holder</param>
/// <param name="publicKey">The public key of the license server</param>
/// <returns>The generated license XML string</returns>
public string GenerateFloatingLicense(string name, string publicKey)
{
using (var rsa = new RSACryptoServiceProvider())
{
RSAKeyExtensions.FromXmlString(rsa,privateKey);
var doc = new XmlDocument();
var license = doc.CreateElement("floating-license");
doc.AppendChild(license);

var publicKeyEl = doc.CreateElement("license-server-public-key");
license.AppendChild(publicKeyEl);
publicKeyEl.InnerText = publicKey;

var nameEl = doc.CreateElement("name");
license.AppendChild(nameEl);
nameEl.InnerText = name;

var signature = GetXmlDigitalSignature(doc, rsa);
doc.FirstChild.AppendChild(doc.ImportNode(signature, true));

var ms = new MemoryStream();
var writer = XmlWriter.Create(ms, new XmlWriterSettings
{
Indent = true,
Encoding = Encoding.UTF8
});
doc.Save(writer);
ms.Position = 0;
return new StreamReader(ms).ReadToEnd();
}
}

/// <summary>
/// Generates a new license with no attributes using SHA1 as the signing algorithm.
/// </summary>
Expand Down
Loading

0 comments on commit d8bc2e7

Please sign in to comment.