Fix: refresh message authentication when serialising
This commit is contained in:
@@ -183,6 +183,8 @@ class Packet(OrderedDict):
|
|||||||
|
|
||||||
def serialize(self) -> bytes:
|
def serialize(self) -> bytes:
|
||||||
"""Serialize the Packet to the RADIUS Line Format"""
|
"""Serialize the Packet to the RADIUS Line Format"""
|
||||||
|
if self.host.message_authenticator:
|
||||||
|
self.add_message_authenticator()
|
||||||
# TODO: This is not an abstract method
|
# TODO: This is not an abstract method
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@@ -298,17 +300,12 @@ class AcctPacket(Packet): # pylint: disable=abstract-method
|
|||||||
def increase_acct_delay_time(self, delay_time: float):
|
def increase_acct_delay_time(self, delay_time: float):
|
||||||
"""Increase the Accounting Delay Time
|
"""Increase the Accounting Delay Time
|
||||||
|
|
||||||
This method automatically adjust the Authenticator
|
|
||||||
and the Message-Authenticator (if present)
|
|
||||||
|
|
||||||
No check for the Accounting Codes are made, an
|
No check for the Accounting Codes are made, an
|
||||||
Accounting-Respones should not contain the
|
Accounting-Respones should not contain the
|
||||||
Acct-Delay-Time Attribute.
|
Acct-Delay-Time Attribute.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
self["Acct-Delay-Time"] += int(delay_time)
|
self["Acct-Delay-Time"] += int(delay_time)
|
||||||
if self.host.message_authenticator:
|
|
||||||
self.refresh_message_authenticator()
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user