Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
63e0f941
Commit
63e0f941
authored
Apr 9, 2024
by
henry
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Lox integration
Bug 42489: Tidy #attemptUpgrade by returning early with a promise.
parent
a9522e4e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!970
Update Lox module
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/components/lox/Lox.sys.mjs
+20
-29
20 additions, 29 deletions
toolkit/components/lox/Lox.sys.mjs
with
20 additions
and
29 deletions
toolkit/components/lox/Lox.sys.mjs
+
20
−
29
View file @
63e0f941
...
...
@@ -748,23 +748,17 @@ class LoxImpl {
/** Attempts to upgrade the currently saved Lox credential.
* If an upgrade is available, save an event in the event list.
*
* @returns {boolean}
w
hether a levelup event occured
* @returns {boolean}
W
hether a levelup event occur
r
ed
.
*/
async
#attemptUpgrade
(
loxId
)
{
await
this
.
#getPubKeys
();
await
this
.
#getEncTable
();
await
this
.
#getConstants
();
let
success
=
false
;
let
level
=
this
.
#getLevel
(
loxId
);
if
(
level
<
1
)
{
// attempt trust promotion instead
try
{
success
=
await
this
.
#trustMigration
(
loxId
);
}
catch
(
err
)
{
lazy
.
logger
.
error
(
err
);
return
false
;
return
this
.
#trustMigration
(
loxId
);
}
}
else
{
let
request
=
lazy
.
level_up
(
this
.
#getCredentials
(
loxId
),
this
.
#encTable
,
...
...
@@ -783,15 +777,12 @@ class LoxImpl {
this
.
#changeCredentials
(
loxId
,
cred
);
return
true
;
}
return
success
;
}
/**
* Attempt to migrate from an untrusted to a trusted Lox credential
*
* @param {string} loxId - The ID to use.
* @returns {Promise<bool>} A bool value indicated whether the credential
* was successfully migrated.
* @returns {boolean} Whether the credential was successfully migrated.
*/
async
#trustMigration
(
loxId
)
{
await
this
.
#getPubKeys
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment