0001-use-stdlib-OrderedDict-25319.patch
src/authentic2/hashers.py | ||
---|---|---|
1 | 1 |
import hashlib |
2 | 2 |
import math |
3 | 3 |
import base64 |
4 |
from collections import OrderedDict |
|
4 | 5 | |
5 | 6 |
from django.contrib.auth import hashers |
6 | 7 |
from django.utils.crypto import constant_time_compare |
7 |
from django.utils.datastructures import SortedDict |
|
8 | 8 |
from django.utils.translation import ugettext_noop as _ |
9 | 9 |
from django.utils.encoding import force_bytes |
10 | 10 |
from django.contrib.auth.hashers import make_password |
... | ... | |
78 | 78 |
def safe_summary(self, encoded): |
79 | 79 |
algorithm, iterations, salt, hash = encoded.split('$', 3) |
80 | 80 |
assert algorithm == self.algorithm |
81 |
return SortedDict([
|
|
81 |
return OrderedDict([
|
|
82 | 82 |
(_('algorithm'), algorithm), |
83 | 83 |
(_('iterations'), iterations), |
84 | 84 |
(_('salt'), hashers.mask_hash(salt)), |
... | ... | |
108 | 108 |
def safe_summary(self, encoded): |
109 | 109 |
algorithm, salt, hash = encoded.split('$', 2) |
110 | 110 |
assert algorithm == self.algorithm |
111 |
return SortedDict([
|
|
111 |
return OrderedDict([
|
|
112 | 112 |
(_('algorithm'), algorithm), |
113 | 113 |
(_('salt'), hashers.mask_hash(salt, show=2)), |
114 | 114 |
(_('hash'), hashers.mask_hash(hash)), |
115 |
- |