Skip to content
Closed
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
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Tests

on: [push, pull_request]

jobs:
tests-legacy:
name: PHP ${{ matrix.php-versions }} Tests
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['5.4', '5.5', '5.6']

steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: openssl
tools: phpunit:4.8

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run tests
run: phpunit --coverage-clover clover.xml tests

- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml

tests-older:
name: PHP ${{ matrix.php-versions }} Tests
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.0', '7.1']

steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: openssl
tools: phpunit:6.5

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run tests
run: phpunit --coverage-clover clover.xml tests

- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml

tests-old:
name: PHP ${{ matrix.php-versions }} Tests
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.2', '7.3', '7.4']

steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: openssl
tools: phpunit:8.5

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run tests
run: phpunit --coverage-clover clover.xml tests

- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml

tests:
name: PHP ${{ matrix.php-versions }} Tests
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.0', '8.1']

steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: openssl
tools: phpunit/phpunit:9.5

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run tests
run: phpunit --coverage-clover clover.xml tests

- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

10 changes: 9 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
xmlseclibs.php
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
??, ??? 2020, 3.1.2
20, Nov 2024, 3.1.3
Bug Fixes:
- remove loadKey check due to BC issues

20, Nov 2024, 3.1.2
Improvements:
- Add tab to list of whitespace values to remove from cert. refs #252
- loadKey should check return value for openssl_get_privatekey (sammarshallou)
- Switch to GitHub actions (SharkMachine)

05, Sep 2020, 3.1.1
Features:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2007-2019, Robert Richards <rrichards@cdatazone.org>.
Copyright (c) 2007-2024, Robert Richards <rrichards@cdatazone.org>.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
7 changes: 7 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.5/phpunit.xsd">
<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
6 changes: 3 additions & 3 deletions src/XMLSecEnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* xmlseclibs.php
*
* Copyright (c) 2007-2020, Robert Richards <rrichards@cdatazone.org>.
* Copyright (c) 2007-2024, Robert Richards <rrichards@cdatazone.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -44,7 +44,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2020 Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2024 Robert Richards <rrichards@cdatazone.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/

Expand Down Expand Up @@ -485,7 +485,7 @@ public static function staticLocateKeyInfo($objBaseKey=null, $node=null)
if ($x509certNodes = $child->getElementsByTagName('X509Certificate')) {
if ($x509certNodes->length > 0) {
$x509cert = $x509certNodes->item(0)->textContent;
$x509cert = str_replace(array("\r", "\n", " "), "", $x509cert);
$x509cert = str_replace(array("\r", "\n", " ", "\t"), "", $x509cert);
$x509cert = "-----BEGIN CERTIFICATE-----\n".chunk_split($x509cert, 64, "\n")."-----END CERTIFICATE-----\n";
$objBaseKey->loadKey($x509cert, false, true);
}
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSecurityDSig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* xmlseclibs.php
*
* Copyright (c) 2007-2020, Robert Richards <rrichards@cdatazone.org>.
* Copyright (c) 2007-2024, Robert Richards <rrichards@cdatazone.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -44,7 +44,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2020 Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2024 Robert Richards <rrichards@cdatazone.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/

Expand Down
4 changes: 2 additions & 2 deletions src/XMLSecurityKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* xmlseclibs.php
*
* Copyright (c) 2007-2020, Robert Richards <rrichards@cdatazone.org>.
* Copyright (c) 2007-2024, Robert Richards <rrichards@cdatazone.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,7 +40,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2020 Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2024 Robert Richards <rrichards@cdatazone.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/

Expand Down
3 changes: 2 additions & 1 deletion tests/xmlsec-encrypt-noreplace.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if ($newData !== $origData) {
if ($encNode->namespaceURI !== XMLSecEnc::XMLENCNS || $encNode->localName !== 'EncryptedData') {
echo "Encrypted node wasn't a <xenc:EncryptedData>-element.\n";
}

echo "DONE\n";
?>
--EXPECTF--
DONE
6 changes: 3 additions & 3 deletions xmlseclibs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* xmlseclibs.php
*
* Copyright (c) 2007-2020, Robert Richards <rrichards@cdatazone.org>.
* Copyright (c) 2007-2024, Robert Richards <rrichards@cdatazone.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -35,9 +35,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2020 Robert Richards <rrichards@cdatazone.org>
* @copyright 2007-2024 Robert Richards <rrichards@cdatazone.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version 3.1.2-dev
* @version 3.1.3
*/

$xmlseclibs_srcdir = dirname(__FILE__) . '/src/';
Expand Down