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
9424bb4a
Kaydet (Commit)
9424bb4a
authored
Haz 17, 2013
tarafından
Christian Heimes
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds
in ASN1_TIME fields.
üst
78be6e8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
test_ssl.py
Lib/test/test_ssl.py
+16
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_ssl.py
Dosyayı görüntüle @
9424bb4a
...
...
@@ -6,6 +6,7 @@ from test import support
import
socket
import
select
import
time
import
datetime
import
gc
import
os
import
errno
...
...
@@ -73,6 +74,19 @@ def no_sslv2_implies_sslv3_hello():
# 0.9.7h or higher
return
ssl
.
OPENSSL_VERSION_INFO
>=
(
0
,
9
,
7
,
8
,
15
)
def
asn1time
(
cert_time
):
# Some versions of OpenSSL ignore seconds, see #18207
# 0.9.8.i
if
ssl
.
_OPENSSL_API_VERSION
==
(
0
,
9
,
8
,
9
,
15
):
fmt
=
"
%
b
%
d
%
H:
%
M:
%
S
%
Y GMT"
dt
=
datetime
.
datetime
.
strptime
(
cert_time
,
fmt
)
dt
=
dt
.
replace
(
second
=
0
)
cert_time
=
dt
.
strftime
(
fmt
)
# %d adds leading zero but ASN1_TIME_print() uses leading space
if
cert_time
[
4
]
==
"0"
:
cert_time
=
cert_time
[:
4
]
+
" "
+
cert_time
[
5
:]
return
cert_time
# Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
def
skip_if_broken_ubuntu_ssl
(
func
):
...
...
@@ -142,8 +156,8 @@ class BasicSocketTests(unittest.TestCase):
((
'commonName'
,
'localhost'
),))
)
# Note the next three asserts will fail if the keys are regenerated
self
.
assertEqual
(
p
[
'notAfter'
],
'Oct 5 23:01:56 2020 GMT'
)
self
.
assertEqual
(
p
[
'notBefore'
],
'Oct 8 23:01:56 2010 GMT'
)
self
.
assertEqual
(
p
[
'notAfter'
],
asn1time
(
'Oct 5 23:01:56 2020 GMT'
)
)
self
.
assertEqual
(
p
[
'notBefore'
],
asn1time
(
'Oct 8 23:01:56 2010 GMT'
)
)
self
.
assertEqual
(
p
[
'serialNumber'
],
'D7C7381919AFC24E'
)
self
.
assertEqual
(
p
[
'subject'
],
(((
'countryName'
,
'XY'
),),
...
...
Misc/NEWS
Dosyayı görüntüle @
9424bb4a
...
...
@@ -409,6 +409,9 @@ Library
Tests
-----
-
Issue
#
18207
:
Fix
test_ssl
for
some
versions
of
OpenSSL
that
ignore
seconds
in
ASN1_TIME
fields
.
-
Issue
#
18094
:
test_uuid
no
more
reports
skipped
tests
as
passed
.
-
Issue
#
17992
:
Add
timeouts
to
asyncore
and
asynchat
tests
so
that
they
won
't
...
...
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