def test_no_spi(self): transform1 = Transform(Transform.Type.INTEG, Transform.IntegId.AUTH_HMAC_SHA1_96) transform2 = Transform(Transform.Type.PRF, Transform.PrfId.PRF_HMAC_SHA1) proposal = Proposal(20, Proposal.Protocol.IKE, b'', [transform1, transform2]) data = proposal.to_bytes() proposal = Proposal.parse(data) self.assertEqual(proposal.spi, b'')
def test_invalid_transform_header(self): data = self.object.to_bytes() with self.assertRaises(InvalidSyntax): Proposal.parse(data[:-5])