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

Extend ServerConfiguration & GDS Server for ECC #2817

Merged
merged 28 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
88878e6
update ServerConfiguration Node to support multiple Application Certi…
romanett Oct 27, 2024
780c78f
GDS ready for ECC Step1
romanett Nov 3, 2024
434bcf6
fix test
romanett Nov 3, 2024
54846d7
merge origin/master
romanett Dec 8, 2024
11a7a9d
fix build
romanett Dec 8, 2024
25c0837
ensure hash algorithm is set
romanett Dec 18, 2024
3919ad1
Merge remote-tracking branch 'origin/master' into UpdateConfiguration…
romanett Dec 19, 2024
9ee17f3
update configurations to new format, fix minor ecc bugs
romanett Jan 5, 2025
bef0588
implicitly set certificate type of certificate identifier
romanett Jan 5, 2025
3575763
Revert "update configurations to new format, fix minor ecc bugs"
romanett Jan 5, 2025
3e936e3
Allow GDS Certificate Group to have multiple CA Certificates with dif…
romanett Jan 10, 2025
7e112d7
Merge branch 'EccBugs' into UpdateConfigurationNodeManger
romanett Jan 10, 2025
defb165
fix minor bugs
romanett Jan 10, 2025
7f3a93c
Merge remote-tracking branch 'origin/master' into UpdateConfiguration…
romanett Jan 13, 2025
65ee40c
adress review feedback
romanett Jan 13, 2025
29eb65a
fix some issues
romanett Jan 15, 2025
d345c57
fix creation of CA signed ECC Certificates
romanett Jan 15, 2025
3b89b9e
Merge remote-tracking branch 'origin/master' into UpdateConfiguration…
romanett Jan 15, 2025
9812904
Update configurations to new ApplicationCertificateFormat and add ext…
romanett Jan 15, 2025
7650a41
remove brainpool certs from configuration
romanett Jan 16, 2025
e28441c
Merge remote-tracking branch 'origin/master' into UpdateConfiguration…
romanett Jan 17, 2025
90b395f
Generate ECC Certificates in Client Tests
romanett Jan 20, 2025
f09567c
Revert "Generate ECC Certificates in Client Tests"
romanett Jan 20, 2025
10f17db
Merge remote-tracking branch 'origin/master' into UpdateConfiguration…
romanett Jan 20, 2025
e4d25e2
fix crl tests on platforms not supporting ECC
romanett Jan 20, 2025
adeb52d
fix crl test
romanett Jan 20, 2025
ce3c20e
Update READMEs for ECC
romanett Jan 21, 2025
81bb8f3
merge current master
romanett Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Docs/EccProfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,41 @@ Additionally the `<UserTokenPolicies>` section of the configuration file can be
Combining the "old" and the "new" configuration formats is not supported. That means that the `<ApplicationCertificate>` tag cannot be used in the same configuration file with the `<ApplicationCertificates>` tag.


## Configure GDS for use with ECC Certificates

To configure the Global Discovery Server for use with ECC Certificates the configuration needs to be updated.

```xml
<Extensions>
<ua:XmlElement>
<GlobalDiscoveryServerConfiguration xmlns="http://opcfoundation.org/UA/GDS/Configuration.xsd">
<CertificateGroups>
<CertificateGroupConfiguration>
<Id>Default</Id>
<CertificateType>RsaSha256ApplicationCertificateType</CertificateType>
```

Replace the `<CertificateType>` node of the Default CertificateGroupConfiguration with the `<CertificateTypes>` node.
This allows the Certificate Group to have multiple CA Certificates for the different Certificate types.

```xml
<Extensions>
<ua:XmlElement>
<GlobalDiscoveryServerConfiguration xmlns="http://opcfoundation.org/UA/GDS/Configuration.xsd">
<CertificateGroups>
<CertificateGroupConfiguration>
<Id>Default</Id>
<CertificateTypes>
<ua:String>RsaSha256ApplicationCertificateType</ua:String>
<ua:String>EccNistP256ApplicationCertificateType</ua:String>
<ua:String>EccNistP384ApplicationCertificateType</ua:String>
</CertificateTypes>
```

The old Configuration format is still supported but only supports either RSA or ECC Certificates for a single CertificateGroup.
The GDS checks on startup if a valid configuration was supplied.


## Known Limitations

Not all curves are supported by all OS platforms and not all .NET implementations offer cryptographic API support for all curve types.
Expand All @@ -249,4 +284,6 @@ The supported ECC curve types are the following:
- `BrainpoolP384r1` for ECC certificates with Brainpool P384r1 curve





1 change: 1 addition & 0 deletions Docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ UA Core stack related:
* Support for the [TransferSubscriptions](TransferSubscription.md) service set.
* Improved support for [Logging](Logging.md) with `ILogger` and `EventSource`.
* Support for [WellKnownRoles & RoleBasedUserManagement](RoleBasedUserManagement.md).
* Support for [ECC Certificates](Docs/EccProfiles.md).

Reference application related:
* [Reference Client](../Applications/ConsoleReferenceClient/README.md) documentation for configuration of the console reference client using parameters.
Expand Down
40 changes: 7 additions & 33 deletions Libraries/Opc.Ua.Configuration/ApplicationInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -910,44 +910,18 @@ private static async Task<X509Certificate2> CreateApplicationInstanceCertificate
#if !ECC_SUPPORT
throw new ServiceResultException(StatusCodes.BadConfigurationError, "The Ecc certificate type is not supported.");
#else
ECCurve curve = default(ECCurve);
if (id.CertificateType == ObjectTypeIds.EccApplicationCertificateType ||
id.CertificateType == ObjectTypeIds.EccNistP256ApplicationCertificateType)
{
curve = ECCurve.NamedCurves.nistP256;
}
else if (id.CertificateType == ObjectTypeIds.EccNistP384ApplicationCertificateType)
{
curve = ECCurve.NamedCurves.nistP384;
}
else if (id.CertificateType == ObjectTypeIds.EccBrainpoolP256r1ApplicationCertificateType)
{
curve = ECCurve.NamedCurves.brainpoolP256r1;
}
else if (id.CertificateType == ObjectTypeIds.EccBrainpoolP384r1ApplicationCertificateType)
{
curve = ECCurve.NamedCurves.brainpoolP384r1;
}
#if CURVE25519
else if (id.CertificateType == ObjectTypeIds.EccCurve25519ApplicationCertificateType)
{
curve = default(ECCurve);
}
else if (id.CertificateType == ObjectTypeIds.EccCurve448ApplicationCertificateType)
{
curve = default(ECCurve);
}
#endif
else
ECCurve? curve = EccUtils.GetCurveFromCertificateTypeId(id.CertificateType);

if(curve == null)
{
throw new ServiceResultException(StatusCodes.BadConfigurationError, "The ECC certificate type is not supported.");
throw new ServiceResultException(StatusCodes.BadConfigurationError, "The Ecc certificate type is not supported.");
}

id.Certificate = builder
.SetECCurve(curve)
.SetECCurve(curve.Value)
romanett marked this conversation as resolved.
Show resolved Hide resolved
.CreateForECDsa();

Utils.LogCertificate("Certificate created for {0}.", id.Certificate, curve.Oid.FriendlyName);
Utils.LogCertificate("Certificate created for {0}.", id.Certificate, curve.Value.Oid.FriendlyName);
#endif
}

Expand Down Expand Up @@ -1163,7 +1137,7 @@ private static async Task<bool> ApproveMessageAsync(string message, bool silent)
return false;
}
}
#endregion
#endregion

#region Private Fields
private string m_applicationName;
Expand Down
Loading
Loading