Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']
php-version: ['8.3', '8.4', '8.5']

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
with:
php-version: ${{ matrix.php-version }}

Expand All @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.6
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0
with:
enable_eslinter: false
enable_jsonlinter: true
Expand All @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Print OpenSSL version
Expand All @@ -56,7 +56,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, sodium, spl, xml
tools: composer
ini-values: error_reporting=E_ALL
coverage: pcov
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Print OpenSSL version
Expand All @@ -121,7 +121,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, sodium, spl, xml
tools: composer
ini-values: error_reporting=E_ALL
coverage: none
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.5'
tools: composer, composer-require-checker, composer-unused
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, sodium, spl, xml
coverage: none

- name: Setup problem matchers for PHP
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the lowest supported version
php-version: '8.2'
php-version: '8.3'
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
tools: composer
coverage: none
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
},
"require": {
"php": "^8.2",
"php": "^8.3",
"ext-dom": "*",
"ext-hash": "*",
"ext-mbstring": "*",
Expand All @@ -47,7 +47,7 @@
"simplesamlphp/xml-common": "~2.4"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "~1.10"
"simplesamlphp/simplesamlphp-test-framework": "~1.11"
},
"config": {
"allow-plugins": {
Expand Down
4 changes: 1 addition & 3 deletions src/Alg/Encryption/AbstractEncryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
*/
abstract class AbstractEncryptor implements EncryptionAlgorithmInterface
{
/** @var string */
protected const DEFAULT_BACKEND = Backend\OpenSSL::class;
protected const string DEFAULT_BACKEND = Backend\OpenSSL::class;


/** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend */
Expand Down Expand Up @@ -54,7 +53,6 @@ public function __construct(


/**
* @return string
*/
public function getAlgorithmId(): string
{
Expand Down
6 changes: 2 additions & 4 deletions src/Alg/Encryption/EncryptionAlgorithmFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class EncryptionAlgorithmFactory
*
* @var string[]
*/
public const DEFAULT_BLACKLIST = [
public const array DEFAULT_BLACKLIST = [
C::BLOCK_ENC_3DES,
];

Expand All @@ -36,7 +36,7 @@ final class EncryptionAlgorithmFactory
*
* @var class-string[]
*/
private const SUPPORTED_DEFAULTS = [
private const array SUPPORTED_DEFAULTS = [
TripleDES::class,
AES::class,
];
Expand All @@ -51,8 +51,6 @@ final class EncryptionAlgorithmFactory

/**
* Whether the factory has been initialized or not.
*
* @var bool
*/
protected static bool $initialized = false;

Expand Down
4 changes: 1 addition & 3 deletions src/Alg/KeyTransport/AbstractKeyTransporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
*/
abstract class AbstractKeyTransporter implements KeyTransportAlgorithmInterface
{
/** @var string */
protected const DEFAULT_BACKEND = Backend\OpenSSL::class;
protected const string DEFAULT_BACKEND = Backend\OpenSSL::class;


/** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend */
Expand Down Expand Up @@ -54,7 +53,6 @@ public function __construct(


/**
* @return string
*/
public function getAlgorithmId(): string
{
Expand Down
6 changes: 2 additions & 4 deletions src/Alg/KeyTransport/KeyTransportAlgorithmFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class KeyTransportAlgorithmFactory
*
* @var string[]
*/
public const DEFAULT_BLACKLIST = [
public const array DEFAULT_BLACKLIST = [
C::KEY_TRANSPORT_RSA_1_5,
];

Expand All @@ -34,7 +34,7 @@ class KeyTransportAlgorithmFactory
*
* @var class-string[]
*/
private const SUPPORTED_DEFAULTS = [
private const array SUPPORTED_DEFAULTS = [
RSA::class,
];

Expand All @@ -48,8 +48,6 @@ class KeyTransportAlgorithmFactory

/**
* Whether the factory has been initialized or not.
*
* @var bool
*/
protected static bool $initialized = false;

Expand Down
5 changes: 1 addition & 4 deletions src/Alg/Signature/AbstractSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
*/
abstract class AbstractSigner implements SignatureAlgorithmInterface
{
/** @var string */
protected const DEFAULT_BACKEND = Backend\OpenSSL::class;
protected const string DEFAULT_BACKEND = Backend\OpenSSL::class;


/** @var \SimpleSAML\XMLSecurity\Backend\SignatureBackend */
Expand Down Expand Up @@ -57,7 +56,6 @@ public function __construct(


/**
* @return string
*/
public function getAlgorithmId(): string
{
Expand All @@ -66,7 +64,6 @@ public function getAlgorithmId(): string


/**
* @return string
*/
public function getDigest(): string
{
Expand Down
3 changes: 1 addition & 2 deletions src/Alg/Signature/HMAC.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/
final class HMAC extends AbstractSigner implements SignatureAlgorithmInterface
{
/** @var string */
protected const DEFAULT_BACKEND = Backend\HMAC::class;
protected const string DEFAULT_BACKEND = Backend\HMAC::class;


/**
Expand Down
6 changes: 2 additions & 4 deletions src/Alg/Signature/SignatureAlgorithmFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class SignatureAlgorithmFactory
*
* @var string[]
*/
public const DEFAULT_BLACKLIST = [
public const array DEFAULT_BLACKLIST = [
C::SIG_RSA_SHA1,
C::SIG_HMAC_SHA1,
];
Expand All @@ -37,7 +37,7 @@ final class SignatureAlgorithmFactory
*
* @var class-string[]
*/
private const SUPPORTED_DEFAULTS = [
private const array SUPPORTED_DEFAULTS = [
RSA::class,
HMAC::class,
];
Expand All @@ -52,8 +52,6 @@ final class SignatureAlgorithmFactory

/**
* Whether the factory has been initialized or not.
*
* @var bool
*/
protected static bool $initialized = false;

Expand Down
2 changes: 0 additions & 2 deletions src/Assert/HMACOutputLengthTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ trait HMACOutputLengthTrait
* The HMAC algorithm (RFC2104 [HMAC]) takes the output (truncation) length in bits as a parameter;
* this specification REQUIRES that the truncation length be a multiple of 8 (i.e. fall on a byte boundary)
* because Base64 encoding operates on full bytes
*
* @var string
*/
private static string $HMACOutputLength_regex = '/^([1-9]\d*)$/D';

Expand Down
2 changes: 0 additions & 2 deletions src/Assert/KeySizeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ trait KeySizeTrait
/**
* The size in bits of the key to be derived from the shared secret as the UTF-8 string for the corresponding
* decimal integer with only digits in the string and no leading zeros.
*
* @var string
*/
private static string $keySize_regex = '/^([1-9]\d*)$/D';

Expand Down
1 change: 0 additions & 1 deletion src/Backend/HMAC.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
final class HMAC implements SignatureBackend
{
/** @var string */
protected string $digest;


Expand Down
9 changes: 1 addition & 8 deletions src/Backend/OpenSSL.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,22 @@
*/
final class OpenSSL implements EncryptionBackend, SignatureBackend
{
/** @var int */
public const AUTH_TAG_LEN = 16;
public const int AUTH_TAG_LEN = 16;


// digital signature options
/** @var string */
protected string $digest;

// asymmetric encryption options
/** @var int */
protected int $padding = OPENSSL_PKCS1_OAEP_PADDING;

// symmetric encryption options
/** @var string */
protected string $cipher;

/** @var int */
protected int $blocksize;

/** @var int */
protected int $keysize;

/** @var bool */
protected bool $useAuthTag = false;


Expand Down
Loading