mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix #12835: prevent use of the unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets (Patch by David Watson)
This commit is contained in:
parent
a89c32ccd9
commit
513886aabb
3 changed files with 26 additions and 0 deletions
|
@ -1651,6 +1651,14 @@ else:
|
|||
# consume data
|
||||
s.read()
|
||||
|
||||
# Make sure sendmsg et al are disallowed to avoid
|
||||
# inadvertent disclosure of data and/or corruption
|
||||
# of the encrypted data stream
|
||||
self.assertRaises(NotImplementedError, s.sendmsg, [b"data"])
|
||||
self.assertRaises(NotImplementedError, s.recvmsg, 100)
|
||||
self.assertRaises(NotImplementedError,
|
||||
s.recvmsg_into, bytearray(100))
|
||||
|
||||
s.write(b"over\n")
|
||||
s.close()
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue