[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.4.0esr-13.5-1] 2 commits: fixup! Bug 40933: Add tor-launcher functionality



Title: GitLab

richard pushed to branch tor-browser-115.4.0esr-13.5-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 890eb18c
    by Pier Angelo Vendrame at 2023-10-17T16:26:43+02:00
    fixup! Bug 40933: Add tor-launcher functionality
    
    Bug 42108: Use the sentconnect event to update the circuit display
    
    In this way, the circuit might be updated more often, because some
    circuits will not work for some sites, but it might be what users want,
    especially when the browser fails and you would like to know the exit
    node that has been blocked.
    
  • d4cf2169
    by Pier Angelo Vendrame at 2023-10-17T16:29:23+02:00
    fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain.
    
    Bug 42108: Use the sentconnect event to update the circuit display
    
    Use the new topic name in the domain isolator.
    

4 changed files:

Changes:

  • toolkit/components/tor-launcher/TorControlPort.sys.mjs
    ... ... @@ -1043,15 +1043,15 @@ export class TorController {
    1043 1043
             }
    
    1044 1044
             break;
    
    1045 1045
           case "STREAM":
    
    1046
    -        const succeeedEvent =
    
    1047
    -          /^(?<StreamID>[a-zA-Z0-9]{1,16})\sSUCCEEDED\s(?<CircuitID>[a-zA-Z0-9]{1,16})/.exec(
    
    1046
    +        const sentConnectEvent =
    
    1047
    +          /^(?<StreamID>[a-zA-Z0-9]{1,16})\sSENTCONNECT\s(?<CircuitID>[a-zA-Z0-9]{1,16})/.exec(
    
    1048 1048
                 data.groups.data
    
    1049 1049
               );
    
    1050
    -        if (succeeedEvent) {
    
    1050
    +        if (sentConnectEvent) {
    
    1051 1051
               const credentials = this.#parseCredentials(data.groups.data);
    
    1052
    -          this.#eventHandler.onStreamSucceeded(
    
    1053
    -            succeeedEvent.groups.StreamID,
    
    1054
    -            succeeedEvent.groups.CircuitID,
    
    1052
    +          this.#eventHandler.onStreamSentConnect(
    
    1053
    +            sentConnectEvent.groups.StreamID,
    
    1054
    +            sentConnectEvent.groups.CircuitID,
    
    1055 1055
                 credentials?.username ?? null,
    
    1056 1056
                 credentials?.password ?? null
    
    1057 1057
               );
    
    ... ... @@ -1190,8 +1190,9 @@ export class TorController {
    1190 1190
      * (i.e., a CIRC event with a BUILT status)
    
    1191 1191
      * @property {OnCircuitClosed} onCircuitClosed Called when a circuit is closed
    
    1192 1192
      * (i.e., a CIRC event with a CLOSED status)
    
    1193
    - * @property {OnStreamSucceeded} onStreamSucceeded Called when a stream receives
    
    1194
    - * a reply (i.e., a STREAM event with a SUCCEEDED status)
    
    1193
    + * @property {OnStreamSentConnect} onStreamSentConnect Called when a stream sent
    
    1194
    + * a connect cell along a circuit (i.e., a STREAM event with a SENTCONNECT
    
    1195
    + * status)
    
    1195 1196
      */
    
    1196 1197
     /**
    
    1197 1198
      * @callback OnBootstrapStatus
    
    ... ... @@ -1217,7 +1218,7 @@ export class TorController {
    1217 1218
      * @param {CircuitID} id The id of the circuit that has been closed
    
    1218 1219
      */
    
    1219 1220
     /**
    
    1220
    - * @callback OnStreamSucceeded
    
    1221
    + * @callback OnStreamSentConnect
    
    1221 1222
      *
    
    1222 1223
      * @param {StreamID} streamId The id of the stream that switched to the succeeded
    
    1223 1224
      * state
    

  • toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
    ... ... @@ -146,7 +146,10 @@ class TorDomainIsolatorImpl {
    146 146
     
    
    147 147
         Services.prefs.addObserver(NON_TOR_PROXY_PREF, this);
    
    148 148
         Services.obs.addObserver(this, NEW_IDENTITY_TOPIC);
    
    149
    -    Services.obs.addObserver(this, lazy.TorProviderTopics.StreamSucceeded);
    
    149
    +    Services.obs.addObserver(
    
    150
    +      this,
    
    151
    +      lazy.TorProviderTopics.CircuitCredentialsMatched
    
    152
    +    );
    
    150 153
     
    
    151 154
         this.#cleanupIntervalId = setInterval(
    
    152 155
           this.#clearKnownCircuits.bind(this),
    
    ... ... @@ -161,7 +164,10 @@ class TorDomainIsolatorImpl {
    161 164
       uninit() {
    
    162 165
         Services.prefs.removeObserver(NON_TOR_PROXY_PREF, this);
    
    163 166
         Services.obs.removeObserver(this, NEW_IDENTITY_TOPIC);
    
    164
    -    Services.obs.removeObserver(this, lazy.TorProviderTopics.StreamSucceeded);
    
    167
    +    Services.obs.removeObserver(
    
    168
    +      this,
    
    169
    +      lazy.TorProviderTopics.CircuitCredentialsMatched
    
    170
    +    );
    
    165 171
         clearInterval(this.#cleanupIntervalId);
    
    166 172
         this.#cleanupIntervalId = null;
    
    167 173
         this.clearIsolation();
    
    ... ... @@ -266,7 +272,7 @@ class TorDomainIsolatorImpl {
    266 272
             logger.error("Could not send the newnym command", e);
    
    267 273
             // TODO: What UX to use here? See tor-browser#41708
    
    268 274
           }
    
    269
    -    } else if (topic === lazy.TorProviderTopics.StreamSucceeded) {
    
    275
    +    } else if (topic === lazy.TorProviderTopics.CircuitCredentialsMatched) {
    
    270 276
           const { username, password, circuit } = subject.wrappedJSObject;
    
    271 277
           this.#updateCircuit(username, password, circuit);
    
    272 278
         }
    

  • toolkit/components/tor-launcher/TorProvider.sys.mjs
    ... ... @@ -991,19 +991,19 @@ export class TorProvider {
    991 991
       }
    
    992 992
     
    
    993 993
       /**
    
    994
    -   * Handle a notification about a stream switching to the succeeded state.
    
    994
    +   * Handle a notification about a stream switching to the sentconnect status.
    
    995 995
        *
    
    996 996
        * @param {StreamID} streamId The ID of the stream that switched to the
    
    997
    -   * succeeded state.
    
    997
    +   * sentconnect status.
    
    998 998
        * @param {CircuitID} circuitId The ID of the circuit used by the stream
    
    999 999
        * @param {string} username The SOCKS username
    
    1000 1000
        * @param {string} password The SOCKS password
    
    1001 1001
        */
    
    1002
    -  async onStreamSucceeded(streamId, circuitId, username, password) {
    
    1002
    +  async onStreamSentConnect(streamId, circuitId, username, password) {
    
    1003 1003
         if (!username || !password) {
    
    1004 1004
           return;
    
    1005 1005
         }
    
    1006
    -    logger.debug("Stream succeeded event", username, password, circuitId);
    
    1006
    +    logger.debug("Stream sentconnect event", username, password, circuitId);
    
    1007 1007
         let circuit = this.#circuits.get(circuitId);
    
    1008 1008
         if (!circuit) {
    
    1009 1009
           circuit = new Promise((resolve, reject) => {
    
    ... ... @@ -1017,7 +1017,7 @@ export class TorProvider {
    1017 1017
                 this.#circuits.set(id, nodes);
    
    1018 1018
               }
    
    1019 1019
               logger.error(
    
    1020
    -            `Seen a STREAM SUCCEEDED with circuit ${circuitId}, but Tor did not send information about it.`
    
    1020
    +            `Seen a STREAM SENTCONNECT with circuit ${circuitId}, but Tor did not send information about it.`
    
    1021 1021
               );
    
    1022 1022
               reject();
    
    1023 1023
             });
    
    ... ... @@ -1037,7 +1037,7 @@ export class TorProvider {
    1037 1037
               circuit,
    
    1038 1038
             },
    
    1039 1039
           },
    
    1040
    -      TorProviderTopics.StreamSucceeded
    
    1040
    +      TorProviderTopics.CircuitCredentialsMatched
    
    1041 1041
         );
    
    1042 1042
       }
    
    1043 1043
     }

  • toolkit/components/tor-launcher/TorProviderBuilder.sys.mjs
    ... ... @@ -15,7 +15,7 @@ export const TorProviderTopics = Object.freeze({
    15 15
       BootstrapError: "TorBootstrapError",
    
    16 16
       HasWarnOrErr: "TorLogHasWarnOrErr",
    
    17 17
       BridgeChanged: "TorBridgeChanged",
    
    18
    -  StreamSucceeded: "TorStreamSucceeded",
    
    18
    +  CircuitCredentialsMatched: "TorCircuitCredentialsMatched",
    
    19 19
     });
    
    20 20
     
    
    21 21
     export const TorProviders = Object.freeze({
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits