From 9667b8a6e08b57db952162c28a7a079068dfdd04 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 12 Feb 2019 11:57:49 +0000 Subject: Move constant-time compare function to utils.security --- modules/sasl/scram.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/sasl/scram.py b/modules/sasl/scram.py index 463843e4..487a2091 100644 --- a/modules/sasl/scram.py +++ b/modules/sasl/scram.py @@ -1,4 +1,5 @@ import base64, enum, hashlib, hmac, os, typing +from src import utils # IANA Hash Function Textual Names # https://tools.ietf.org/html/rfc5802#section-4 @@ -101,7 +102,7 @@ class SCRAM(object): server_key = self._hmac(self._salted_password, b"Server Key") server_signature = self._hmac(server_key, self._auth_message) - if self._constant_time_compare(server_signature, verifier): + if utils.security.constant_time_compare(server_signature, verifier): self.state = SCRAMState.Success return True else: -- cgit v1.3.1-10-gc9f91