Skip to content

Commit

Permalink
chore: fix more formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Oct 21, 2024
1 parent 23b650b commit 8993bec
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/CommonLib/Processors/LdapPropertyProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ public async Task<UserProperties> ReadUserProperties(IDirectoryObject entry, str
string sSid;
try {
sSid = new SecurityIdentifier(sid, 0).Value;
}
catch {
} catch {
continue;
}

Expand Down Expand Up @@ -401,8 +400,7 @@ public async Task<ComputerProperties> ReadComputerProperties(IDirectoryObject en
string sSid;
try {
sSid = new SecurityIdentifier(sid, 0).Value;
}
catch {
} catch {
continue;
}

Expand Down Expand Up @@ -637,8 +635,7 @@ public Dictionary<string, object> ParseAllProperties(IDirectoryObject entry) {
else
props.Add(property, BestGuessConvert(testString));
}
}
else {
} else {
if (entry.TryGetByteProperty(property, out var testBytes)) {
if (testBytes == null || testBytes.Length == 0) {
continue;
Expand All @@ -649,8 +646,7 @@ public Dictionary<string, object> ParseAllProperties(IDirectoryObject entry) {
var sid = new SecurityIdentifier(testBytes, 0);
props.Add(property, sid.Value);
continue;
}
catch {
} catch {
/* Ignore */
}

Expand All @@ -659,8 +655,7 @@ public Dictionary<string, object> ParseAllProperties(IDirectoryObject entry) {
var guid = new Guid(testBytes);
props.Add(property, guid.ToString());
continue;
}
catch {
} catch {
/* Ignore */
}
}
Expand Down Expand Up @@ -688,8 +683,7 @@ private static string[] ParseCertTemplateApplicationPolicies(string[] applicatio
|| schemaVersion == 2
|| (schemaVersion == 4 && hasUseLegacyProvider)) {
return applicationPolicies;
}
else {
} else {
// Format: "Name`Type`Value`Name`Type`Value`..."
// (https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-crtd/c55ec697-be3f-4117-8316-8895e4399237)
// Return the Value of Name = "msPKI-RA-Application-Policies" entries
Expand Down Expand Up @@ -771,8 +765,7 @@ private static string ConvertNanoDuration(long duration) {
if (duration == long.MinValue) {
return "Forever";
// And if the value is positive, it indicates an error code
}
else if (duration > 0) {
} else if (duration > 0) {
return null;
}

Expand Down Expand Up @@ -852,8 +845,7 @@ private static string ConvertPKIPeriod(byte[] bytes) {
}

return "";
}
catch (Exception) {
} catch (Exception) {
return "Unknown";
}
}
Expand Down Expand Up @@ -910,8 +902,7 @@ public ParsedCertificate(byte[] rawCertificate) {
var temp = new List<string>();
foreach (var cert in chain.ChainElements) temp.Add(cert.Certificate.Thumbprint);
Chain = temp.ToArray();
}
catch (Exception e) {
} catch (Exception e) {
Logging.LogProvider.CreateLogger("ParsedCertificate").LogWarning(e,
"Failed to read certificate chain for certificate {Name} with Algo {Algorithm}", name,
parsedCertificate.SignatureAlgorithm.FriendlyName);
Expand Down

0 comments on commit 8993bec

Please sign in to comment.