prevent encryption from adding newlines on long messages

This commit is contained in:
Mark Washenberger
2011-05-27 10:40:50 -04:00
parent bcf0c7c292
commit 3ff6e51a50

View File

@@ -594,6 +594,7 @@ class XenAPIDiffieHellmanTestCase(test.TestCase):
def _test_encryption(self, message):
enc = self.alice.encrypt(message)
print enc
self.assertFalse(enc.endswith('\n'))
dec = self.bob.decrypt(enc)
self.assertEquals(dec, message)
@@ -613,6 +614,9 @@ class XenAPIDiffieHellmanTestCase(test.TestCase):
def test_encrypt_with_leading_newlines(self):
self._test_encryption('\n\nMessage with leading newlines.')
def test_encrypt_really_long_message(self):
self._test_encryption(''.join(['abcd' for i in xrange(1024)]))
def tearDown(self):
super(XenAPIDiffieHellmanTestCase, self).tearDown()