Fix #12835: prevent use of the unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets (Patch by David Watson)

This commit is contained in:
Nick Coghlan 2011-08-28 00:00:27 +10:00
parent a89c32ccd9
commit 513886aabb
3 changed files with 26 additions and 0 deletions

View file

@ -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: