Masayuki Hatta pushed to branch master at Debian Java Maintainers / orchid
Commits: 2a32da7e by Masayuki Hatta at 2026-11-05T11:03:07+09:00 circuits, connections: close on cells nobody asked for A relay could make Orchid queue cells that nobody would ever take out of the queue, until the heap was full: - Link handshake cells (VERSIONS, CERTS, AUTH_CHALLENGE, NETINFO) were queued without limit, also after the handshake. CERTS cells can be 64 KiB long, and any relay we connect to could send them. The queue now holds 8 cells, and any of these cells after the handshake closes the connection. - Replies on a circuit (EXTENDED2, RENDEZVOUS_ESTABLISHED, INTRODUCE_ACK, RENDEZVOUS2, and CREATED2 / CREATED_FAST) were queued whether or not a request was waiting for them. A reply is now accepted only for a request we sent; any other closes the circuit as a protocol violation, as in Tor. EXTENDED and RESOLVED, which Orchid never asks for, always do. The reply queues are bounded as well. - TRUNCATED was queued as well. It is still the answer to a pending request (a failed EXTEND2); otherwise the circuit is closed. - A DATA cell beyond a stream's delivery window was buffered first and counted afterwards; the exception that followed did not close the circuit. An exit relay could thus keep sending DATA cells to an application that does not read them. The window is now checked first, and a DATA cell beyond it closes the circuit. So does a stream SENDME that would open the package window beyond its initial size. Cells for circuits that are not open on the connection are still dropped, as some arrive normally after we destroy a circuit, but they are now reported at most once a minute instead of with one warning each, so that a relay cannot fill the log with them. - - - - - f504585e by Masayuki Hatta at 2026-11-05T11:03:07+09:00 directory: refuse a consensus that is far outside its validity period A consensus was used as long as its signatures were good and it was not older than the current one, however long ago it had expired or however far in the future it became valid. An old consensus lists relays that may be gone and keys and flags that have changed, and anyone who kept a copy can replay it: whoever serves directory documents could pin a client to the network of an earlier day. Use a consensus only from a day before its valid-after time until a day after its valid-until time, as Tor does (REASONABLY_LIVE_TIME), so that a client whose consensus has just expired, or whose clock is a little off, keeps working while it fetches a new one. The warning mentions the system clock, the usual reason on a phone. - - - - - eb6927c8 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 directory: require dir-key-crosscert in key certificates dir-spec requires the dir-key-crosscert of a key certificate exactly once: the signing key signs the digest of the identity key with it, to show that its holder agreed to be certified by that authority. Orchid verified the cross certificate when there was one but accepted a certificate without it. Such a certificate is now invalid. - - - - - dd90f163 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 path: keep relays that share a family ID off the same circuit Tor 0.4.9 relays prove that they belong to a family with a family key (Happy Families, proposal 321), and their microdescriptors list the family IDs in a "family-ids" line. Orchid ignored that line and kept relays apart only by their "family" lines, which list the members by fingerprint and must be mutual. The "family" lines are to be dropped once enough clients understand family IDs, and then Orchid would put two relays of one operator on the same circuit. Parse "family-ids", and treat relays that share a family ID as one family when choosing a path. Router and Descriptor have a new method, getFamilyIds(), with a default that returns an empty set, so other implementations still compile. Full router descriptors carry a family certificate instead, which Orchid does not verify; with microdescriptors turned off, only the "family" lines are used, as before. CircuitPathChooser#areRelated() now says whether two relays may not share a circuit: the same relay, the same /16, mutual "family" lines or a shared family ID, as Tor's nodes_in_same_family() does. - - - - - 4a461cd6 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 hs: do not extend a circuit to a relay related to one already on it An introduction point or an HSDir is chosen by the onion service, or by the hash ring, not by us. Orchid took any clean internal circuit and extended it to that relay, even when the relay was already on the circuit, or in the family or the /16 of a relay on it. Tor does not cannibalize such a circuit (circuit_find_to_cannibalize()). Check the target against every hop with CircuitPathChooser#areRelated() before extending. If it is related, the extension fails, the circuit is closed, and the next introduction point or HSDir is tried, as after any other failure to extend. - - - - - a9e6ede6 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 sockets: make the DNS placeholder an address that goes nowhere OrchidSocketFactory.unresolvedAddress() returned 0.0.0.0 carrying the host name. An application that set its HTTP client's DNS hook but forgot the socket factory then connected with ordinary sockets to 0.0.0.0, which Linux and Android treat as the local machine: the request reached whatever listens on the device, instead of failing. Return 240.0.0.1 instead. 240.0.0.0/4 is reserved and not routed, so such a connection fails. Orchid's sockets treat it as the host name, as before, and still accept the old 0.0.0.0 placeholder. OrchidSocketFactory#createSocket(InetAddress, int) now also passes a placeholder's host name to the exit relay, instead of its address. - - - - - 6dbb3f5f by Masayuki Hatta at 2026-11-05T11:03:07+09:00 circuits: check host names, and never send an onion address to an exit Host names from applications and SOCKS clients were passed on as they were: - ".onion" was matched case sensitively, and with no trailing dot, so "x.ONION" or "x.onion." went to an exit relay, which then learned the onion address. Onion addresses are now recognized in any case and with a trailing dot, and passed to the onion service code in lower case. - A NUL, a colon, white space or a control character in the name changed the "host:port" string of the BEGIN cell. Such names, empty names and names longer than 255 characters are refused. - ClientRejectInternalAddress refused only the RFC 1918 ranges. It now refuses every address that is not public, as Tor does: 0/8, loopback, link local, 100.64/10, multicast and the reserved range, as well as "localhost" and names under it. - - - - - da7a02cb by Masayuki Hatta at 2026-11-05T11:03:07+09:00 directory: restrict an existing data directory to its owner as well The data directory holds the entry guards and any onion service client authorization keys. Orchid made it accessible to its owner only when it created it, and left an existing one as it was, such as one created by an earlier version or by hand. Restrict it on every start, as Tor does with its own data directory. - - - - - e7190b51 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 connections: send neither the time nor an address of our own in NETINFO Orchid's NETINFO cell carried the current time and 0.0.0.0 as its own address. The offset of the time tells a relay how far the device's clock is off, which can recognize a client across connections. Send 0 as the time and no addresses of our own, as Tor clients do (tor-spec, section 4.5). - - - - - 651939d9 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 circuits, hs: limit the number of isolation groups Streams with different isolation keys (SOCKS credentials, or the key given to TorClient#openExitStreamTo()) never share a circuit. There was no limit on the number of keys, so a program that changed its SOCKS user name on every connection made Orchid build circuits without end: a load on the guards, and a pattern of traffic unlike that of other clients. The table of rendezvous circuits of an onion service also kept one entry for every key ever used. At most 64 isolation keys may now have exit circuits or waiting streams at the same time, and as many may have rendezvous circuits to one onion service. A stream with a new key beyond that fails to open; streams without a key are not affected. Closed rendezvous circuits are removed from the table. - - - - - 62288c2f by Masayuki Hatta at 2026-11-05T11:03:07+09:00 crypto: check the certified key type of onion service certificates Ed25519Certificate#isValid(), which checks the certificates of v3 onion service descriptors, ignored CERT_KEY_TYPE. These certificates all certify Ed25519 keys; one that names another key type (the digest of an RSA key or of an X.509 certificate, cert-spec section 2.1) is the wrong certificate, even if its signature is good. It is now refused. - - - - - 6be54418 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 circuits: skip stream ids in use, and make the hop list safe to read Stream ids are 16 bits and wrap around. After wrapping, a new stream could get the id of a stream that was still open, which was then replaced in the stream table and could no longer be read or closed. Skip ids in use, as Tor does. The list of hops of a circuit was an ArrayList, read by the cell reading thread for every cell it decrypts while the building thread appends hops to it. It is now a CopyOnWriteArrayList; it changes only a few times per circuit. - - - - - ed400181 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 sockets: deprecate OrchidSocketImplFactory Installing it with Socket#setSocketImplFactory sends every socket of the process through Tor, including those of libraries that do not expect it, and Socket#setSocketImplFactory itself is deprecated since Java 17. TorClient#getSocketFactory() affects only the clients that are given the factory. OrchidSocketImplFactory is to be removed in Orchid 3.0. - - - - - 24817e8f by Masayuki Hatta at 2026-11-05T11:03:07+09:00 dashboard: do not start on Android The dashboard has no authentication and shows the entry guards, the circuits and the streams. On a desktop only the local user's programs can usually reach 127.0.0.1, but on Android every app on the device can, so another app could watch how the user's traffic is routed. It is a debugging tool; on Android it is now started only when the system property com.subgraph.orchid.dashboard.allowOnAndroid is "true". - - - - - 3b08cc25 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 ci: pin the actions to commit SHAs, and check that the jars are reproducible The actions were referred to by tags, which their owners can move to other code. They are now pinned to the commit SHAs of their current v4 releases, which the comments name. A new job builds the jars twice, in two directories, and compares them byte for byte, as doc/RELEASING.md describes for releases. - - - - - 0fc42a21 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 samples/android: test the app on emulators The sample had never been run. An instrumented test now starts Orchid on the device, waits for it to bootstrap and checks that a request through it reaches check.torproject.org from Tor. It runs with "gradlew connectedDebugAndroidTest" on a device or a running emulator, and in a new workflow on emulators with API levels 24 and 35, on pushes to master and by hand (it needs the Tor network). The request is moved to a class of its own, TorCheck, which the activity and the test share; the activity also logs the answer (tag OrchidSample). A listener added after Orchid failed to start is now told so. - - - - - 259dd5c7 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 README: 2.5.0, the dashboard on Android, testing on an emulator - - - - - fb48ddd3 by Masayuki Hatta at 2026-11-05T11:03:07+09:00 samples/android: tell Android Studio which Gradle version to use The sample has no Gradle wrapper of its own; from the command line it is built with Orchid's. Android Studio, which opens samples/android as a project of its own, then fell back to a Gradle version of its choosing. Give the sample the wrapper properties of Orchid (the jar and scripts are not needed for that). - - - - - 49688293 by Masayuki Hatta at 2026-11-05T11:49:25+09:00 New upstream version 2.5.0+ds - - - - - 19942318 by Masayuki Hatta at 2026-11-05T11:49:25+09:00 Update upstream source from tag 'upstream/2.5.0+ds' Update to upstream version '2.5.0+ds' with Debian dir a4571c974090bc9743cfd466ac2d2c87c6432c0a - - - - - 7b6eb26f by Masayuki Hatta at 2026-11-06T14:18:19+09:00 Convert debian/watch to version 5 - - - - - 59 changed files: - .git-archival.txt - + .github/workflows/android.yml - .github/workflows/ci.yml - README.md - debian/watch - samples/android/README.md - samples/android/app/build.gradle - + samples/android/app/src/androidTest/java/org/mhatta/orchid/sample/TorConnectionTest.java - samples/android/app/src/main/java/org/mhatta/orchid/sample/MainActivity.java - samples/android/app/src/main/java/org/mhatta/orchid/sample/OrchidHolder.java - + samples/android/app/src/main/java/org/mhatta/orchid/sample/TorCheck.java - samples/android/gradle.properties - + samples/android/gradle/wrapper/gradle-wrapper.properties - src/main/java/com/subgraph/orchid/Descriptor.java - src/main/java/com/subgraph/orchid/Router.java - src/main/java/com/subgraph/orchid/circuits/CircuitIO.java - src/main/java/com/subgraph/orchid/circuits/CircuitImpl.java - src/main/java/com/subgraph/orchid/circuits/CircuitManagerImpl.java - src/main/java/com/subgraph/orchid/circuits/ExitCircuitImpl.java - src/main/java/com/subgraph/orchid/circuits/InternalCircuitImpl.java - src/main/java/com/subgraph/orchid/circuits/StreamImpl.java - src/main/java/com/subgraph/orchid/circuits/guards/BridgeRouterImpl.java - src/main/java/com/subgraph/orchid/circuits/hs/HiddenService.java - src/main/java/com/subgraph/orchid/circuits/hs/HiddenServiceManager.java - src/main/java/com/subgraph/orchid/circuits/hs/RendezvousCircuitBuilder.java - src/main/java/com/subgraph/orchid/circuits/path/CircuitPathChooser.java - src/main/java/com/subgraph/orchid/connections/ConnectionHandshake.java - src/main/java/com/subgraph/orchid/connections/ConnectionImpl.java - src/main/java/com/subgraph/orchid/crypto/Ed25519Certificate.java - src/main/java/com/subgraph/orchid/dashboard/Dashboard.java - src/main/java/com/subgraph/orchid/directory/DataDirectory.java - src/main/java/com/subgraph/orchid/directory/DirectoryImpl.java - src/main/java/com/subgraph/orchid/directory/RouterImpl.java - src/main/java/com/subgraph/orchid/directory/certificate/KeyCertificateParser.java - src/main/java/com/subgraph/orchid/directory/router/RouterMicrodescriptorImpl.java - src/main/java/com/subgraph/orchid/directory/router/RouterMicrodescriptorKeyword.java - src/main/java/com/subgraph/orchid/directory/router/RouterMicrodescriptorParser.java - src/main/java/com/subgraph/orchid/sockets/OrchidSocketFactory.java - src/main/java/com/subgraph/orchid/sockets/OrchidSocketImpl.java - src/main/java/com/subgraph/orchid/sockets/OrchidSocketImplFactory.java - test/com/subgraph/orchid/circuits/CircuitExtenderTest.java - + test/com/subgraph/orchid/circuits/HostnameTest.java - test/com/subgraph/orchid/circuits/RelayCellSourceTest.java - + test/com/subgraph/orchid/circuits/StreamIdTest.java - test/com/subgraph/orchid/circuits/StreamIsolationTest.java - + test/com/subgraph/orchid/circuits/UnsolicitedCellTest.java - + test/com/subgraph/orchid/circuits/hs/Ed25519CertificateKeyTypeTest.java - test/com/subgraph/orchid/circuits/hs/HSV3TestServiceEncoder.java - test/com/subgraph/orchid/circuits/hs/HiddenServiceIsolationTest.java - + test/com/subgraph/orchid/circuits/path/FamilyTest.java - + test/com/subgraph/orchid/connections/LinkControlCellTest.java - test/com/subgraph/orchid/connections/LinkProtocolTest.java - + test/com/subgraph/orchid/dashboard/DashboardTest.java - + test/com/subgraph/orchid/directory/ConsensusFreshnessTest.java - test/com/subgraph/orchid/directory/DataDirectoryTest.java - test/com/subgraph/orchid/directory/TestAuthority.java - test/com/subgraph/orchid/directory/certificate/KeyCertificateParserTest.java - test/com/subgraph/orchid/directory/router/RouterMicrodescriptorParserTest.java - test/com/subgraph/orchid/sockets/UnresolvedAddressTest.java The diff was not included because it is too large. View it on GitLab: https://salsa.debian.org/java-team/orchid/-/compare/9c7edfb05f0bbb92a8570d0437190fb395e09fdb...7b6eb26f11590b3a1e4b37fb544088d6892812bb -- View it on GitLab: https://salsa.debian.org/java-team/orchid/-/compare/9c7edfb05f0bbb92a8570d0437190fb395e09fdb...7b6eb26f11590b3a1e4b37fb544088d6892812bb You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
_______________________________________________ pkg-java-commits mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-commits

