Commit 04f60332 authored by jan.koester's avatar jan.koester
Browse files

test

parent aa4e3251
Loading
Loading
Loading
Loading
Loading
+6 −3
Changes for plugin/radius/radiusd.cpp: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -124,7 +124,8 @@ namespace {
    /* run the server handshake as far as the pushed bytes allow and
     * collect what it queued for the peer */
    void driveTls(netplus::tls &t, Bytes &out) {
        for (int i = 0; i < 8; ++i) {
        for (int i = 0; i < 16; ++i) {
            auto before = t.hs_state;
            try {
                t.handshake_after_accept();
            } catch (netplus::NetException &e) {
@@ -142,7 +143,9 @@ namespace {
                t.send_queue.pop_front();
                got = true;
            }
            if (t.getHandshakeDone() || !got) break;
            /* some states return after a step without output: go on
             * while anything moves */
            if (t.getHandshakeDone() || (!got && t.hs_state == before)) break;
        }
    }

@@ -758,7 +761,7 @@ Bytes RadiusServer::eapTls(const Packet &rq, const radius::Nas &nas, Session &s,
            if (!readApp(t, plain)) return eapDone(rq, nas, s, false, "bad TLS record");
            if (out.empty() && !plain.empty()) return tunnel(rq, nas, s, plain);
        }
        if (out.empty()) return eapDone(rq, nas, s, false, "TLS handshake stalled");
        if (out.empty()) return eapDone(rq, nas, s, false, "TLS handshake stalled in state " + std::to_string(int(t.hs_state)));
        s.out = std::move(out);
        s.outOff = 0;
        return nextFragment(rq, nas, s);