Comments (4)
The secret is needed to decrypt the User-Password if present, and to verify the authenticator and/or Message-Authenticator . If the packet can be decoded but the authenticator does not match, the library throws a radius.InvalidSecretError exception with the decoded packet set as the exception's "decoded" attribute.
var decoded;
try {
decoded = radius.decode({packet: msg, secret: ''});
} catch (e) {
if (e instanceof radius.InvalidSecretError) {
decoded = e.decoded;
} else {
// handle other decoding error
}
}
from node-radius.
Thanks for your quick answer.
Would you be interested in a pull request so that decode
doesn't raise an InvalidSecretError
if secret is explicitly set as null
.
If it's not going to make it into the mainline code, I'll just use the code you wrote above.
from node-radius.
I would prefer adding a separate method to make it clear it is unsafe since it wouldn't force the user of the library to handle un-authenticatable messages. Also, passing in a null secret could very well be the result of an application error when using the library, in which case the accept-all-packets behavior might be unexpected.
from node-radius.
Code was written and merged in 36248dc and 475bba0
from node-radius.
Related Issues (20)
- Using with hostapd HOT 3
- How to pass custom attributes ? HOT 4
- Packet identifier number HOT 6
- Openwrt, Linux HOT 6
- Attributes without a tag have one after decoding HOT 2
- RADIUS server issue ChangeOfAuthorization (CoA) requests HOT 5
- Error in Freeradius with CHAP Password due to attribute length HOT 2
- Unable to get true from verify_response HOT 4
- Session-Timeout not working HOT 2
- At what condition I get the 'Vendor-Specific' attributes value in the decoded response HOT 4
- sending PEAP responses HOT 2
- dictionary.rfc2865 incorrect Class attribute definition HOT 2
- There is no password attr HOT 7
- Response verification fails for Status-Server response to FreeRADIUS HOT 5
- User-Password is not defined in my packet. HOT 4
- encode: invalid attributes - must give buffer for unknown attribute 'WISPr-Bandwitdth-Max-Down' HOT 7
- Active Directory integration HOT 2
- Chap Password - Active Directory HOT 2
- Dependency Dashboard
- Disconnect-Request not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-radius.