예제 #1
0
 def test_constant_time_compare(self):
     from webtools.utils.crypto import constant_time_compare
     self.assertTrue(constant_time_compare("hello", "hello"))
예제 #2
0
 def verify(self, password, encoded):
     encoded_2 = self.encode(password, '')
     return constant_time_compare(encoded, encoded_2)
예제 #3
0
 def verify(self, password, encoded):
     crypt = self._load_library()
     algorithm, salt, data = encoded.split('$', 2)
     assert algorithm == self.algorithm
     return constant_time_compare(data, crypt.crypt(password, data))
예제 #4
0
 def verify(self, password, encoded):
     algorithm, data = encoded.split('$', 1)
     assert algorithm == self.algorithm
     bcrypt = self._load_library()
     return constant_time_compare(data, bcrypt.hashpw(password, data))
예제 #5
0
 def verify(self, password, encoded):
     algorithm, salt, hash = encoded.split('$', 2)
     assert algorithm == self.algorithm
     encoded_2 = self.encode(password, salt)
     return constant_time_compare(encoded, encoded_2)
예제 #6
0
 def test_constant_time_compare(self):
     from webtools.utils.crypto import constant_time_compare
     self.assertTrue(constant_time_compare("hello", "hello"))
예제 #7
0
 def verify(self, password, encoded):
     crypt = self._load_library()
     algorithm, salt, data = encoded.split('$', 2)
     assert algorithm == self.algorithm
     return constant_time_compare(data, crypt.crypt(password, data))
예제 #8
0
 def verify(self, password, encoded):
     encoded_2 = self.encode(password, '')
     return constant_time_compare(encoded, encoded_2)
예제 #9
0
 def verify(self, password, encoded):
     algorithm, salt, hash = encoded.split('$', 2)
     assert algorithm == self.algorithm
     encoded_2 = self.encode(password, salt)
     return constant_time_compare(encoded, encoded_2)
예제 #10
0
 def verify(self, password, encoded):
     algorithm, data = encoded.split('$', 1)
     assert algorithm == self.algorithm
     bcrypt = self._load_library()
     return constant_time_compare(data, bcrypt.hashpw(password, data))