Skip to content

Commit

Permalink
fix python 3.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
GIC-de committed Oct 19, 2019
1 parent e4adf7e commit 046cecc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 2 additions & 6 deletions pyrad/tests/testPacket.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,8 @@ def setUp(self):
def testVerifyChapPasswd(self):
chap_id = b'9'
chap_challenge = b'987654321'
chap_password = b'%s%s' % (chap_id, md5_constructor(
b'%s%s%s' % (
chap_id,
b'test_password',
chap_challenge
)).digest())
chap_password = chap_id + md5_constructor(
chap_id + b'test_password' + chap_challenge).digest()
pkt = self.client.CreateAuthPacket(
code=packet.AccessChallenge,
authenticator=b'ABCDEFG',
Expand Down
5 changes: 2 additions & 3 deletions pyrad/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ def EncodeAscendBinary(str):
terms[key] = struct.pack('B', int(value))

trailer = 8 * b'\x00'
result = b'%s%s%s\x00%s%s%s%s%s\x00%s%s%s%s\x00\x00%s' % (
result = b'%s%s%s\x00%s%s%s%s%s\x00%s%s%s%s\x00\x00' % (
terms['family'], terms['action'], terms['direction'], terms['src'],
terms['dst'], terms['srcl'], terms['dstl'], terms['proto'],
terms['sport'], terms['dport'], terms['sportq'], terms['dportq'],
trailer)
terms['sport'], terms['dport'], terms['sportq'], terms['dportq']) + trailer
return result


Expand Down

0 comments on commit 046cecc

Please sign in to comment.