aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sec_certs/dataset
diff options
context:
space:
mode:
authorAdam Janovsky2025-01-27 16:11:32 +0100
committerJ08nY2025-02-01 22:57:38 +0100
commitbcbb31e609c1f03f8b66b9e0bc0c27ce9cd7e562 (patch)
tree35ab0ecb0a3c2fad7a62827e9eb51b5ebd2bb284 /src/sec_certs/dataset
parentd0619fa3c71f78455cbcc0220af71f94ac1fef90 (diff)
downloadsec-certs-bcbb31e609c1f03f8b66b9e0bc0c27ce9cd7e562.tar.gz
sec-certs-bcbb31e609c1f03f8b66b9e0bc0c27ce9cd7e562.tar.zst
sec-certs-bcbb31e609c1f03f8b66b9e0bc0c27ce9cd7e562.zip
forbid empty PP links in ProtectionProfile objects
Diffstat (limited to 'src/sec_certs/dataset')
-rw-r--r--src/sec_certs/dataset/protection_profile.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/sec_certs/dataset/protection_profile.py b/src/sec_certs/dataset/protection_profile.py
index 1bb2e3f1..4a938d1c 100644
--- a/src/sec_certs/dataset/protection_profile.py
+++ b/src/sec_certs/dataset/protection_profile.py
@@ -226,16 +226,14 @@ class ProtectionProfileDataset(Dataset[ProtectionProfile], ComplexSerializableTy
return {}
body = list(tables[0].find_all("tr"))[1:]
- try:
- table_certs = {
- x.dgst: x
- for x in [
- ProtectionProfile.from_html_row(row, cert_status, category_string, is_collaborative)
- for row in body
- ]
- }
- except ValueError as e:
- raise ValueError(f"Bad html file: {file.name} ({str(e)})") from e
+ table_certs = {}
+ for row in body:
+ try:
+ pp = ProtectionProfile.from_html_row(row, cert_status, category_string, is_collaborative)
+ table_certs[pp.dgst] = pp
+ except ValueError as e:
+ logger.error(f"Error when creating ProtectionProfile object: {e}")
+
return table_certs
cert_status: Literal["active", "archived"] = "active" if "active" in file.name else "archived"