Skip to content
Snippets Groups Projects
Commit 46eac338 authored by Lucas Pascal's avatar Lucas Pascal
Browse files

[fix] requested correction

parent 2e7a2582
No related branches found
No related tags found
No related merge requests found
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
SCTP (Stream Control Transmission Protocol). SCTP (Stream Control Transmission Protocol).
""" """
import os
import struct import struct
from scapy.volatile import RandBin
from scapy.config import conf from scapy.config import conf
from scapy.packet import * from scapy.packet import *
from scapy.fields import * from scapy.fields import *
...@@ -319,7 +319,7 @@ class SCTPChunkParamRandom(_SCTPChunkParam, Packet): ...@@ -319,7 +319,7 @@ class SCTPChunkParamRandom(_SCTPChunkParam, Packet):
fields_desc = [ ShortEnumField("type", 0x8002, sctpchunkparamtypes), fields_desc = [ ShortEnumField("type", 0x8002, sctpchunkparamtypes),
FieldLenField("len", None, length_of="random", FieldLenField("len", None, length_of="random",
adjust = lambda pkt,x:x+4), adjust = lambda pkt,x:x+4),
PadField(StrLenField("random", os.urandom(32), PadField(StrLenField("random", RandBin(32),
length_from=lambda pkt: pkt.len-4), length_from=lambda pkt: pkt.len-4),
4, padwith=b"\x00"),] 4, padwith=b"\x00"),]
......
...@@ -7892,6 +7892,11 @@ assert(p.len == 8) ...@@ -7892,6 +7892,11 @@ assert(p.len == 8)
assert(p.seq == 0) assert(p.seq == 0)
assert(p.params == []) assert(p.params == [])
= SCTPChunkParamRandom - Consecutive calls
~ sctp
param1, param2 = SCTPChunkParamRandom(), SCTPChunkParamRandom()
assert(param1.random != param2.random)
############ ############
############ ############
+ DHCP + DHCP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment