Repository navigation
DNS server for callers, shared ports by name, and the BBS's own CA - #56
Merged
Merged
Conversation
… name [dns] answers the old services' login names (MSN Messenger and Passport, AIM/ICQ, AOL, Yahoo! Messenger, MSN Classic, CompuServe) with the BBS's own address, for the front ends set up here, so clients find the BBS without hosts-file edits. Every other name is resolved through the host's DNS servers (resolv.conf, or systemd-resolved's own list) or a sysop's primary and backup, cached by TTL (negative answers by SOA), with recursion limited to private networks and a per-address UDP rate limit. Since those names all lead to one address, MSN's Passport, Yahoo!'s login and AIM's TLS can now share port 443 (and the web halves port 80): internal/vhost takes the connections and routes each by SNI, then Host, then path, with non-HTTP TLS (OSCAR, SSL 2.0 hellos) going to AIM. The chat front ends' ports and DNS's are bound as root before dropping privileges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo
A front end whose HTTPS (TLS) server is on an IP of its own, with a self-signed certificate of its own, now has its names answered with that IP: taken from its https_address (or [oscar] tls_address, or address), or set as [dns] <service>_answer (an IPv4 and an IPv6 address at most). One port on every address for one front end and on an IP of its own for another can't both bind, so that mix is refused at check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo
With the chat's HTTPS services each on an IP of their own, a port on every address for another can't be listened on beside them. The editor now refuses such an edit at once (the old value put back, the reason shown) instead of only at save. A file already mixed can still be put right an edit at a time. The DNS server joins Internet services. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo
tls_cert = ca ([msn], [ymsg], [oscar]) and cert_file = ca ([gemini]) have the BBS's CA sign the server's certificate for the names its clients ask for: bbs serve makes the CA if there is none, signs at start and looks daily, keeping keys across renewals (Gemini's good as long as the CA, as its clients pin). RSA 2048 throughout; bbs ca init -sha1 for Windows before XP SP3. bbs ca issue signs a certificate for a TLS proxy; bbs ca package (and serve, into ca/install-ca.zip) writes what puts the CA on callers' machines: the .cer, an .inf and .reg writing the machine's trusted roots (Windows 95 on), remove-ca.reg, an install .bat (certutil), a macOS/iOS .mobileconfig, the PEM and a README with the fingerprint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo
…others for programs beside it The root (ca/ca.crt), the one callers install, now signs only sub-CAs (pathlen 1). The services sub-CA signs tls_cert = ca servers' certificates; bbs ca subca NAME makes another (proxy, for a TLS proxy such as WebOne's port) with its own key. Leaves carry their sub-CA's certificate after them. bbs ca issue takes -ca NAME (default services). A root from before, which could sign no sub-CAs, is refused with how to replace it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo
Collaborator
Author
|
CI Root cause, now fixed in this PR (a346bfc):
Verification: under the same load ( Generated by Claude Code |
… it answers Sync and Follow_Up come on two sockets, each read by its own goroutine, so on a busy machine the Follow_Up was handled first, dropped as unknown, and no two-step sync ever measured (TestPTP failing in CI with "no measurements"; on one CPU under load, every time). A Follow_Up before its Sync is now kept till the Sync comes. Likewise a Delay_Req is recorded before it is sent, so a Delay_Resp handled before sendEvent returns is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sydney · project thread
What
A new
[dns]section makes the BBS a DNS server for its callers (dial-up users above all, via pppd'sms-dns, whichdmodem.conf.samplealready sets to 192.168.77.1).services = auto):messenger.hotmail.com,nexus.passport.com,login.passport.com,loginnet.passport.com,login.live.comlogin.oscar.aol.com,slogin.oscar.aol.com,login.messaging.aol.com,kdc.uas.aol.com,api.screenname.aol.com,api.oscar.aol.com,login.icq.com,slogin.icq.comAmericaOnline.aol.comscs/scsa/scsb/scsc.msg.yahoo.com,cs.yahoo.com,vcs1/vcs2,insider,relay,filetransfer.msg.yahoo.com,relay.yahoo.com,login.yahoo.comgateway.moswest.msn.net; CompuServe:compuserve.com,cis.compuserve.comnames(with*.domainwildcards).The address given defaults to the one the caller reached the BBS at (the PPP side for a dial-up user), or
answer/answer6. This replaces the per-client hosts-file entries MSN: serve MSN Messenger 5.0–7.5 (MSNP8–12) with a Passport server #50 needed.https_address(or[oscar] tls_address, oraddress), or set as[dns] msn_answer,ymsg_answer,oscar_answerand so on. A port that is on every address for one front end and on a specific IP for another can't bind both, sobbs checkrefuses that mix, and the config editor refuses an edit that makes it (putting the old value back and showing why)./etc/resolv.conf, or systemd-resolved's real list when it only has the 127.0.0.53 stub; the BBS's own address is never used as upstream) or the sysop'sprimaryandbackup. Answers are cached by TTL (LRU,cache_size,max_ttl), negative ones by the SOA (negative_ttl), with identical in-flight queries coalesced. Recursion is limited toallow(loopback and private ranges by default) so it isn't an open resolver, and UDP is rate limited per address.Routes: shared ports by name
For a setup on one address, MSN's Passport, Yahoo!'s login and AIM's TLS logins all land on port 443 (and the web halves on 80). New
internal/vhostlets front ends given the same address share it: TLS is terminated with the certificate for the SNI name (or the first front end's for Windows XP clients that send none), then requests are routed byHost, or by path for a client that came by IP (/RST.srf→ MSN,/config/pwtoken_get→ Yahoo!,/auth/clientLoginand/→ AIM). Non-HTTP TLS connections (OSCAR over TLS, AIM 6.2's SSL 2.0-format hello) go to AIM.msn,ymsgandoscarskip listening on a claimed port;oscargainsHandleConnandWebHandler. Front ends on different IPs aren't shared and listen on their own as before.Also: the chat front ends' ports and DNS (UDP and TCP) are now bound as root before the BBS drops to
[general]user, so 53, 80, 443 and 569 work.bbs checkprints the DNS settings and shared ports, warns when a front end isn't on its old service's port, and warns when front ends sharing a TLS port use different certificates. A port that's TLS for one front end and plain for another is refused.The BBS's own certificate authority
tls_cert = ca([msn],[ymsg],[oscar]) andcert_file = ca([gemini]) have the BBS's CA (newinternal/bbsca) sign the server's certificate for the names its clients ask for. No key file is needed.bbs servemakes the CA inca/beside the database if there is none, signs at start and checks daily (397-day leaves renewed 30 days before their end, keys kept; Gemini's leaf lasts as long as the CA, since its clients pin). Keys are RSA 2048 for AIM 6.2+ and XP;bbs ca init -sha1signs with SHA-1 for Windows before XP SP3.The CA is a root with sub-CAs, each with its own key. The root (
ca/ca.crt, pathlen 1) is the only one callers install, and it signs only sub-CAs. The services sub-CA (ca/services-ca.crt) signs the BBS's own servers. A program beside the BBS gets a sub-CA of its own:bbs ca subca proxymakesca/proxy-ca.crt/.keyfor a TLS proxy (WebOne's Go port), so the proxy never holds the root's or the services' key. Leaves are sent with their sub-CA's certificate after them, and sub-CAs are pathlen 0.bbs ca [show|init|subca NAME|issue|package]: show the CA's fingerprint, its sub-CAs and what it signs; make it; make or show a sub-CA; sign a certificate with a sub-CA (bbs ca issue [-ca proxy] -out DIR NAME..., services by default); write the client package.ca/install-ca.zipfor callers' machines (the root only):NAME-CA.cer, aninstall-ca.infandinstall-ca.regthat write the machine's trusted roots in the registry (Windows 95 on),remove-ca.reg,install-ca.bat(certutil, else the .reg), a macOS/iOS.mobileconfig, the PEM, and a README with the fingerprint.[DNS for callers]added to the config editor's Internet services.Also fixed: PTP client on a busy machine
TestPTPfailed in CI here, and it fails onmainas well when run on one busy CPU. The cause: a two-step Sync and its Follow_Up come in on two sockets, each read by its own goroutine, and the Follow_Up was dropped whenever it was handled first. No sync ever completed. A Follow_Up that arrives first is now kept until its Sync comes, and a Delay_Req is recorded before it is sent, so a quick Delay_Resp isn't lost.Docs
New wiki page
DNS.md(settings, dial-up setup, the port table, shared ports, an IP per HTTPS service, running beside systemd-resolved) and a CA section inCertificates.md(the root and its sub-CAs, what it signs, the client package, SHA-1, TLS proxies, commands). The MSN, Yahoo!, AIM, AOL, MSN Classic and CompuServe pages point to DNS; the sample config and the generated configuration reference include[dns], the*_answerkeys andtls_cert = ca.Testing
go test ./...andgo vet ./...pass.internal/dnsd(legacy and per-service answers, forwarding, cache TTL countdown and expiry, NXDOMAIN caching, backup failover, refused outsiders, resolv.conf and systemd stub handling, UDP and TCP serving),internal/vhost(SNI, Host, path and no-SNI routing, default certificate, OSCAR handoff),internal/server([dns]parsing, per-service answers, shared ports and the every-address/specific-IP conflict),internal/confui(the editor refusing and reverting a mixing edit),internal/bbsca(root and sub-CAs, chains verified from the root alone, the root refusing to sign servers, renewal keeping keys, SHA-1, the package's files and the registry blob's layout).TestPTPon one CPU with 8 busy loops: failed every run before the fix, 8 of 8 passed after.bbs serve: legacy names resolved to the BBS andexample.comforwarded and cached; one shared TLS port answered MSN, Yahoo! and AIM by name and by path; with separate IPs, each service's names resolved to its own IP; withtls_cert = ca, the CA was made and MSN, Yahoo! and Gemini served certificates that verify against it. MSN's is issued by the services sub-CA, and abbs ca issue -ca proxycertificate verifies through the proxy sub-CA but not through the services one (openssl)..inf/.regon real Windows 9x/XP.🤖 Generated with Claude Code
https://claude.ai/code/session_01B82eRTuaG98f8wiWHbNhPo