1394 {
1395
1396 auto [v4_needs_check, v6_needs_check] = create_validation_map(m_ip_addr_blocks);
1397
1398 if(pos == cert_path.size() - 1) {
1399
1400 auto validate_root_cert_ext = [&](const auto& map) {
1401
1402 return std::any_of(map.begin(), map.end(), [&](const auto& it) {
1403 const auto& [_1, validation_info] = it;
1404 const auto& [needs_checking, _2] = validation_info;
1405 return !needs_checking;
1406 });
1407 };
1408 if(validate_root_cert_ext(v4_needs_check) || validate_root_cert_ext(v6_needs_check)) {
1410 }
1411 return;
1412 }
1413
1414
1415 for(auto cert_path_it = cert_path.begin() + pos + 1; cert_path_it != cert_path.end(); cert_path_it++) {
1417
1418 if(parent_ip == nullptr) {
1420 return;
1421 }
1422 auto [issuer_v4, issuer_v6] = create_validation_map(parent_ip->addr_blocks());
1423
1424 auto validate_against_issuer = [&](auto& subject_map, const auto& issuer_map) {
1425 for(auto map_it = subject_map.begin(); map_it != subject_map.end(); map_it++) {
1426 auto& [afam, validation_info] = *map_it;
1427
1428
1429 if(issuer_map.count(afam) == 0) {
1431 return false;
1432 }
1433
1434 auto& [needs_check, subject_value] = validation_info;
1435 const auto& [issuer_has_value, issuer_value] = issuer_map.at(afam);
1438
1439
1440 if(needs_check && issuer_has_value) {
1441 if(!validate_subject_in_issuer(std::span(*subject_value), std::span(*issuer_value))) {
1443 return false;
1444 }
1445 needs_check = false;
1446 }
1447 }
1448 return true;
1449 };
1450
1451 if(!validate_against_issuer(v4_needs_check, issuer_v4) || !validate_against_issuer(v6_needs_check, issuer_v6)) {
1452 return;
1453 }
1454
1455 auto validate_no_checks_left = [&](const auto& map) {
1456
1457
1458 return std::all_of(map.begin(), map.end(), [&](const auto& it) {
1459 const auto& [_1, validation_info] = it;
1460 const auto& [needs_checking, _2] = validation_info;
1461 return !needs_checking;
1462 });
1463 };
1464
1465 if(validate_no_checks_left(v4_needs_check) && validate_no_checks_left(v6_needs_check)) {
1466
1467 return;
1468 }
1469 }
1470}
#define BOTAN_ASSERT_NOMSG(expr)
IPAddressBlocks()=default