diff --git a/scapy/layers/isakmp.py b/scapy/layers/isakmp.py index 001728195d5..da5c5e9b8ab 100644 --- a/scapy/layers/isakmp.py +++ b/scapy/layers/isakmp.py @@ -409,10 +409,16 @@ class ISAKMP_payload_SA(ISAKMP_payload): class ISAKMP_payload_Nonce(ISAKMP_payload): name = "ISAKMP Nonce" + fields_desc = ISAKMP_payload.fields_desc[:3] + [ + StrLenField("nonce", "", length_from=lambda x: x.length - 4) + ] class ISAKMP_payload_KE(ISAKMP_payload): name = "ISAKMP Key Exchange" + fields_desc = ISAKMP_payload.fields_desc[:3] + [ + StrLenField("ke", "", length_from=lambda x: x.length - 4) + ] class ISAKMP_payload_ID(ISAKMP_payload): @@ -439,7 +445,15 @@ class ISAKMP_payload_ID(ISAKMP_payload): class ISAKMP_payload_Hash(ISAKMP_payload): name = "ISAKMP Hash" + fields_desc = ISAKMP_payload.fields_desc[:3] + [ + StrLenField("hash", "", length_from=lambda x: x.length - 4) + ] +class ISAKMP_payload_SIG(ISAKMP_payload): + name = "ISAKMP Signature" + fields_desc = ISAKMP_payload.fields_desc[:3] + [ + StrLenField("sig", "", length_from=lambda x: x.length - 4) + ] NotifyMessageType = { 1: "INVALID-PAYLOAD-TYPE", @@ -471,6 +485,8 @@ class ISAKMP_payload_Hash(ISAKMP_payload): 27: "NOTIFY-SA-LIFETIME", 28: "CERTIFICATE-UNAVAILABLE", 29: "UNSUPPORTED-EXCHANGE-TYPE", + 30: "UNEQUAL-PAYLOAD-LENGTHS", + 16384: "CONNECTED", # RFC 3706 36136: "R-U-THERE", 36137: "R-U-THERE-ACK", @@ -520,7 +536,7 @@ class ISAKMP_payload_Delete(ISAKMP_payload): # bind_layers(_ISAKMP_class, ISAKMP_payload_CERT, next_payload=6) # bind_layers(_ISAKMP_class, ISAKMP_payload_CR, next_payload=7) bind_layers(_ISAKMP_class, ISAKMP_payload_Hash, next_payload=8) -# bind_layers(_ISAKMP_class, ISAKMP_payload_SIG, next_payload=9) +bind_layers(_ISAKMP_class, ISAKMP_payload_SIG, next_payload=9) bind_layers(_ISAKMP_class, ISAKMP_payload_Nonce, next_payload=10) bind_layers(_ISAKMP_class, ISAKMP_payload_Notify, next_payload=11) bind_layers(_ISAKMP_class, ISAKMP_payload_Delete, next_payload=12)