Skip to content
Snippets Groups Projects
Unverified Commit 029b7ad7 authored by Patrick Cloke's avatar Patrick Cloke Committed by GitHub
Browse files

Remove unused `compare_digest` function. (#10706)

parent e62cdbef
No related branches found
No related tags found
No related merge requests found
Remove unused `compare_digest` function.
...@@ -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__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment