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
a9dcdabc
Kaydet (Commit)
a9dcdabc
authored
Kas 12, 2015
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
always set OP_NO_SSLv3 by default (closes #25530)
üst
eda06c8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
test_ssl.py
Lib/test/test_ssl.py
+9
-9
NEWS
Misc/NEWS
+3
-0
_ssl.c
Modules/_ssl.c
+2
-0
No files found.
Lib/test/test_ssl.py
Dosyayı görüntüle @
a9dcdabc
...
@@ -674,12 +674,12 @@ class ContextTests(unittest.TestCase):
...
@@ -674,12 +674,12 @@ class ContextTests(unittest.TestCase):
@skip_if_broken_ubuntu_ssl
@skip_if_broken_ubuntu_ssl
def
test_options
(
self
):
def
test_options
(
self
):
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
# OP_ALL | OP_NO_SSLv2 is the default value
# OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
self
.
assertEqual
(
ssl
.
OP_ALL
|
ssl
.
OP_NO_SSLv2
,
ctx
.
options
)
ctx
.
options
|=
ssl
.
OP_NO_SSLv3
self
.
assertEqual
(
ssl
.
OP_ALL
|
ssl
.
OP_NO_SSLv2
|
ssl
.
OP_NO_SSLv3
,
self
.
assertEqual
(
ssl
.
OP_ALL
|
ssl
.
OP_NO_SSLv2
|
ssl
.
OP_NO_SSLv3
,
ctx
.
options
)
ctx
.
options
)
ctx
.
options
|=
ssl
.
OP_NO_TLSv1
self
.
assertEqual
(
ssl
.
OP_ALL
|
ssl
.
OP_NO_SSLv2
|
ssl
.
OP_NO_SSLv3
|
ssl
.
OP_NO_TLSv1
,
ctx
.
options
)
if
can_clear_options
():
if
can_clear_options
():
ctx
.
options
=
(
ctx
.
options
&
~
ssl
.
OP_NO_SSLv2
)
|
ssl
.
OP_NO_TLSv1
ctx
.
options
=
(
ctx
.
options
&
~
ssl
.
OP_NO_SSLv2
)
|
ssl
.
OP_NO_TLSv1
self
.
assertEqual
(
ssl
.
OP_ALL
|
ssl
.
OP_NO_TLSv1
|
ssl
.
OP_NO_SSLv3
,
self
.
assertEqual
(
ssl
.
OP_ALL
|
ssl
.
OP_NO_TLSv1
|
ssl
.
OP_NO_SSLv3
,
...
@@ -2172,17 +2172,17 @@ else:
...
@@ -2172,17 +2172,17 @@ else:
" SSL2 client to SSL23 server test unexpectedly failed:
\n
%
s
\n
"
" SSL2 client to SSL23 server test unexpectedly failed:
\n
%
s
\n
"
%
str
(
x
))
%
str
(
x
))
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
Tru
e
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
Fals
e
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
Tru
e
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
Fals
e
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_OPTIONAL
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
Tru
e
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
Fals
e
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_REQUIRED
)
...
@@ -2214,8 +2214,8 @@ else:
...
@@ -2214,8 +2214,8 @@ else:
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv3
,
ssl
.
PROTOCOL_TLSv1
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv3
,
ssl
.
PROTOCOL_TLSv1
,
False
)
if
no_sslv2_implies_sslv3_hello
():
if
no_sslv2_implies_sslv3_hello
():
# No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
# No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv3
,
ssl
.
PROTOCOL_SSLv23
,
True
,
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv3
,
ssl
.
PROTOCOL_SSLv23
,
client_options
=
ssl
.
OP_NO_SSLv2
)
False
,
client_options
=
ssl
.
OP_NO_SSLv2
)
@skip_if_broken_ubuntu_ssl
@skip_if_broken_ubuntu_ssl
def
test_protocol_tlsv1
(
self
):
def
test_protocol_tlsv1
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
a9dcdabc
...
@@ -107,6 +107,9 @@ Library
...
@@ -107,6 +107,9 @@ Library
at
the
end
if
the
FileInput
was
opened
with
binary
mode
.
at
the
end
if
the
FileInput
was
opened
with
binary
mode
.
Patch
by
Ryosuke
Ito
.
Patch
by
Ryosuke
Ito
.
-
Issue
#
25530
:
Disable
the
vulnerable
SSLv3
protocol
by
default
when
creating
ssl
.
SSLContext
.
-
Issue
#
25569
:
Fix
memory
leak
in
SSLSocket
.
getpeercert
().
-
Issue
#
25569
:
Fix
memory
leak
in
SSLSocket
.
getpeercert
().
-
Issue
#
21827
:
Fixed
textwrap
.
dedent
()
for
the
case
when
largest
common
-
Issue
#
21827
:
Fixed
textwrap
.
dedent
()
for
the
case
when
largest
common
...
...
Modules/_ssl.c
Dosyayı görüntüle @
a9dcdabc
...
@@ -2037,6 +2037,8 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -2037,6 +2037,8 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
options
=
SSL_OP_ALL
&
~
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
;
options
=
SSL_OP_ALL
&
~
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
;
if
(
proto_version
!=
PY_SSL_VERSION_SSL2
)
if
(
proto_version
!=
PY_SSL_VERSION_SSL2
)
options
|=
SSL_OP_NO_SSLv2
;
options
|=
SSL_OP_NO_SSLv2
;
if
(
proto_version
!=
PY_SSL_VERSION_SSL3
)
options
|=
SSL_OP_NO_SSLv3
;
SSL_CTX_set_options
(
self
->
ctx
,
options
);
SSL_CTX_set_options
(
self
->
ctx
,
options
);
#ifndef OPENSSL_NO_ECDH
#ifndef OPENSSL_NO_ECDH
...
...
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