Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not allowed multiple values of the same Attribute. #95

Closed
ccsalway opened this issue Sep 10, 2018 · 3 comments
Closed

Not allowed multiple values of the same Attribute. #95

ccsalway opened this issue Sep 10, 2018 · 3 comments
Assignees
Labels

Comments

@ccsalway
Copy link

According to RFC 2865 RADIUS, you should be able to send multiple values of the same attribute such as the Proxy-State

If any Proxy-State attributes were present in the Access-Request,
they MUST be copied unmodified and in order into the response packet.
Other Attributes can be placed before, after, or even between the
Proxy-State attributes.

Yet with pyrad, the last value only is what's sent.

req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest, User_Name="wichert")
req["NAS-Identifier"] = 'vpn.pod1'
req["NAS-Identifier"] = 'vpn.pod2'
@GIC-de GIC-de closed this as completed in abdc122 Oct 19, 2019
@GIC-de GIC-de self-assigned this Oct 19, 2019
@GIC-de GIC-de added the bug label Oct 19, 2019
@GIC-de
Copy link
Collaborator

GIC-de commented Oct 19, 2019

Fixed with abdc122 and should be included in next version 2.2 but you need to do this as described below:

req["NAS-Identifier"] = ['vpn.pod1', 'vpn.pod2']

@pallas
Copy link
Contributor

pallas commented May 9, 2020

In Python3, I'm getting Unexpected error: can't concat str to bytes because in SaltCrypt, self.authenticator is bytes but salt is str. Maybe

diff --git a/pyrad/packet.py b/pyrad/packet.py
index c6c54fe..d9ecebd 100644
--- a/pyrad/packet.py
+++ b/pyrad/packet.py
@@ -588,7 +588,7 @@ class Packet(OrderedDict):
         if len(buf) % 16 != 0:
             buf += six.b('\x00') * (16 - (len(buf) % 16))

-        last = self.authenticator + salt
+        last = self.authenticator + result
         while buf:
             hash = md5_constructor(self.secret + last).digest()
             if six.PY3:

is the right answer, but I'm not super familiar with RADIUS so I'm not sure.

@Istvan91
Copy link
Collaborator

Istvan91 commented May 9, 2020

What exactly are you trying? I don't see how this closed issue is relevant to your problem?

Which version of pyrad are you using? There is a fix for the "normal" usage of saltcrypt in the current master (there is no release yet.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants