Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for null public key in License validation #21

Open
GeertvanHorrik opened this issue May 8, 2015 · 1 comment
Open

Check for null public key in License validation #21

GeertvanHorrik opened this issue May 8, 2015 · 1 comment

Comments

@GeertvanHorrik
Copy link

We had an issue recently due to a configuration (the public key) being null. However, it was a bit weird to find the real issue because we got this:

[ERROR] [Orc.LicenseManager.Services.LicenseValidationService] [1] An error occurred while loading the license | [ArgumentNullException] System.ArgumentNullException: Value cannot be null.
Parameter name: s
   at System.Convert.FromBase64String(String s)
   at Portable.Licensing.License.VerifySignature(String publicKey)
   at Portable.Licensing.Validation.ValidationChainBuilder.<AssertValidLicense>d__1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orc.LicenseManager.Services.LicenseValidationService.ValidateLicense(String license) in c:\CI_WS\Ws\77085\Source\Orc_LicenseManager\src\Orc.LicenseManager.Client\Orc.LicenseManager.Client.Shared\Services\LicenseValidationService.cs:line 72

The real reason it fails is because the public key input is never checked in the license object. I think it would be a good idea to add a null reference check at the beginning of the method, or is this behavior intended?

@dnauck
Copy link
Owner

dnauck commented May 18, 2015

Sure we can check a invalid input. Maybe just return false on validation instead of throwing an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants