Skip to content

Commit

Permalink
Added support for SCRAM-SHA-*, SCRAM-SHA3-*
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiang committed Nov 20, 2023
1 parent 8925e21 commit 4769aad
Show file tree
Hide file tree
Showing 15 changed files with 488 additions and 1,090 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,10 @@ To launch the servers you can use the provided Docker Compose file.
Just [install Docker](https://www.docker.com/get-started/) and run:

```
docker-compose up -d
docker compose up -d
```

**Note:** ejabberd takes around *ten minutes* to start.

### Vagrant (Deprecated)

To launch the servers you can use the provided Vagrant box.
Just [install Vagrant](https://www.vagrantup.com/downloads) and run:

```
vagrant up
```

After some minutes you'll have the runnig server instances inside of a virtual machine.
**Note:** ejabberd takes up to *twenty minutes* to start.

### RUN

Expand Down
147 changes: 0 additions & 147 deletions Vagrantfile

This file was deleted.

6 changes: 3 additions & 3 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ default:
authentication_features:
paths: [ "%paths.base%/tests/features/" ]
contexts:
- Fabiang\Sasl\Behat\XmppContext:
- Fabiang\Sasl\Behat\XMPPContext:
- localhost
- 15222
- ubuntu-xenial
- localhost
- testuser
- testpass
- "%paths.base%/tests/log/features/"
- Fabiang\Sasl\Behat\Pop3Context:
- Fabiang\Sasl\Behat\POP3Context:
- localhost
- 11110
- vmail
Expand Down
24 changes: 5 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
version: '3'
services:
xmpp:
image: rroemhild/ejabberd:18.12
hostname: ubuntu-xenial
image: ejabberd/ecs:${EJABBERD_VERSION:-23.10}
volumes:
- "./tests/config/ejabberd/ejabberd.yml.tpl:/opt/ejabberd/conf/ejabberd.yml.tpl"
- "./tests/config/ejabberd/ejabberd.db:/opt/ejabberd/database/ejabberd.db"
environment:
- XMPP_DOMAIN=ubuntu-xenial
- "EJABBERD_USERS=testuser@ubuntu-xenial:testpass admin@ubuntu-xenial"
- EJABBERD_ADMINS=admin@ubuntu-xenial
- TZ=Europe/Berlin
- EJABBERD_STARTTLS=false
- EJABBERD_S2S_SSL=false
- EJABBERD_SKIP_MAKE_SSLCERT=true
- EJABBERD_LOGLEVEL=5
- EJABBERD_DEBUG_MODE=true
- EJABBERD_AUTH_METHOD=sql
- EJABBERD_AUTH_PASSWORD_FORMAT=plain
- EJABBERD_CONFIGURE_ODBC=true
- EJABBERD_ODBC_TYPE=sqlite
- EJABBERD_ODBC_DATABASE=/opt/ejabberd/database/ejabberd.db
- "./tests/config/ejabberd/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml"
- "./tests/config/ejabberd/ejabberd.db:/home/ejabberd/database/ejabberd.db"
ports:
- "15222:5222"
environment:
- CTL_ON_CREATE=register testuser localhost testpass

mail:
image: dovecot/dovecot:2.3.18
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/SCRAM.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(Options $options, $hash)

// Though I could be strict, I will actually also accept the naming used in the PHP core hash framework.
// For instance "sha1" is accepted, while the registered hash name should be "SHA-1".
$normalizedHash = str_replace('-', '', strtolower($hash));
$normalizedHash = strtolower(preg_replace('#^sha-(\d+)#i', 'sha\1', $hash));

$hashAlgos = hash_algos();
if (!in_array($normalizedHash, $hashAlgos)) {
Expand Down
Loading

0 comments on commit 4769aad

Please sign in to comment.