Giter VIP home page Giter VIP logo

Comments (8)

jmillan avatar jmillan commented on June 25, 2024

This will be fixed with the 'stale' parameter handling. Issue #18

from jssip.

ibc avatar ibc commented on June 25, 2024

Humm, I don't think this should depend on #18 (or maybe... but not sure). Regardless JsSIP reuses nonces or not, it could occur this case:

  • JsSIP sends un-REGISTER with credentials by reusing a previous nonce value.
  • 401 with "stale=true" since such a nonce has already been invalidated by the registrar. So this 401 contains a new nonce value.
  • JsSIP re-sends the un-REGISTER with new credentials according to the new nonce value.
  • The registrar is stupid and replies 401 again with "stale=true".

This CAN occur when using Asterisk, so a better improvement for this would be trying un-registration one more time.

from jssip.

jmillan avatar jmillan commented on June 25, 2024

@ibc Yes. I will try the stale stuff first anyway.

BTW this could be a known Asterisk bug.

from jssip.

jmillan avatar jmillan commented on June 25, 2024

Credential re-use has been implemented in 85ca354 5ed612 and 96b9f6c

The scenario described above should result in a registration failure IMHO. If JsSIP re-generates the credentials with a new response according to a new nonce value and it receives a 401 again, that means that the credentials are invalid or the server buggy, but I don't think re-sending the REGISTER would solve the problem anyway.

from jssip.

ibc avatar ibc commented on June 25, 2024

Please, recheck my issue description. The case exposed there is real and ugly, but still valid. And I insist: this has nothing to do with credentials reuse.

from jssip.

jmillan avatar jmillan commented on June 25, 2024

I mean, if the server responds 401 and an un-REGISTER is re-sent with re-calculated credendials, I think I should give the request as failed if receiving a 401 again. Don`t you?

from jssip.

ibc avatar ibc commented on June 25, 2024

If the second 401 has not "stale=true" then I agree at 100%. But in the case I describe (and that is a real case with Asterisk) the second 401 has "stale=true" and then I consider JsSIP should give it another chance for authentication with the new nonce.

It's ugly that Asterisk replies 401 and then another 401 with "stale=true" (it means "I've sent you this nonce for authenticating against me but then I invalidate it when you send me the Digest response"). Anyhow we should be ready for that.

from jssip.

jmillan avatar jmillan commented on June 25, 2024

JsSIP does already manage the defined situation. It is Asterisk compilant in that way.

from jssip.

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.