summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yaml41
-rw-r--r--README.md11
-rw-r--r--config.w3214
-rw-r--r--package.xml2
4 files changed, 62 insertions, 6 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index a18dd09..9277819 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -5,13 +5,13 @@ on:
- master
pull_request:
jobs:
- Linux_EL:
+ Linux_EL9:
runs-on: ubuntu-latest
strategy:
matrix:
distro: ['rockylinux']
el: [9]
- php: [0, '8.1', '8.2', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3', 'remi-8.4']
+ php: [0, '8.2', '8.3', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3', 'remi-8.4']
container:
image: ${{ matrix.distro }}:${{ matrix.el }}
steps:
@@ -37,11 +37,46 @@ jobs:
TEST_PHP_ARGS: '-q --show-diff'
run: |
make test
+ Linux_EL10:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ distro: ['almalinux']
+ el: [10]
+ php: [0, 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3', 'remi-8.4']
+ container:
+ image: ${{ matrix.distro }}:${{ matrix.el }}
+ steps:
+ - name: Install gzip
+ run: |
+ dnf install -y "gzip"
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Setup PHP module
+ if: ${{ matrix.php }}
+ run: |
+ dnf install -y "https://rpms.remirepo.net/enterprise/remi-release-${{ matrix.el }}.rpm"
+ dnf module enable -y "php:${{ matrix.php }}"
+ - name: Install PHP
+ run: |
+ dnf install -y "php" "php-devel" "libxcrypt-devel"
+ - name: Show PHP version
+ run: php -v
+ - name: Make php-xpass
+ run: |
+ phpize
+ ./configure
+ make -j"$(nproc)"
+ - name: Test php-xpass
+ env:
+ TEST_PHP_ARGS: '-q --show-diff'
+ run: |
+ make test
Linux_Fedora:
runs-on: ubuntu-latest
strategy:
matrix:
- fedora: [39, 40, 41]
+ fedora: [41, 42]
php: [0, 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3', 'remi-8.4']
container:
image: fedora:${{ matrix.fedora }}
diff --git a/README.md b/README.md
index 37bf868..3b8b354 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
+[![CI](https://github.com/remicollet/php-xpass/actions/workflows/ci.yaml/badge.svg)](https://github.com/remicollet/php-xpass/actions/workflows/ci.yaml)
+
+
# xpass extension for PHP
This extension provides password hashing algorithms used by Linux distributions.
@@ -13,7 +16,7 @@ It also provides additional functions from libxcrypt missing in core PHP:
* `crypt_gensalt`: encode settings for passphrase hashing
* `crypt_checksalt`: validate a crypt setting string
-See the Linux man pages.
+See the Linux man pages or [PHP Documentation](https://www.php.net/xpass)
**Computation time**
@@ -35,6 +38,8 @@ See the Linux man pages.
Compatible with PHP 8.0 or greater.
+It is recommended to ensure PHP is built using `--with-external-libcrypt` option.
+
You need the Extended crypt library development files (libxcrypt-devel, libcrypt-dev)
version 4.4 or greater.
@@ -45,11 +50,11 @@ From the sources tree
$ make
$ make test
-From https://pecl.php.net/
+From https://pecl.php.net/ using pecl command
$ pecl install xpass
-Using https://packagist.org/
+From https://packagist.org/ using PHP Installer for Extensions
$ pie install remi/xpass
diff --git a/config.w32 b/config.w32
new file mode 100644
index 0000000..5f8b6cf
--- /dev/null
+++ b/config.w32
@@ -0,0 +1,14 @@
+ARG_ENABLE("xpass", "Enable xpass support", "no");
+
+if (PHP_XPASS != "no") {
+ if (CHECK_LIB("crypt.lib", "xpass", PHP_XPASS)
+ && CHECK_HEADER_ADD_INCLUDE("crypt.h", "CLFAGS_XPASS", PHP_XPASS)
+ && CHECK_LIB("bcrypt.lib", "xpass", PHP_XPASS)) {
+ AC_DEFINE("HAVE_XPASS", 1, "Have xpass support");
+ EXTENSION("xpass", "xpass.c");
+ AC_DEFINE("HAVE_CRYPT_YESCRYPT", 1, "Have yescrypt hash support");
+ AC_DEFINE("HAVE_CRYPT_SHA512", 1, "Have sha512 hash support");
+ } else {
+ WARNING("xpass not enabled; libraries and headers not found");
+ }
+}
diff --git a/package.xml b/package.xml
index 1a90f12..cd7789b 100644
--- a/package.xml
+++ b/package.xml
@@ -15,6 +15,8 @@ It also provides additional functions from libxcrypt missing in core PHP:
* crypt_preferred_method
* crypt_gensalt
* crypt_checksalt
+
+See PHP documentation on https://www.php.net/xpass
</description>
<lead>
<name>Remi Collet</name>