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

Json.NET Schema fails on RHEL 9 when registering license #345

Closed
Meddington opened this issue May 16, 2024 · 1 comment
Closed

Json.NET Schema fails on RHEL 9 when registering license #345

Meddington opened this issue May 16, 2024 · 1 comment

Comments

@Meddington
Copy link

Meddington commented May 16, 2024

RedHat Enterprise Linux v9 has removed support for SHA1 signatures. When starting up a program that uses Netonsoft.Json.Schema, the program exceptions in CryptographyHelpers.ValidateData.

This can be worked around by changing the base OS cryptographic settings, but not if the OS is running in FIPS mode. For FIPS mode no workaround has been found yet.

Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:020000AD:rsa routines::invalid key length
   at Interop.Crypto.DecodeSubjectPublicKeyInfo(ReadOnlySpan`1 source, EvpAlgorithmId algorithmId)
   at System.Security.Cryptography.RSAImplementation.RSAOpenSsl.ImportParameters(RSAParameters parameters)
   at Newtonsoft.Json.Schema.Infrastructure.Licensing.CryptographyHelpers.ValidateData(Byte[] data, Byte[] signature)
   at Newtonsoft.Json.Schema.Infrastructure.Licensing.LicenseHelpers.ReadLicenseData(DateTime releaseDate, String licenseBase64, Int32 licenseId)
   at Newtonsoft.Json.Schema.Infrastructure.Licensing.LicenseHelpers.RegisterLicense(String license, DateTime releaseDate)
   at Newtonsoft.Json.Schema.Infrastructure.Licensing.LicenseHelpers.RegisterLicense(String license)
   at Newtonsoft.Json.Schema.License.RegisterLicense(String license)
   at XXXX.XXXX.JsonSchemaInitializer.RegisterNewtonsoftJsonSchemaLicense() in XXXXX/XXXX/Startup.cs:line 318
@JamesNK
Copy link
Owner

JamesNK commented May 29, 2024

Fixed in https://www.nuget.org/packages/Newtonsoft.Json.Schema/4.0.1-beta1

Note: you'll need to reach out to me to get a new key to use with the software. For compatibility, SHA1 and 128bit key is still used by default. A key that uses SHA256 + 256bit key is required to avoid this error.

Sometime in the future, the default for generated keys will change to 256.

@JamesNK JamesNK closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants