mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 00:09:50 -05:00
import appropriate modules for constant_time_compare to work
This commit is contained in:
parent
bda5bc3450
commit
2ac25e2995
@ -1,7 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os, sys, subprocess, time, hashlib, platform, json, locale, socket, argparse, Queue, inspect, base64, mimetypes
|
||||
import os, sys, subprocess, time, hashlib, platform, json, locale, socket, argparse, Queue, inspect, base64, mimetypes, hmac
|
||||
from random import randint
|
||||
from functools import wraps
|
||||
from itertools import izip
|
||||
|
||||
from stem.control import Controller
|
||||
from stem import SocketError
|
||||
@ -14,6 +15,7 @@ def constant_time_compare(val1, val2):
|
||||
_builtin_constant_time_compare = getattr(hmac, 'compare_digest', None)
|
||||
if _builtin_constant_time_compare is not None:
|
||||
return _builtin_constant_time_compare(val1, val2)
|
||||
|
||||
len_eq = len(val1) == len(val2)
|
||||
if len_eq:
|
||||
result = 0
|
||||
|
@ -1,6 +1,7 @@
|
||||
from __future__ import division
|
||||
import os, sys, subprocess, time, hashlib, platform, json, locale, socket, argparse, Queue, inspect, base64, random, functools, logging, ctypes
|
||||
import stem, stem.control, flask, itsdangerous
|
||||
import os, sys, subprocess, time, hashlib, platform, json, locale, socket, argparse, Queue, inspect, base64, random, functools, logging, ctypes, hmac
|
||||
from itertools import izip
|
||||
import stem, stem.control, flask
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
import onionshare, onionshare_gui
|
||||
|
Loading…
Reference in New Issue
Block a user