Skip to content

Commit 3789c7c

Browse files
committed
only enable one of password-argon2 or openssl-argon2
1 parent 4fb4e42 commit 3789c7c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

config/ext.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,10 @@
531531
},
532532
"notes": true,
533533
"type": "builtin",
534-
"arg-type": "with-path",
534+
"arg-type": "custom",
535535
"lib-depends": [
536-
"libargon2"
536+
"libargon2",
537+
"openssl"
537538
]
538539
},
539540
"pcntl": {

src/SPC/builder/extension/openssl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getUnixConfigureArg(bool $shared = false): string
2828
{
2929
$openssl_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-openssl-dir=' . BUILD_ROOT_PATH;
3030
$args = '--with-openssl=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $openssl_dir;
31-
if ($this->builder->getPHPVersionID() >= 80500 || !$this->builder->getOption('enable-zts')) {
31+
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
3232
$args .= ' --with-openssl-argon2 OPENSSL_LIBS="-lz"';
3333
}
3434
return $args;
@@ -37,7 +37,7 @@ public function getUnixConfigureArg(bool $shared = false): string
3737
public function getWindowsConfigureArg(bool $shared = false): string
3838
{
3939
$args = '--with-openssl';
40-
if ($this->builder->getPHPVersionID() >= 80500) {
40+
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
4141
$args .= ' --with-openssl-argon2';
4242
}
4343
return $args;

src/SPC/builder/extension/password_argon2.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,14 @@ public function patchBeforeMake(): bool
4242
}
4343
return $patched;
4444
}
45+
46+
public function getConfigureArg(bool $shared = false): string
47+
{
48+
if ($this->builder->getLib('openssl') !== null) {
49+
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
50+
return '--without-password-argon2'; // use --with-openssl-argon2 in openssl extension instead
51+
}
52+
}
53+
return '--with-password-argon2';
54+
}
4555
}

0 commit comments

Comments
 (0)