Skip to content

Commit

Permalink
Tentative fix for issue Mayyhem#39. Needs additional testing with pro…
Browse files Browse the repository at this point in the history
…vided creds/certs/PXE before merging
  • Loading branch information
Mayyhem committed Nov 10, 2023
1 parent 06ac366 commit b424f82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/MgmtPointMessaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ public static void GetSecretsFromPolicies(string managementPoint, string siteCod

foreach (PolicyAssignment policyAssignment in assignmentReply.ReplyAssignments.PolicyAssignments)
{
GetSecretsFromPolicy(policyAssignment, managementPoint, clientId, encryptionCertificate, outputPath);
GetSecretsFromPolicy(policyAssignment, managementPoint, clientId, encryptionCertificate, signingCertificate, outputPath);
}
}
}
public static async void GetSecretsFromPolicy(PolicyAssignment policyAssignment, string managementPoint, SmsClientId clientId, MessageCertificateX509 encryptionCertificate, string outputPath = null)
public static async void GetSecretsFromPolicy(PolicyAssignment policyAssignment, string managementPoint, SmsClientId clientId, MessageCertificateX509 encryptionCertificate, MessageCertificateX509 signingCertificate, string outputPath = null)
{

// Get secret policies
Expand All @@ -184,7 +184,7 @@ public static async void GetSecretsFromPolicy(PolicyAssignment policyAssignment,
try
{
string policyURL = policyAssignment.Policy.Location.Value.Replace("<mp>", managementPoint);
policyDownloadResponse = SendPolicyDownloadRequest(policyURL, clientId, encryptionCertificate);
policyDownloadResponse = SendPolicyDownloadRequest(policyURL, clientId, signingCertificate);
byte[] policyDownloadResponseBytes = await policyDownloadResponse.Content.ReadAsByteArrayAsync();
Console.WriteLine($"[+] Received encoded response from server for policy {policyAssignment.Policy.Id}");
}
Expand Down Expand Up @@ -760,7 +760,7 @@ public static async void SendPolicyAssignmentRequestWithExplicitData(string mach
policyAssignment.Policy.Location = policyLocation;
}

GetSecretsFromPolicy(policyAssignment, szMPHostname, new SmsClientId(szMediaGUIDPlain), encryptioncertificate);
GetSecretsFromPolicy(policyAssignment, szMPHostname, new SmsClientId(szMediaGUIDPlain), encryptioncertificate, signingCertificate);
}
}
}
Expand Down

0 comments on commit b424f82

Please sign in to comment.