Giter Site home page Giter Site logo

Comments (4)

muirmanders avatar muirmanders commented on September 3, 2024

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.

chrisdew avatar chrisdew commented on September 3, 2024

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.

muirmanders avatar muirmanders commented on September 3, 2024

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.

chrisdew avatar chrisdew commented on September 3, 2024

Code was written and merged in 36248dc and 475bba0

from node-radius.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.