Esempio n. 1
0
 def test_makePayloadWithDigest_custom(self):
     payload = ''.join([chr(i) for i in range(256)])
     digest = '\xff\xff\xff\xff'
     new_payload = util._makePayloadWithDigest(payload, digest=digest)
     self.assertEqual(
         new_payload, ''.join([chr(i) for i in range(5)]) + digest +
         ''.join([chr(i) for i in range(9, 256)]))
Esempio n. 2
0
 def test_makePayloadWithDigest_custom(self):
     payload = ''.join([chr(i) for i in range(256)])
     digest = '\xff\xff\xff\xff'
     new_payload = util._makePayloadWithDigest(payload, digest=digest)
     self.assertEqual(new_payload,
         ''.join([chr(i) for i in range(5)]) + digest +
         ''.join([chr(i) for i in range(9, 256)]))
Esempio n. 3
0
 def test_makePayloadWithDigest_default_empty(self):
     '''
     payload = ''.join[chr(i) for i in range(514)]
     digest = '\xff\xff\xff\xff'
     new_payload = util._makePayloadWithDigest(payload, digest=digest)
     '''
     payload = ''.join([chr(i) for i in range(256)])
     default_empty = '\x00\x00\x00\x00'
     new_payload = util._makePayloadWithDigest(payload)
     self.assertEqual(
         new_payload, ''.join([chr(i) for i in range(5)]) + default_empty +
         ''.join([chr(i) for i in range(9, 256)]))
Esempio n. 4
0
 def test_makePayloadWithDigest_default_empty(self):
     '''
     payload = ''.join[chr(i) for i in range(514)]
     digest = '\xff\xff\xff\xff'
     new_payload = util._makePayloadWithDigest(payload, digest=digest)
     '''
     payload = ''.join([chr(i) for i in range(256)])
     default_empty = '\x00\x00\x00\x00'
     new_payload = util._makePayloadWithDigest(payload)
     self.assertEqual(new_payload,
         ''.join([chr(i) for i in range(5)]) + default_empty +
         ''.join([chr(i) for i in range(9, 256)]))