tests: Encode Disconnect-Request attributes in sorted order for python3
This is needed to fix issues with dict iteration resulting in different order of attributes when trying to calculate Message-Authenticator externally to pyrad. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
55845e190b
commit
200ac5daf6
2 changed files with 8 additions and 2 deletions
|
@ -730,7 +730,10 @@ def add_message_auth_req(req):
|
|||
|
||||
# request attributes
|
||||
req.AddAttribute("Message-Authenticator", 16*b"\x00")
|
||||
attrs = req._PktEncodeAttributes()
|
||||
attrs = b''
|
||||
for code,datalst in sorted(req.items()):
|
||||
for data in datalst:
|
||||
attrs += req._PktEncodeAttribute(code, data)
|
||||
|
||||
# Length
|
||||
flen = 4 + 16 + len(attrs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue