Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
4aed7311
Kaydet (Commit)
4aed7311
authored
Ock 03, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Increased the default PBKDF2 iterations.
üst
0a06ae9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
hashers.py
django/contrib/auth/hashers.py
+2
-2
test_hashers.py
django/contrib/auth/tests/test_hashers.py
+3
-3
1.7.3.txt
docs/releases/1.7.3.txt
+6
-1
No files found.
django/contrib/auth/hashers.py
Dosyayı görüntüle @
4aed7311
...
...
@@ -222,12 +222,12 @@ class PBKDF2PasswordHasher(BasePasswordHasher):
"""
Secure password hashing using the PBKDF2 algorithm (recommended)
Configured to use PBKDF2 + HMAC + SHA256 with 1
2
000 iterations.
Configured to use PBKDF2 + HMAC + SHA256 with 1
5
000 iterations.
The result is a 64 byte binary string. Iterations may be changed
safely but you must rename the algorithm if you change SHA256.
"""
algorithm
=
"pbkdf2_sha256"
iterations
=
1
2
000
iterations
=
1
5
000
digest
=
hashlib
.
sha256
def
encode
(
self
,
password
,
salt
,
iterations
=
None
):
...
...
django/contrib/auth/tests/test_hashers.py
Dosyayı görüntüle @
4aed7311
...
...
@@ -47,7 +47,7 @@ class TestUtilsHashPass(SimpleTestCase):
def
test_pkbdf2
(
self
):
encoded
=
make_password
(
'lètmein'
,
'seasalt'
,
'pbkdf2_sha256'
)
self
.
assertEqual
(
encoded
,
'pbkdf2_sha256$1
2000$seasalt$Ybw8zsFxqja97tY/o6G+Fy1ksY4U/Hw3DRrGED6Up4s
='
)
'pbkdf2_sha256$1
5000$seasalt$+qoFTwR4r71UCLMhmQUCou/LMu17XwQWfYIVd/xJ1RI
='
)
self
.
assertTrue
(
is_password_usable
(
encoded
))
self
.
assertTrue
(
check_password
(
'lètmein'
,
encoded
))
self
.
assertFalse
(
check_password
(
'lètmeinz'
,
encoded
))
...
...
@@ -211,14 +211,14 @@ class TestUtilsHashPass(SimpleTestCase):
hasher
=
PBKDF2PasswordHasher
()
encoded
=
hasher
.
encode
(
'lètmein'
,
'seasalt2'
)
self
.
assertEqual
(
encoded
,
'pbkdf2_sha256$1
2000$seasalt2$hlDLKsxgkgb1aeOppkM5atCYw5rPzAjCNQZ4NYyUROw
='
)
'pbkdf2_sha256$1
5000$seasalt2$uSQqI+91wgObKdP6L6S75LLzyxrZRWNcaujEZPA3/nA
='
)
self
.
assertTrue
(
hasher
.
verify
(
'lètmein'
,
encoded
))
def
test_low_level_pbkdf2_sha1
(
self
):
hasher
=
PBKDF2SHA1PasswordHasher
()
encoded
=
hasher
.
encode
(
'lètmein'
,
'seasalt2'
)
self
.
assertEqual
(
encoded
,
'pbkdf2_sha1$1
2000$seasalt2$JeMRVfjjgtWw3/HzlnlfqBnQ6CA
='
)
'pbkdf2_sha1$1
5000$seasalt2$iYDXAPKgMsKMsarvA1MErD518Ug
='
)
self
.
assertTrue
(
hasher
.
verify
(
'lètmein'
,
encoded
))
def
test_upgrade
(
self
):
...
...
docs/releases/1.7.3.txt
Dosyayı görüntüle @
4aed7311
...
...
@@ -11,4 +11,9 @@ Django 1.7.3 fixes several bugs in 1.7.2.
Bugfixes
========
* ...
* The default iteration count for the PBKDF2 password hasher has been
increased by 25%. This part of the normal major release process was
inadvertently omitted in 1.7. This backwards compatible change will not
affect users who have subclassed
``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to change the
default value.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment