diff options
| -rw-r--r-- | .github/workflows/ci.yaml | 43 | ||||
| -rw-r--r-- | CHANGELOG.md | 22 | ||||
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | package.xml | 1 | ||||
| -rw-r--r-- | xpass.c | 9 |
5 files changed, 70 insertions, 10 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7c0625f..7dcbf25 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', 'remi-8.5'] container: image: ${{ matrix.distro }}:${{ matrix.el }} steps: @@ -37,12 +37,47 @@ 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', 'remi-8.5'] + 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: [40, 41] - php: [0, 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3', 'remi-8.4'] + fedora: [42, 43] + php: [0, 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3', 'remi-8.4', 'remi-8.5'] container: image: fedora:${{ matrix.fedora }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e5ecd6c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Unreleased + +- + +# Version 1.1.0 - 2024-09-26 + +- add `crypt_gensalt(?string $prefix = null, int $count = 0): ?string {}` +- add `crypt_preferred_method(): ?string {}` +- add `crypt_checksalt(string $salt): int {}` +- add `CRYPT_PREFIX_*` and `CRYPT_SALT_*` constants + +# Version 1.0.0 - 2024-09-09 + +- first GA release + +# Version 1.0.0RC2 - 2024-09-02 + +- fix libxcrypt algorithm detection (@zeriyoshi) + +# Version 1.0.0RC2 - 2024-08-28 + +- first RC release @@ -1,3 +1,6 @@ +[](https://github.com/remicollet/php-xpass/actions/workflows/ci.yaml) + + # xpass extension for PHP This extension provides password hashing algorithms used by Linux distributions. @@ -35,6 +38,8 @@ See the Linux man pages or [PHP Documentation](https://www.php.net/xpass) 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. diff --git a/package.xml b/package.xml index cd7789b..7fb2348 100644 --- a/package.xml +++ b/package.xml @@ -49,6 +49,7 @@ See PHP documentation on https://www.php.net/xpass <file name="CREDITS" role="doc"/> <file name="LICENSE" role="doc"/> <file name="README.md" role="doc"/> + <file name="CHANGELOG.md" role="doc"/> <!-- tests --> <dir name ="tests"> <file name="crypt_checksalt.phpt" role="test"/> @@ -62,17 +62,16 @@ PHP_MINFO_FUNCTION(xpass) } /* }}} */ -static bool get_options(zend_array *options, zend_ulong *cost) { +static void get_options(zend_array *options, zend_ulong *cost) { zval *opt; *cost = 0; if (!options) { - return true; + return; } if ((opt = zend_hash_str_find(options, "cost", strlen("cost")))) { *cost = zval_get_long(opt); } - return true; } @@ -82,9 +81,7 @@ static zend_string *php_xpass_hash(const zend_string *password, zend_array *opti memset(&data, 0, sizeof(data)); - if (!get_options(options, &cost)) { - return NULL; - } + get_options(options, &cost); if ((ZSTR_LEN(password) >= CRYPT_MAX_PASSPHRASE_SIZE)) { zend_value_error("Password is too long"); return NULL; |
