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
bffb0bc0
Kaydet (Commit)
bffb0bc0
authored
Nis 30, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
In stdlib, use hashlib instead of deprecated md5 and sha modules.
üst
fa42bd7a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
17 deletions
+16
-17
upload.py
Lib/distutils/command/upload.py
+1
-1
pimp.py
Lib/plat-mac/pimp.py
+2
-2
poplib.py
Lib/poplib.py
+2
-2
test_stringprep.py
Lib/test/test_stringprep.py
+3
-3
test_unicodedata.py
Lib/test/test_unicodedata.py
+3
-3
urllib2.py
Lib/urllib2.py
+5
-6
No files found.
Lib/distutils/command/upload.py
Dosyayı görüntüle @
bffb0bc0
...
...
@@ -6,7 +6,7 @@ from distutils.errors import *
from
distutils.core
import
Command
from
distutils.spawn
import
spawn
from
distutils
import
log
from
md5
import
md5
from
hashlib
import
md5
import
os
import
socket
import
platform
...
...
Lib/plat-mac/pimp.py
Dosyayı görüntüle @
bffb0bc0
...
...
@@ -21,7 +21,7 @@ import urlparse
import
plistlib
import
distutils.util
import
distutils.sysconfig
import
md5
import
hashlib
import
tarfile
import
tempfile
import
shutil
...
...
@@ -693,7 +693,7 @@ class PimpPackage:
sys
.
stderr
.
write
(
"Warning: no MD5Sum for
%
s
\n
"
%
self
.
fullname
())
return
1
data
=
open
(
self
.
archiveFilename
,
'rb'
)
.
read
()
checksum
=
md5
.
new
(
data
)
.
hexdigest
()
checksum
=
hashlib
.
md5
(
data
)
.
hexdigest
()
return
checksum
==
self
.
_dict
[
'MD5Sum'
]
def
unpackPackageOnly
(
self
,
output
=
None
):
...
...
Lib/poplib.py
Dosyayı görüntüle @
bffb0bc0
...
...
@@ -295,8 +295,8 @@ class POP3:
m
=
self
.
timestamp
.
match
(
self
.
welcome
)
if
not
m
:
raise
error_proto
(
'-ERR APOP not supported by server'
)
import
md5
digest
=
md5
.
new
(
m
.
group
(
1
)
+
secret
)
.
digest
()
import
hashlib
digest
=
hashlib
.
md5
(
m
.
group
(
1
)
+
secret
)
.
digest
()
digest
=
''
.
join
(
map
(
lambda
x
:
'
%02
x'
%
ord
(
x
),
digest
))
return
self
.
_shortcmd
(
'APOP
%
s
%
s'
%
(
user
,
digest
))
...
...
Lib/test/test_stringprep.py
Dosyayı görüntüle @
bffb0bc0
...
...
@@ -2,7 +2,6 @@
# Since we don't have them, this test checks only a few codepoints.
from
test.test_support
import
verify
,
vereq
import
sha
import
stringprep
from
stringprep
import
*
...
...
@@ -73,6 +72,7 @@ verify(not in_table_d2(u"\u0040"))
# unicode database. Instead, stringprep.py asserts the version of
# the database.
# import hashlib
# predicates = [k for k in dir(stringprep) if k.startswith("in_table")]
# predicates.sort()
# for p in predicates:
...
...
@@ -83,6 +83,6 @@ verify(not in_table_d2(u"\u0040"))
# if f(unichr(i)):
# data[i] = "1"
# data = "".join(data)
# h =
sha.sha
()
# h =
hashlib.sha1
()
# h.update(data)
# print p,h.hexdigest()
# print p,
h.hexdigest()
Lib/test/test_unicodedata.py
Dosyayı görüntüle @
bffb0bc0
...
...
@@ -6,7 +6,7 @@
"""
#"
import
unittest
,
test
.
test_support
import
sha
import
hashlib
encoding
=
'utf-8'
...
...
@@ -19,7 +19,7 @@ class UnicodeMethodsTest(unittest.TestCase):
expectedchecksum
=
'a6555cd209d960dcfa17bfdce0c96d91cfa9a9ba'
def
test_method_checksum
(
self
):
h
=
sha
.
sha
()
h
=
hashlib
.
sha1
()
for
i
in
range
(
65536
):
char
=
unichr
(
i
)
data
=
[
...
...
@@ -79,7 +79,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
def
test_function_checksum
(
self
):
data
=
[]
h
=
sha
.
sha
()
h
=
hashlib
.
sha1
()
for
i
in
range
(
0x10000
):
char
=
unichr
(
i
)
...
...
Lib/urllib2.py
Dosyayı görüntüle @
bffb0bc0
...
...
@@ -88,14 +88,13 @@ import base64
import
ftplib
import
httplib
import
inspect
import
md5
import
hashlib
import
mimetypes
import
mimetools
import
os
import
posixpath
import
random
import
re
import
sha
import
socket
import
sys
import
time
...
...
@@ -869,8 +868,8 @@ class AbstractDigestAuthHandler:
# and server to avoid chosen plaintext attacks, to provide mutual
# authentication, and to provide some message integrity protection.
# This isn't a fabulous effort, but it's probably Good Enough.
dig
=
sha
.
new
(
"
%
s:
%
s:
%
s:
%
s"
%
(
self
.
nonce_count
,
nonce
,
time
.
ctime
(),
randombytes
(
8
)))
.
hexdigest
()
dig
=
hashlib
.
sha1
(
"
%
s:
%
s:
%
s:
%
s"
%
(
self
.
nonce_count
,
nonce
,
time
.
ctime
(),
randombytes
(
8
)))
.
hexdigest
()
return
dig
[:
16
]
def
get_authorization
(
self
,
req
,
chal
):
...
...
@@ -932,9 +931,9 @@ class AbstractDigestAuthHandler:
def
get_algorithm_impls
(
self
,
algorithm
):
# lambdas assume digest modules are imported at the top level
if
algorithm
==
'MD5'
:
H
=
lambda
x
:
md5
.
new
(
x
)
.
hexdigest
()
H
=
lambda
x
:
hashlib
.
md5
(
x
)
.
hexdigest
()
elif
algorithm
==
'SHA'
:
H
=
lambda
x
:
sha
.
new
(
x
)
.
hexdigest
()
H
=
lambda
x
:
hashlib
.
sha1
(
x
)
.
hexdigest
()
# XXX MD5-sess
KD
=
lambda
s
,
d
:
H
(
"
%
s:
%
s"
%
(
s
,
d
))
return
H
,
KD
...
...
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