Find the related zones within the certificate
(cert, zones)
| 312 | |
| 313 | |
| 314 | def check_zone_relevancy(cert, zones): |
| 315 | """ |
| 316 | Find the related zones within the certificate |
| 317 | """ |
| 318 | cert_zones = [] |
| 319 | |
| 320 | if "subject_common_names" in cert: |
| 321 | for cn in cert["subject_common_names"]: |
| 322 | for zone in zones: |
| 323 | if cn == zone or cn.endswith("." + zone): |
| 324 | if zone not in cert_zones: |
| 325 | cert_zones.append(zone) |
| 326 | |
| 327 | if "subject_dns_names" in cert: |
| 328 | for cn in cert["subject_dns_names"]: |
| 329 | for zone in zones: |
| 330 | if cn == zone or cn.endswith("." + zone): |
| 331 | if zone not in cert_zones: |
| 332 | cert_zones.append(zone) |
| 333 | |
| 334 | return cert_zones |
| 335 | |
| 336 | |
| 337 | def insert_certificate(cert, source, ct_collection, cert_zones): |