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
4ac01f0f
Kaydet (Commit)
4ac01f0f
authored
Mar 17, 2017
tarafından
Mariatta
Kaydeden (comit)
GitHub
Mar 17, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
update test_socket AEAD test for kernel 4.9 and up (GH-133) (GH-548)
(cherry picked from commit
9764c151
)
üst
3fce38c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
test_socket.py
Lib/test/test_socket.py
+7
-8
No files found.
Lib/test/test_socket.py
Dosyayı görüntüle @
4ac01f0f
...
...
@@ -5479,7 +5479,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
self
.
assertEqual
(
len
(
dec
),
msglen
*
multiplier
)
self
.
assertEqual
(
dec
,
msg
*
multiplier
)
@support.requires_linux_version
(
4
,
3
)
# see test_aes_cbc
@support.requires_linux_version
(
4
,
9
)
# see issue29324
def
test_aead_aes_gcm
(
self
):
key
=
bytes
.
fromhex
(
'c939cc13397c1d37de6ae0e1cb7c423c'
)
iv
=
bytes
.
fromhex
(
'b3d8cc017cbb89b39e0f67e2'
)
...
...
@@ -5502,8 +5502,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
op
.
sendmsg_afalg
(
op
=
socket
.
ALG_OP_ENCRYPT
,
iv
=
iv
,
assoclen
=
assoclen
,
flags
=
socket
.
MSG_MORE
)
op
.
sendall
(
assoc
,
socket
.
MSG_MORE
)
op
.
sendall
(
plain
,
socket
.
MSG_MORE
)
op
.
sendall
(
b
'
\x00
'
*
taglen
)
op
.
sendall
(
plain
)
res
=
op
.
recv
(
assoclen
+
len
(
plain
)
+
taglen
)
self
.
assertEqual
(
expected_ct
,
res
[
assoclen
:
-
taglen
])
self
.
assertEqual
(
expected_tag
,
res
[
-
taglen
:])
...
...
@@ -5511,7 +5510,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
# now with msg
op
,
_
=
algo
.
accept
()
with
op
:
msg
=
assoc
+
plain
+
b
'
\x00
'
*
taglen
msg
=
assoc
+
plain
op
.
sendmsg_afalg
([
msg
],
op
=
socket
.
ALG_OP_ENCRYPT
,
iv
=
iv
,
assoclen
=
assoclen
)
res
=
op
.
recv
(
assoclen
+
len
(
plain
)
+
taglen
)
...
...
@@ -5522,7 +5521,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
pack_uint32
=
struct
.
Struct
(
'I'
)
.
pack
op
,
_
=
algo
.
accept
()
with
op
:
msg
=
assoc
+
plain
+
b
'
\x00
'
*
taglen
msg
=
assoc
+
plain
op
.
sendmsg
(
[
msg
],
([
socket
.
SOL_ALG
,
socket
.
ALG_SET_OP
,
pack_uint32
(
socket
.
ALG_OP_ENCRYPT
)],
...
...
@@ -5530,7 +5529,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
[
socket
.
SOL_ALG
,
socket
.
ALG_SET_AEAD_ASSOCLEN
,
pack_uint32
(
assoclen
)],
)
)
res
=
op
.
recv
(
len
(
msg
))
res
=
op
.
recv
(
len
(
msg
)
+
taglen
)
self
.
assertEqual
(
expected_ct
,
res
[
assoclen
:
-
taglen
])
self
.
assertEqual
(
expected_tag
,
res
[
-
taglen
:])
...
...
@@ -5540,8 +5539,8 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
msg
=
assoc
+
expected_ct
+
expected_tag
op
.
sendmsg_afalg
([
msg
],
op
=
socket
.
ALG_OP_DECRYPT
,
iv
=
iv
,
assoclen
=
assoclen
)
res
=
op
.
recv
(
len
(
msg
))
self
.
assertEqual
(
plain
,
res
[
assoclen
:
-
taglen
])
res
=
op
.
recv
(
len
(
msg
)
-
taglen
)
self
.
assertEqual
(
plain
,
res
[
assoclen
:])
@support.requires_linux_version
(
4
,
3
)
# see test_aes_cbc
def
test_drbg_pr_sha256
(
self
):
...
...
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