Skip to content
Snippets Groups Projects
Verified Commit ced99694 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! Bug 40933: Add tor-launcher functionality

Bug 41844: Added a couple of wrappers for Onion Auth on
TorProtocolService.
parent 0ed1e9d4
Branches
Tags
1 merge request!734Bug 42030: Rebased 13.0 alpha onto Firefox 115.2.0esr
......@@ -188,6 +188,24 @@ export const TorProtocolService = {
return TorParsers.parseReply(cmd, keyword, response);
},
async onionAuthAdd(hsAddress, b64PrivateKey, isPermanent) {
return this._withConnection(conn => {
return conn.onionAuthAdd(hsAddress, b64PrivateKey, isPermanent);
});
},
async onionAuthRemove(hsAddress) {
return this._withConnection(conn => {
return conn.onionAuthRemove(hsAddress);
});
},
async onionAuthViewKeys() {
return this._withConnection(conn => {
return conn.onionAuthViewKeys();
});
},
// TODO: transform the following 4 functions in getters. At the moment they
// are also used in torbutton.
......@@ -630,6 +648,16 @@ export const TorProtocolService = {
}
},
async _withConnection(func) {
// TODO: Make more robust?
const conn = await this._getConnection();
try {
return await func(conn);
} finally {
this._returnConnection();
}
},
// If aConn is omitted, the cached connection is closed.
_closeConnection() {
if (this._controlConnection) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment