Exemple #1
0
 def checkDistribution(dist):
     pm = packetmorpher.new(dist)
     for i in range(0, const.MTU + 2):
         padLen = pm.calcPadding(i)
         self.assertTrue(const.HDR_LENGTH <= \
                         padLen < \
                         (const.MTU + const.HDR_LENGTH))
    def test2_getPadding(self):
        pm = packetmorpher.new()
        sendCrypter = mycrypto.PayloadCrypter()
        sendCrypter.setSessionKey("A" * 32, "A" * 8)
        sendHMAC = "A" * 32

        for i in xrange(0, const.MTU + 2):
            padLen = len(pm.getPadding(sendCrypter, sendHMAC, i))
            self.assertTrue(const.HDR_LENGTH <= padLen < const.MTU + const.HDR_LENGTH)
Exemple #3
0
    def test2_getPadding(self):
        pm = packetmorpher.new()
        sendCrypter = mycrypto.PayloadCrypter()
        sendCrypter.setSessionKey("A" * 32, "A" * 8)
        sendHMAC = "A" * 32

        for i in range(0, const.MTU + 2):
            padLen = len(pm.getPadding(sendCrypter, sendHMAC, i))
            self.assertTrue(const.HDR_LENGTH <= padLen < const.MTU + \
                            const.HDR_LENGTH)
 def checkDistribution(dist):
     pm = packetmorpher.new(dist)
     for i in xrange(0, const.MTU + 2):
         padLen = pm.calcPadding(i)
         self.assertTrue(const.HDR_LENGTH <= padLen < (const.MTU + const.HDR_LENGTH))