Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
9b8c2e76
Unverified
Kaydet (Commit)
9b8c2e76
authored
Eki 11, 2018
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Eki 11, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751)
for the SHAKE algorithm in the hashlib module.
üst
f1aa8aed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
test_hashlib.py
Lib/test/test_hashlib.py
+13
-0
2018-10-07-21-18-52.bpo-34922.37IdsA.rst
...S.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst
+3
-0
sha3module.c
Modules/_sha3/sha3module.c
+4
-0
No files found.
Lib/test/test_hashlib.py
Dosyayı görüntüle @
9b8c2e76
...
...
@@ -230,6 +230,19 @@ class HashLibTestCase(unittest.TestCase):
self
.
assertIsInstance
(
h
.
digest
(),
bytes
)
self
.
assertEqual
(
hexstr
(
h
.
digest
()),
h
.
hexdigest
())
def
test_digest_length_overflow
(
self
):
# See issue #34922
large_sizes
=
(
2
**
29
,
2
**
32
-
10
,
2
**
32
+
10
,
2
**
61
,
2
**
64
-
10
,
2
**
64
+
10
)
for
cons
in
self
.
hash_constructors
:
h
=
cons
()
if
h
.
name
not
in
self
.
shakes
:
continue
for
digest
in
h
.
digest
,
h
.
hexdigest
:
self
.
assertRaises
(
ValueError
,
digest
,
-
10
)
for
length
in
large_sizes
:
with
self
.
assertRaises
((
ValueError
,
OverflowError
)):
digest
(
length
)
def
test_name_attribute
(
self
):
for
cons
in
self
.
hash_constructors
:
h
=
cons
()
...
...
Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst
0 → 100644
Dosyayı görüntüle @
9b8c2e76
Fixed integer overflow in the :meth:`~hashlib.shake.digest()` and
:meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm
in the :mod:`hashlib` module.
Modules/_sha3/sha3module.c
Dosyayı görüntüle @
9b8c2e76
...
...
@@ -589,6 +589,10 @@ _SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex)
int
res
;
PyObject
*
result
=
NULL
;
if
(
digestlen
>=
(
1
<<
29
))
{
PyErr_SetString
(
PyExc_ValueError
,
"length is too large"
);
return
NULL
;
}
/* ExtractLane needs at least SHA3_MAX_DIGESTSIZE + SHA3_LANESIZE and
* SHA3_LANESIZE extra space.
*/
...
...
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