0001-trivial-remove-compatibility-code-for-python-3.6-611.patch
src/authentic2_idp_oidc/views.py | ||
---|---|---|
18 | 18 |
import datetime |
19 | 19 |
import logging |
20 | 20 |
import math |
21 |
from binascii import Error as Base64Error |
|
22 | ||
23 |
try: |
|
24 |
from secrets import compare_digest |
|
25 |
except ImportError: |
|
26 | ||
27 |
def compare_digest(a, b): |
|
28 |
return a == b |
|
29 | ||
30 | ||
21 |
import secrets |
|
31 | 22 |
import time |
23 |
from binascii import Error as Base64Error |
|
32 | 24 | |
33 | 25 |
from django.conf import settings |
34 | 26 |
from django.contrib import messages |
... | ... | |
533 | 525 |
raw_provided_client_secret = client_secret.encode('utf-8') |
534 | 526 |
if len(raw_client_client_secret) != len(raw_provided_client_secret): |
535 | 527 |
raise WrongClientSecret(client=client, wrong_id=raw_provided_client_secret) |
536 |
if not compare_digest(raw_client_client_secret, raw_provided_client_secret): |
|
528 |
if not secrets.compare_digest(raw_client_client_secret, raw_provided_client_secret):
|
|
537 | 529 |
raise WrongClientSecret(client=client, wrong_id=raw_provided_client_secret) |
538 | 530 |
return client |
539 | 531 | |
540 |
- |