From 000caba4bc844634be435c51bf01cae830d972b1 Mon Sep 17 00:00:00 2001 From: Phil <phil@secdev.org> Date: Tue, 20 Oct 2009 17:18:52 +0200 Subject: [PATCH] Fixed RandASN1Object() in case of IP address object --- scapy/asn1/asn1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scapy/asn1/asn1.py b/scapy/asn1/asn1.py index 5e1866da..f333cbe3 100644 --- a/scapy/asn1/asn1.py +++ b/scapy/asn1/asn1.py @@ -20,6 +20,9 @@ class RandASN1Object(RandField): o = random.choice(self.objlist) if issubclass(o, ASN1_INTEGER): return o(int(random.gauss(0,1000))) + elif issubclass(o, ASN1_IPADDRESS): + z = RandIP()._fix() + return o(z) elif issubclass(o, ASN1_STRING): z = int(random.expovariate(0.05)+1) return o("".join([random.choice(self.chars) for i in range(z)])) -- GitLab