Skip to content

Commit

Permalink
GDS Push Client Fix: Load TrustList before certificate exchange (#596)
Browse files Browse the repository at this point in the history
When performing a GDS Push the specs states (7.7 Push Management Workflow) to first update the Trustlist and then update the certificate of the server, with this change the GDS Client now follows this behaviour.
  • Loading branch information
romanett authored Jul 2, 2024
1 parent d3db3a1 commit 4a676cb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Samples/GDS/Client/Controls/ApplicationCertificateControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ private void RequestNewCertificatePushMode(object sender, EventArgs e)
{
try
{
NodeId trustListId = m_gds.GetTrustList(m_application.ApplicationId, NodeId.Null);
var trustList = m_gds.ReadTrustList(trustListId);
bool applyChanges = m_server.UpdateTrustList(trustList);

byte[] unusedNonce = new byte[0];
byte[] certificateRequest = m_server.CreateSigningRequest(
NodeId.Null,
Expand All @@ -195,6 +199,18 @@ private void RequestNewCertificatePushMode(object sender, EventArgs e)
NodeId.Null,
certificateRequest);

if (applyChanges)
{
MessageBox.Show(
Parent,
"The updated Trust List was loaded however, the apply changes command must be sent before the server will update its Trust List.",
Parent.Text,
MessageBoxButtons.OK,
MessageBoxIcon.Information);

ApplyChangesButton.Enabled = true;
}

m_application.CertificateRequestId = requestId.ToString();
CertificateRequestTimer.Enabled = true;
RequestProgressLabel.Visible = true;
Expand Down

0 comments on commit 4a676cb

Please sign in to comment.