| 1491 | } |
| 1492 | |
| 1493 | void SSU2Server::HandleIntroducersUpdateTimer (const boost::system::error_code& ecode, bool v4) |
| 1494 | { |
| 1495 | if (ecode != boost::asio::error::operation_aborted) |
| 1496 | { |
| 1497 | // timeout expired |
| 1498 | if (v4) |
| 1499 | { |
| 1500 | if (i2p::context.GetTesting ()) |
| 1501 | { |
| 1502 | // we still don't know if we need introducers |
| 1503 | ScheduleIntroducersUpdateTimer (); |
| 1504 | return; |
| 1505 | } |
| 1506 | if (i2p::context.GetStatus () != eRouterStatusFirewalled) |
| 1507 | { |
| 1508 | // we don't need introducers |
| 1509 | i2p::context.ClearSSU2Introducers (true); |
| 1510 | m_Introducers.clear (); |
| 1511 | return; |
| 1512 | } |
| 1513 | // we are firewalled |
| 1514 | auto addr = i2p::context.GetRouterInfo ().GetSSU2V4Address (); |
| 1515 | if (addr && addr->ssu && addr->ssu->introducers.empty ()) |
| 1516 | i2p::context.SetUnreachable (true, false); // v4 |
| 1517 | |
| 1518 | UpdateIntroducers (true); |
| 1519 | ScheduleIntroducersUpdateTimer (); |
| 1520 | } |
| 1521 | else |
| 1522 | { |
| 1523 | if (i2p::context.GetTestingV6 ()) |
| 1524 | { |
| 1525 | // we still don't know if we need introducers |
| 1526 | ScheduleIntroducersUpdateTimerV6 (); |
| 1527 | return; |
| 1528 | } |
| 1529 | if (i2p::context.GetStatusV6 () != eRouterStatusFirewalled) |
| 1530 | { |
| 1531 | // we don't need introducers |
| 1532 | i2p::context.ClearSSU2Introducers (false); |
| 1533 | m_IntroducersV6.clear (); |
| 1534 | return; |
| 1535 | } |
| 1536 | // we are firewalled |
| 1537 | auto addr = i2p::context.GetRouterInfo ().GetSSU2V6Address (); |
| 1538 | if (addr && addr->ssu && addr->ssu->introducers.empty ()) |
| 1539 | i2p::context.SetUnreachable (false, true); // v6 |
| 1540 | |
| 1541 | UpdateIntroducers (false); |
| 1542 | ScheduleIntroducersUpdateTimerV6 (); |
| 1543 | } |
| 1544 | } |
| 1545 | } |
| 1546 | |
| 1547 | bool SSU2Server::AEADChaCha20Poly1305Encrypt (const uint8_t * msg, size_t msgLen, |
| 1548 | const uint8_t * ad, size_t adLen, const uint8_t * key, const uint8_t * nonce, uint8_t * buf, size_t len) |
nothing calls this directly
no test coverage detected