Skip to content

Commit

Permalink
Check for hardware info
Browse files Browse the repository at this point in the history
  • Loading branch information
iadgovuser59 committed Aug 8, 2024
1 parent 14724ef commit e8e0704
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions HIRS_Provisioner.NET/hirs/src/provisioner/Provisioner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ public void SetDeviceInfoCollector(IHirsDeviceInfoCollector collector) {
public static string FormatCertificatePath(DeviceInfo dv, string certificateDirPath, string certificateFileName) {
StringBuilder sb = new StringBuilder();
sb.Append(certificateDirPath);
if (dv.Hw.HasSystemSerialNumber && !dv.Hw.SystemSerialNumber.Equals(ClassicDeviceInfoCollector.NOT_SPECIFIED)) {
sb.AppendFormat("{0}-", dv.Hw.SystemSerialNumber);
}
if (dv.Hw.HasManufacturer && !dv.Hw.Manufacturer.Equals(ClassicDeviceInfoCollector.NOT_SPECIFIED)) {
sb.AppendFormat("{0}-", dv.Hw.Manufacturer);
if (dv?.Hw != null) {
if (dv.Hw.HasSystemSerialNumber && !dv.Hw.SystemSerialNumber.Equals(ClassicDeviceInfoCollector.NOT_SPECIFIED)) {
sb.AppendFormat("{0}-", dv.Hw.SystemSerialNumber);
}
if (dv.Hw.HasManufacturer && !dv.Hw.Manufacturer.Equals(ClassicDeviceInfoCollector.NOT_SPECIFIED)) {
sb.AppendFormat("{0}-", dv.Hw.Manufacturer);
}
}
sb.Append(certificateFileName);
return sb.ToString();
Expand Down

0 comments on commit e8e0704

Please sign in to comment.