Skip to content
This repository has been archived by the owner on Jan 29, 2018. It is now read-only.

Don't try to handle encrypted attributes as UTF-8 strings #1

Merged
merged 2 commits into from
Nov 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions example/dictionary
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,29 @@
# directive to the end of the file if you want to see the old names
# in the logfiles too.
#
$INCLUDE dictionary.compat # compability issues
$INCLUDE dictionary.acc
$INCLUDE dictionary.ascend
$INCLUDE dictionary.bay
$INCLUDE dictionary.cisco
$INCLUDE dictionary.livingston
$INCLUDE dictionary.microsoft
$INCLUDE dictionary.quintum
$INCLUDE dictionary.redback
$INCLUDE dictionary.shasta
$INCLUDE dictionary.shiva
$INCLUDE dictionary.tunnel
$INCLUDE dictionary.usr
$INCLUDE dictionary.versanet
$INCLUDE dictionary.erx
$INCLUDE dictionary.freeradius
$INCLUDE dictionary.alcatel
#$INCLUDE dictionary.compat # compability issues
#$INCLUDE dictionary.acc
#$INCLUDE dictionary.ascend
#$INCLUDE dictionary.bay
#$INCLUDE dictionary.cisco
#$INCLUDE dictionary.livingston
#$INCLUDE dictionary.microsoft
#$INCLUDE dictionary.quintum
#$INCLUDE dictionary.redback
#$INCLUDE dictionary.shasta
#$INCLUDE dictionary.shiva
#$INCLUDE dictionary.tunnel
#$INCLUDE dictionary.usr
#$INCLUDE dictionary.versanet
#$INCLUDE dictionary.erx
#$INCLUDE dictionary.freeradius
#$INCLUDE dictionary.alcatel

#
# Following are the proper new names. Use these.
#
ATTRIBUTE User-Name 1 string
ATTRIBUTE User-Password 2 string
ATTRIBUTE User-Password 2 string encrypt=1
ATTRIBUTE CHAP-Password 3 octets
ATTRIBUTE NAS-IP-Address 4 ipaddr
ATTRIBUTE NAS-Port 5 integer
Expand Down
5 changes: 4 additions & 1 deletion pyrad/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ def _DecodeValue(self, attr, value):
if attr.values.HasBackward(value):
return attr.values.GetBackward(value)
else:
return tools.DecodeAttr(attr.type, value)
if attr.encrypt:
return tools.DecodeAttr('octets', value)
else:
return tools.DecodeAttr(attr.type, value)

def _EncodeValue(self, attr, value):
if attr.values.HasForward(value):
Expand Down