Skip to content

Commit

Permalink
minor optimization: move creation of X509 Subject Summary into catch …
Browse files Browse the repository at this point in the history
…block on MacOS. (#54774)
  • Loading branch information
odhanson authored Jun 26, 2021
1 parent 6cccee5 commit a766647
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,14 @@ private void EnsureCertData()
return;

Debug.Assert(!_certHandle.IsInvalid);
string? subjectSummary = Interop.AppleCrypto.X509GetSubjectSummary(_certHandle);

try
{
_certData = new CertificateData(Interop.AppleCrypto.X509GetRawData(_certHandle));
}
catch (CryptographicException e)
{
string? subjectSummary = Interop.AppleCrypto.X509GetSubjectSummary(_certHandle);
if (subjectSummary is null)
{
throw;
Expand Down

0 comments on commit a766647

Please sign in to comment.