Skip to content

Commit

Permalink
chore: handle hascrosscertificatepair property during collection inst…
Browse files Browse the repository at this point in the history
…ead of ingest
  • Loading branch information
urangel committed Oct 11, 2023
1 parent 9553455 commit 0689b67
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/CommonLib/Processors/LDAPPropertyProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,12 @@ public static Dictionary<string, object> ReadRootCAProperties(ISearchResultEntry
public static Dictionary<string, object> ReadAIACAProperties(ISearchResultEntry entry)
{
var props = GetCommonProps(entry);
props.Add("crosscertificatepair", entry.GetByteArrayProperty(LDAPProperties.CrossCertificatePair));

var crossCertificatePair = entry.GetByteArrayProperty((LDAPProperties.CrossCertificatePair));
var hasCrossCertificatePair = crossCertificatePair.Length > 0;

props.Add("crosscertificatepair", crossCertificatePair);
props.Add("hascrosscertificatepair", hasCrossCertificatePair)

Check failure on line 433 in src/CommonLib/Processors/LDAPPropertyProcessor.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 433 in src/CommonLib/Processors/LDAPPropertyProcessor.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 433 in src/CommonLib/Processors/LDAPPropertyProcessor.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 433 in src/CommonLib/Processors/LDAPPropertyProcessor.cs

View workflow job for this annotation

GitHub Actions / build

; expected

// Certificate
var rawCertificate = entry.GetByteProperty(LDAPProperties.CACertificate);
if (rawCertificate != null)
Expand All @@ -446,10 +450,10 @@ public static Dictionary<string, object> ReadAIACAProperties(ISearchResultEntry
public static Dictionary<string, object> ReadEnterpriseCAProperties(ISearchResultEntry entry)
{
var props = GetCommonProps(entry);
if (entry.GetIntProperty("flags", out var flags)) props.Add("flags", (PKIEnrollmentFlag) flags);
if (entry.GetIntProperty("flags", out var flags)) props.Add("flags", (PKIEnrollmentFlag)flags);
props.Add("caname", entry.GetProperty(LDAPProperties.Name));
props.Add("dnshostname", entry.GetProperty(LDAPProperties.DNSHostName));

// Certificate
var rawCertificate = entry.GetByteProperty(LDAPProperties.CACertificate);
if (rawCertificate != null)
Expand Down Expand Up @@ -721,7 +725,7 @@ public ParsedCertificate(byte[] rawCertificate)
switch (certificateExtension.Oid.Value)
{
case CAExtensionTypes.BasicConstraints:
X509BasicConstraintsExtension ext = (X509BasicConstraintsExtension) extension;
X509BasicConstraintsExtension ext = (X509BasicConstraintsExtension)extension;
HasBasicConstraints = ext.HasPathLengthConstraint;
BasicConstraintPathLength = ext.PathLengthConstraint;
break;
Expand Down

0 comments on commit 0689b67

Please sign in to comment.