Skip to content

Commit 4769aad

Browse files
committed
Added support for SCRAM-SHA-*, SCRAM-SHA3-*
1 parent 8925e21 commit 4769aad

File tree

15 files changed

+488
-1090
lines changed

15 files changed

+488
-1090
lines changed

README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,10 @@ To launch the servers you can use the provided Docker Compose file.
107107
Just [install Docker](https://www.docker.com/get-started/) and run:
108108

109109
```
110-
docker-compose up -d
110+
docker compose up -d
111111
```
112112

113-
**Note:** ejabberd takes around *ten minutes* to start.
114-
115-
### Vagrant (Deprecated)
116-
117-
To launch the servers you can use the provided Vagrant box.
118-
Just [install Vagrant](https://www.vagrantup.com/downloads) and run:
119-
120-
```
121-
vagrant up
122-
```
123-
124-
After some minutes you'll have the runnig server instances inside of a virtual machine.
113+
**Note:** ejabberd takes up to *twenty minutes* to start.
125114

126115
### RUN
127116

Vagrantfile

Lines changed: 0 additions & 147 deletions
This file was deleted.

behat.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ default:
33
authentication_features:
44
paths: [ "%paths.base%/tests/features/" ]
55
contexts:
6-
- Fabiang\Sasl\Behat\XmppContext:
6+
- Fabiang\Sasl\Behat\XMPPContext:
77
- localhost
88
- 15222
9-
- ubuntu-xenial
9+
- localhost
1010
- testuser
1111
- testpass
1212
- "%paths.base%/tests/log/features/"
13-
- Fabiang\Sasl\Behat\Pop3Context:
13+
- Fabiang\Sasl\Behat\POP3Context:
1414
- localhost
1515
- 11110
1616
- vmail

docker-compose.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
version: '3'
22
services:
33
xmpp:
4-
image: rroemhild/ejabberd:18.12
5-
hostname: ubuntu-xenial
4+
image: ejabberd/ecs:${EJABBERD_VERSION:-23.10}
65
volumes:
7-
- "./tests/config/ejabberd/ejabberd.yml.tpl:/opt/ejabberd/conf/ejabberd.yml.tpl"
8-
- "./tests/config/ejabberd/ejabberd.db:/opt/ejabberd/database/ejabberd.db"
9-
environment:
10-
- XMPP_DOMAIN=ubuntu-xenial
11-
- "EJABBERD_USERS=testuser@ubuntu-xenial:testpass admin@ubuntu-xenial"
12-
- EJABBERD_ADMINS=admin@ubuntu-xenial
13-
- TZ=Europe/Berlin
14-
- EJABBERD_STARTTLS=false
15-
- EJABBERD_S2S_SSL=false
16-
- EJABBERD_SKIP_MAKE_SSLCERT=true
17-
- EJABBERD_LOGLEVEL=5
18-
- EJABBERD_DEBUG_MODE=true
19-
- EJABBERD_AUTH_METHOD=sql
20-
- EJABBERD_AUTH_PASSWORD_FORMAT=plain
21-
- EJABBERD_CONFIGURE_ODBC=true
22-
- EJABBERD_ODBC_TYPE=sqlite
23-
- EJABBERD_ODBC_DATABASE=/opt/ejabberd/database/ejabberd.db
6+
- "./tests/config/ejabberd/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml"
7+
- "./tests/config/ejabberd/ejabberd.db:/home/ejabberd/database/ejabberd.db"
248
ports:
259
- "15222:5222"
10+
environment:
11+
- CTL_ON_CREATE=register testuser localhost testpass
2612

2713
mail:
2814
image: dovecot/dovecot:2.3.18

src/Authentication/SCRAM.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct(Options $options, $hash)
7676

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

8181
$hashAlgos = hash_algos();
8282
if (!in_array($normalizedHash, $hashAlgos)) {

0 commit comments

Comments
 (0)