Skip to content

Commit

Permalink
better handling of sync records with no serial
Browse files Browse the repository at this point in the history
  • Loading branch information
dgaley committed Sep 12, 2024
1 parent fb85f34 commit e0dfda4
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions sectigo-scm-caplugin/SectigoCAPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,22 +511,23 @@ public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockin
}
}

//are we syncing a reissued cert?
//Reissued certs keep the same ID, but may have different data and cause index errors on sync
//Removed reissued certs from enrollment, but may be some stragglers for legacy installs
int syncReqId = 0;
if (dbCertId.Contains('-'))
{
syncReqId = int.Parse(dbCertId.Split('-')[0]);
}
else
{
syncReqId = int.Parse(dbCertId);
}

int syncReqId = 0;
string certData = string.Empty;
if (!string.IsNullOrEmpty(dbCertId))
{
//are we syncing a reissued cert?
//Reissued certs keep the same ID, but may have different data and cause index errors on sync
//Removed reissued certs from enrollment, but may be some stragglers for legacy installs
if (dbCertId.Contains('-'))
{
syncReqId = int.Parse(dbCertId.Split('-')[0]);
}
else
{
syncReqId = int.Parse(dbCertId);
}

//we found an existing cert from the DB by serial number.
//This should already be in the DB so no need to sync again unless status changes or
//admin has forced a complete sync
Expand Down

0 comments on commit e0dfda4

Please sign in to comment.