-
Notifications
You must be signed in to change notification settings - Fork 955
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
Add support for ECC profiles #2398
Conversation
CertificateIdentifierCollection applicationCertificates, string pkiRoot = null, string rejectedRoot = null )
…plicationCertificateType
code review discussions for follow up
|
VerifySequenceNumber takes policy into account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments for first 17 changed files
@@ -46,6 +79,7 @@ | |||
<RejectSHA1SignedCertificates>true</RejectSHA1SignedCertificates> | |||
<RejectUnknownRevocationStatus>true</RejectUnknownRevocationStatus> | |||
<MinimumCertificateKeySize>2048</MinimumCertificateKeySize> | |||
<MinimumECCertificateKeySize>256</MinimumECCertificateKeySize> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn`t this obosolete?
Applications/ConsoleReferenceServer/Quickstarts.ReferenceServer.Config.xml
Outdated
Show resolved
Hide resolved
/// </summary> | ||
public async Task DeleteApplicationInstanceCertificate(CancellationToken ct = default) | ||
public async Task DeleteApplicationInstanceCertificate(string[] profileIds = null, CancellationToken ct = default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I oppose extending the interface before supporting only deleting certain profiles
throw new ServiceResultException(StatusCodes.BadConfigurationError, "The Ecc certificate type is not supported."); | ||
#else | ||
ECCurve curve = default(ECCurve); | ||
if (id.CertificateType == ObjectTypeIds.EccApplicationCertificateType || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code should live in a static function where it is globally accessible
Libraries/Opc.Ua.Security.Certificates/X509Certificate/X509PfxUtils.cs
Outdated
Show resolved
Hide resolved
|
||
/// <summary> | ||
/// TODO: Holds the application certificates but should be generated and the Opc.Ua.Security namespace automatically | ||
/// TODO: Should replace ApplicationCertificateField in the generated Opc.Ua.Security.SecuredApplication class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed before merging?
/// </summary> | ||
/// <param name="certificate"></param> | ||
/// <returns></returns> | ||
public static ECDsa GetPublicKey(X509Certificate2 certificate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt this function also present as non ecc specific variants in another class, if yes i think we can remove it in EccUtils?
@@ -738,6 +972,12 @@ public Task<X509Certificate2> LoadPrivateKey(string thumbprint, string subjectNa | |||
return Task.FromResult<X509Certificate2>(null); | |||
} | |||
|
|||
/// <inheritdoc/> | |||
public Task<X509Certificate2> LoadPrivateKey(string thumbprint, string subjectName, NodeId certificateType, string password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why return always null?
…OPCFoundation#2798) The server under test has a extension object with a complex type. Type id = {nsu=http://opcfoundation.org/UA/Machinery/Result/;i=5008}. This contains something with a variant array that is null though (-1). SetProperty should support setting a Array that is null. Therefore, test for null collection (case when length was encoded as -1) before dereferencing ahead of the ToArrray() conversion to Array.
<ServerSecurityPolicy> | ||
<SecurityMode>Sign_2</SecurityMode> | ||
<SecurityPolicyUri></SecurityPolicyUri> | ||
</ServerSecurityPolicy> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the default policies populated as per available ECC certificates?
<ua:TokenType>UserName_1</ua:TokenType> | ||
<!-- passwords must be encrypted - this specifies what algorithm to use --> | ||
<!-- if no algorithm is specified, the active security policy is used --> | ||
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256</ua:SecurityPolicyUri> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this now a n invalid configuration if the ECC cert is used?
Proposed changes
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply. You can also fill these out after creating the PR.Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments