Skip to content

Commit

Permalink
Remove wrong propagation of minKeySize into RSA application certifica…
Browse files Browse the repository at this point in the history
…te creation
  • Loading branch information
mrsuciu committed Jun 17, 2024
1 parent 4bc277f commit b7f3ff8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Libraries/Opc.Ua.Configuration/ApplicationInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -601,7 +600,7 @@ private async Task<bool> CheckCertificateTypeAsync(
if (!DisableCertificateAutoCreation)
{
certificate = await CreateApplicationInstanceCertificateAsync(configuration, id,
minimumKeySize, lifeTimeInMonths, ct).ConfigureAwait(false);
lifeTimeInMonths, ct).ConfigureAwait(false);
}
else
{
Expand Down Expand Up @@ -858,14 +857,12 @@ private static async Task<bool> CheckDomainsInCertificateAsync(
/// </summary>
/// <param name="configuration">The configuration.</param>
/// <param name="id">The certificate identifier.</param>
/// <param name="keySize">Size of the key.</param>
/// <param name="lifeTimeInMonths">The lifetime in months.</param>
/// <param name="ct"></param>
/// <returns>The new certificate</returns>
private static async Task<X509Certificate2> CreateApplicationInstanceCertificateAsync(
ApplicationConfiguration configuration,
CertificateIdentifier id,
ushort keySize,
ushort lifeTimeInMonths,
CancellationToken ct)
{
Expand Down Expand Up @@ -901,7 +898,7 @@ private static async Task<X509Certificate2> CreateApplicationInstanceCertificate
id.CertificateType == ObjectTypeIds.RsaSha256ApplicationCertificateType)
{
id.Certificate = builder
.SetRSAKeySize(keySize)
.SetRSAKeySize(CertificateFactory.DefaultKeySize)
.CreateForRSA();

Utils.LogCertificate("Certificate created for RSA.", id.Certificate);
Expand Down

0 comments on commit b7f3ff8

Please sign in to comment.