processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/ejabberd/
Other
6.11k stars 1.51k forks source link

mod_scram_upgrade - add example to config #4301

Open licaon-kter opened 2 weeks ago

licaon-kter commented 2 weeks ago

reading https://docs.ejabberd.im/admin/configuration/modules/#mod_scram_upgrade

and then reading https://docs.ejabberd.im/admin/configuration/toplevel/#auth_scram_hash I see

You shouldn’t change this if you already have passwords generated with a different algorithm - users that have such passwords will not be able to authenticate.

gets me confused

if auth_scram_hash is The default value is sha then how can I upgrade?

badlop commented 5 days ago

The only thing I can say for sure is what I tried:

auth_scram_hash

You shouldn’t change this if you already have passwords generated with a different algorithm - users that have such passwords will not be able to authenticate.

If you setup auth_scram_hash: sha, start ejabberd and register some accounts, their passwords are stored in sha format.

If you then change to auth_scram_hash: sha256, restart ejabberd:


I wonder how exactly mod_scram_upgrade is designed to be used in practice by an administrator, its use-case.

For example, let's imagine it's SHA-1 right now and SHA-256 is desired. With the configuration is like this:

auth_password_format: scram
auth_scram_hash: sha

Then what should the admin setup?

A) Store new as sha, offer upgrade to sha256?

auth_password_format: scram
auth_scram_hash: sha

modules:
  mod_scram_upgrade:
    offered_upgrades:
      - sha256

B) Store the new as sha256, offer upgrade to sha256?

auth_password_format: scram
auth_scram_hash: sha256

modules:
  mod_scram_upgrade:
    offered_upgrades:
      - sha256

@prefiks any idea here?


I also wonder what clients already support XEP-0480 to test the feature

Neustradamus commented 4 days ago

Currently, I know Monal IM which supports it:

It has been requested for XMPP Clients:

It has been requested for XMPP Library:

It has been requested for XMPP Server:

XEP-0480 is linked to this @tmolitor-stud-tu initial request:

tmolitor-stud-tu commented 3 days ago

@badlop I guess it is option B) Store the new as sha256, offer upgrade to sha256?