Various fixes, update u2flib

This commit is contained in:
andryyy
2017-05-09 23:25:23 +02:00
parent 4cb8596ff0
commit f582f0f01b
20 changed files with 759 additions and 78 deletions

View File

@@ -1,19 +1,21 @@
language: php
sudo: false
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
- hhvm-nightly
after_success:
- test -z $COVERALLS || (composer require satooshi/php-coveralls && vendor/bin/coveralls -v)
matrix:
include:
- php: 5.6
env: COVERALLS=true
allow_failures:
- php: hhvm
- php: hhvm-nightly
before_script:
- composer install
script:
- ./vendor/phpunit/phpunit/phpunit -c phpunit.xml
after_success:
- test -z $COVERALLS || (composer require satooshi/php-coveralls && vendor/bin/coveralls -v)

View File

@@ -1,5 +1,9 @@
php-u2flib-server NEWS -- History of user-visible changes.
* Version 1.0.1 (released 2017-05-09)
** Move examples to phps so they don't execute by default
** Use common challenge for multiple registrations
* Version 1.0.0 (released 2016-02-19)
** Give an early error on openssl < 1.0
** Support devices with initial counter 0

View File

@@ -3,7 +3,8 @@ destination: apidocs
source:
- src/u2flib_server
exclude: "*/tests/*"
exclude:
- "*/tests/*"
groups: none

View File

@@ -4,10 +4,13 @@
"homepage":"https://developers.yubico.com/php-u2flib-server",
"license":"BSD-2-Clause",
"require": {
"ext-openssl":"*"
"ext-openssl":"*",
"php": ">=5.6"
},
"autoload": {
"classmap": ["src/"]
},
"require-dev": {
"phpunit/phpunit": "~5.7"
}
}

View File

@@ -32,7 +32,7 @@ mkdir -p $releasedir
git archive $VERSION --format=tar | tar -xC $releasedir
git2cl > $releasedir/ChangeLog
cd $releasedir
apigen
apigen generate
cd -
tar -cz --directory=$tmpdir --file=${releasename}.tar.gz $releasename
gpg --detach-sign --default-key $PGP_KEYID ${releasename}.tar.gz

View File

@@ -1,7 +1,7 @@
<phpunit
colors="true">
<testsuite name="tests">
<directory suffix="test.php">.</directory>
<directory suffix="test.php">tests</directory>
</testsuite>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>

View File

@@ -222,6 +222,7 @@ class U2F
public function getAuthenticateData(array $registrations)
{
$sigs = array();
$challenge = $this->createChallenge();
foreach ($registrations as $reg) {
if( !is_object( $reg ) ) {
throw new \InvalidArgumentException('$registrations of getAuthenticateData() method only accepts array of object.');
@@ -230,7 +231,7 @@ class U2F
$sig = new SignRequest();
$sig->appId = $this->appId;
$sig->keyHandle = $reg->keyHandle;
$sig->challenge = $this->createChallenge();
$sig->challenge = $challenge;
$sigs[] = $sig;
}
return $sigs;