Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
029b7ad7
Unverified
Commit
029b7ad7
authored
3 years ago
by
Patrick Cloke
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused `compare_digest` function. (#10706)
parent
e62cdbef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/10706.misc
+1
-0
1 addition, 0 deletions
changelog.d/10706.misc
synapse/rest/client/register.py
+0
-13
0 additions, 13 deletions
synapse/rest/client/register.py
with
1 addition
and
13 deletions
changelog.d/10706.misc
0 → 100644
+
1
−
0
View file @
029b7ad7
Remove unused `compare_digest` function.
This diff is collapsed.
Click to expand it.
synapse/rest/client/register.py
+
0
−
13
View file @
029b7ad7
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
hmac
import
logging
import
logging
import
random
import
random
from
typing
import
List
,
Union
from
typing
import
List
,
Union
...
@@ -60,18 +59,6 @@ from synapse.util.threepids import (
...
@@ -60,18 +59,6 @@ from synapse.util.threepids import (
from
._base
import
client_patterns
,
interactive_auth_handler
from
._base
import
client_patterns
,
interactive_auth_handler
# We ought to be using hmac.compare_digest() but on older pythons it doesn't
# exist. It's a _really minor_ security flaw to use plain string comparison
# because the timing attack is so obscured by all the other code here it's
# unlikely to make much difference
if
hasattr
(
hmac
,
"
compare_digest
"
):
compare_digest
=
hmac
.
compare_digest
else
:
def
compare_digest
(
a
,
b
):
return
a
==
b
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
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
register
or
sign in
to comment