Skip to content

Commit 6ade42d

Browse files
committed
Release 1.3.0
Security fixes: - Bumped Jackson dependency to version 2.9.9 which has patched CVE-2019-12086 New features: - New optional parameter `timeout` added to `StartRegistrationOptions` and `StartAssertionOptions` Bug fixes: - Fixed polarity error in javadoc for `RelyingParty.allowUntrustedAttestation`
2 parents 050de23 + a003f64 commit 6ade42d

File tree

19 files changed

+272
-82
lines changed

19 files changed

+272
-82
lines changed

.travis.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,24 @@ language: java
22

33
branches:
44
except:
5-
- tmp
6-
7-
env:
8-
global:
9-
secure: sX5sJd2EUgzIT7uQN0YxA3faVHymBG/QPZ/St5IPqoQIXjZAMYBM0D1MrVOYaSOhgVKOJt+5vwCYU7MlY9Ha0rUPJgUPT+6CkVgUVCsQ1e8srAzaYp4ceIYaW2XpUIwhKHPBezulV3nLANRs0FibEN+eqTgL5A/qKtsU49BtQ1iUAVFFOzGcR48avo1UYxS0FLw+7MRLgH5NA6KJVHiGChx9P3oLYAhPylgDzRv6iFf5H5v9azQI4eLo6bSQwm++j0UpH4t8m+at7eGuzNsadYY0M9SoUwuJxQZiwtImYJJtGJD92QtV9m+yny4+RocXchgZDj3e9vx06ZqXaeF3U3o49YUX5ACerVV12yOxGZsuuxfevaQa9Mk4xEOwGkhva5I+8vfo8MRxm7ymelExn25zpsMlmj6GjBio3z1q/FGYdyXrcGoVNrvAgozs+0yW2jYtDVo7DNu8J2mur/C/gmi+xA6rkuEJQIQ3hWuWYVe7DUzdii5MG9/9AdwI14b3uyezh1EJ8tza5MScDQijTvD9sGxarruKS59VuJapqrJSU5E87CnlU6gQx7qXJVGvpTXZOw7ZzsdszSDQ3Jc9uNBSdtBQ2i7egEyTE+RQWsdtje/H0s3ZYyIw8qrQ1kIUDQKk7jl8Uvwf+zn/36JBgZMVIIO0hmDFnyB9wBGd7lk=
5+
- /^tmp-?.*/
106

117
jdk:
12-
- openjdk8
138
- oraclejdk8
9+
- oraclejdk11
10+
- openjdk8
11+
- openjdk10
12+
- openjdk11
1413

1514
script:
1615
- ./gradlew check assembleJavadoc
1716

1817
stages:
1918
- test
2019
- mutation-test
21-
- deploy
2220

2321
jobs:
2422
include:
2523
- stage: mutation-test
2624
jdk: oraclejdk8
2725
script: ./gradlew pitest coveralls
28-
29-
- stage: deploy
30-
jdk: oraclejdk8
31-
script: ./gradlew assembleJavadoc
32-
deploy:
33-
provider: pages
34-
skip-cleanup: true
35-
github-token: $PAGES_DEPLOY_KEY
36-
on:
37-
branch: master
38-
local-dir: 'build/javadoc'

NEWS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
== Version 1.3.0 ==
2+
3+
Security fixes:
4+
5+
* Bumped Jackson dependency to version 2.9.9 which has patched CVE-2019-12086
6+
7+
New features:
8+
9+
* New optional parameter `timeout` added to `StartRegistrationOptions` and
10+
`StartAssertionOptions`
11+
12+
Bug fixes:
13+
14+
* Fixed polarity error in javadoc for `RelyingParty.allowUntrustedAttestation`
15+
16+
117
== Version 1.2.0 ==
218

319
New features:

README

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ for a server to support Web Authentication. This includes registering
1414
authenticators and authenticating registered authenticators.
1515

1616

17-
== Table of contents
18-
1917
toc::[]
2018

2119

@@ -27,15 +25,15 @@ Maven:
2725
<dependency>
2826
<groupId>com.yubico</groupId>
2927
<artifactId>webauthn-server-core</artifactId>
30-
<version>1.2.0</version>
28+
<version>1.3.0</version>
3129
<scope>compile</scope>
3230
</dependency>
3331
----------
3432

3533
Gradle:
3634

3735
----------
38-
compile 'com.yubico:webauthn-server-core:1.2.0'
36+
compile 'com.yubico:webauthn-server-core:1.3.0'
3937
----------
4038

4139

@@ -46,6 +44,7 @@ compile 'com.yubico:webauthn-server-core:1.2.0'
4644
- Performs all necessary
4745
https://www.w3.org/TR/webauthn/#rp-operations[validation logic] on the
4846
response from the client
47+
- No mutable state or side effects - everything (except builders) is thread safe
4948
- Optionally integrates with a "metadata service" to verify
5049
https://www.w3.org/TR/webauthn/#sctn-attestation[authenticator attestations]
5150
and annotate responses with additional authenticator metadata
@@ -67,30 +66,30 @@ but the authentication mechanism alone does not make a security system.
6766
link:https://bugs.chromium.org/p/chromium/issues/detail?id=847878[bug in
6867
Chrome] which will not be worked around here. To work around this in
6968
application code, you can omit the
70-
link:https://yubico.github.io/java-webauthn-server/webauthn-server-core/com/yubico/webauthn/data/AuthenticatorAssertionResponse.AuthenticatorAssertionResponseBuilder.html#userHandle-java.util.Optional[`userHandle`]
69+
link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/latest/com/yubico/webauthn/data/AuthenticatorAssertionResponse.AuthenticatorAssertionResponseBuilder.html#userHandle-java.util.Optional[`userHandle`]
7170
when constructing an
72-
link:https://yubico.github.io/java-webauthn-server/webauthn-server-core/com/yubico/webauthn/data/AuthenticatorAssertionResponse.html[`AuthenticatorAssertionResponse`]
71+
link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/latest/com/yubico/webauthn/data/AuthenticatorAssertionResponse.html[`AuthenticatorAssertionResponse`]
7372
value if the `userHandle` is empty. See
7473
https://github.com/Yubico/java-webauthn-server/issues/12 .
7574

7675

7776
== Documentation
7877

7978
See the
80-
link:https://yubico.github.io/java-webauthn-server/webauthn-server-core/com/yubico/webauthn/package-summary.html[Javadoc]
79+
link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/latest/com/yubico/webauthn/package-summary.html[Javadoc]
8180
for in-depth API documentation.
8281

8382

8483
== Quick start
8584

8685
Implement the
87-
link:https://yubico.github.io/java-webauthn-server/webauthn-server-core/com/yubico/webauthn/CredentialRepository.html[`CredentialRepository`]
86+
link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/latest/com/yubico/webauthn/CredentialRepository.html[`CredentialRepository`]
8887
interface with your database access logic. See
8988
link:https://github.com/Yubico/java-webauthn-server/blob/master/webauthn-server-demo/src/main/java/demo/webauthn/InMemoryRegistrationStorage.java[`InMemoryRegistrationStorage`]
9089
for an example.
9190

9291
Instantiate the
93-
link:https://yubico.github.io/java-webauthn-server/webauthn-server-core/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
92+
link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/latest/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
9493
class:
9594

9695
[source,java]
@@ -328,21 +327,13 @@ version is derived from the most recent Git tag. Builds done on a tagged commit
328327
will have a plain `x.y.z` version number, while a build on any other commit will
329328
result in a version number containing the abbreviated commit hash.
330329

331-
Although the `.jar` artifact of this project can be used in JDK version 8 or
332-
later, the project as a whole currently builds only in JDK 8. This is because
333-
most tests are written in Scala, which
334-
https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html#jdk-9\--up-compatibility-notes[currently
335-
only supports JDK 8]. Therefore compiling the tests can currently only be done
336-
in JDK 8, and so `./gradlew build` and similar tasks will fail in JDKs other
337-
than 8.
338-
339-
To run the tests (requires JDK 8):
330+
To run the tests:
340331

341332
----------
342333
$ ./gradlew check
343334
----------
344335

345-
To run the http://pitest.org/[PIT mutation tests] (requires JDK 8):
336+
To run the http://pitest.org/[PIT mutation tests]:
346337

347338
----------
348339
$ ./gradlew pitest

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ subprojects { project ->
139139

140140
testCompile(
141141
'junit:junit:4.12',
142-
'org.mockito:mockito-core:2.8.47',
142+
'org.mockito:mockito-core:2.27.0',
143143
)
144144

145145
}

webauthn-server-attestation/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ dependencies {
1616
project(':webauthn-server-core').sourceSets.test.output,
1717
project(':yubico-util-scala'),
1818
'commons-io:commons-io:2.5',
19-
'org.mockito:mockito-core:2.10.0',
20-
'org.scala-lang:scala-library:2.11.3',
21-
'org.scalacheck:scalacheck_2.11:1.13.5',
22-
'org.scalatest:scalatest_2.11:3.0.4',
19+
'org.mockito:mockito-core:2.27.0',
20+
'org.scala-lang:scala-library:2.12.8',
21+
'org.scalacheck:scalacheck_2.12:1.14.0',
22+
'org.scalatest:scalatest_2.12:3.0.4',
2323
)
2424
}
2525

webauthn-server-attestation/src/test/scala/com/yubico/webauthn/attestation/StandardMetadataServiceSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class StandardMetadataServiceSpec extends FunSpec with Matchers {
101101
s"""{
102102
"identifier": "44c87ead-4455-423e-88eb-9248e0ebe847",
103103
"version": 1,
104-
"trustedCertificates": ["${TestAuthenticator.toPem(caCert).lines.mkString(raw"\n")}"],
104+
"trustedCertificates": ["${TestAuthenticator.toPem(caCert).linesIterator.mkString(raw"\n")}"],
105105
"vendorInfo": {},
106106
"devices": [
107107
{
@@ -159,7 +159,7 @@ class StandardMetadataServiceSpec extends FunSpec with Matchers {
159159
s"""{
160160
"identifier": "44c87ead-4455-423e-88eb-9248e0ebe847",
161161
"version": 1,
162-
"trustedCertificates": ["${TestAuthenticator.toPem(caCert).lines.mkString(raw"\n")}"],
162+
"trustedCertificates": ["${TestAuthenticator.toPem(caCert).linesIterator.mkString(raw"\n")}"],
163163
"vendorInfo": {},
164164
"devices": []
165165
}"""
@@ -197,7 +197,7 @@ class StandardMetadataServiceSpec extends FunSpec with Matchers {
197197
s"""{
198198
"identifier": "44c87ead-4455-423e-88eb-9248e0ebe847",
199199
"version": 1,
200-
"trustedCertificates": ["${TestAuthenticator.toPem(cacaca._1).lines.mkString(raw"\n")}"],
200+
"trustedCertificates": ["${TestAuthenticator.toPem(cacaca._1).linesIterator.mkString(raw"\n")}"],
201201
"vendorInfo": {},
202202
"devices": [
203203
{
@@ -227,7 +227,7 @@ class StandardMetadataServiceSpec extends FunSpec with Matchers {
227227
s"""{
228228
"identifier": "44c87ead-4455-423e-88eb-9248e0ebe847",
229229
"version": 1,
230-
"trustedCertificates": ["${TestAuthenticator.toPem(caCert).lines.mkString(raw"\n")}"],
230+
"trustedCertificates": ["${TestAuthenticator.toPem(caCert).linesIterator.mkString(raw"\n")}"],
231231
"vendorInfo": {},
232232
"devices": [
233233
{

webauthn-server-core/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ dependencies {
1111
compile(
1212
project(':yubico-util'),
1313
'com.augustcellars.cose:cose-java:0.9.4',
14-
'com.fasterxml.jackson.core:jackson-databind:2.9.6',
15-
'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.6',
16-
'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6',
14+
'com.fasterxml.jackson.core:jackson-databind:2.9.9',
15+
'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.9',
16+
'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9',
1717
'com.google.guava:guava:19.0',
1818
'org.apache.httpcomponents:httpclient:4.5.2',
1919
'org.bouncycastle:bcpkix-jdk15on:1.54',
@@ -22,10 +22,10 @@ dependencies {
2222
testCompile(
2323
project(':yubico-util-scala'),
2424
'commons-io:commons-io:2.5',
25-
'org.mockito:mockito-core:2.10.0',
26-
'org.scala-lang:scala-library:2.11.3',
27-
'org.scalacheck:scalacheck_2.11:1.13.5',
28-
'org.scalatest:scalatest_2.11:3.0.4',
25+
'org.mockito:mockito-core:2.27.0',
26+
'org.scala-lang:scala-library:2.12.8',
27+
'org.scalacheck:scalacheck_2.12:1.14.0',
28+
'org.scalatest:scalatest_2.12:3.0.4',
2929
)
3030

3131
}

webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public class RelyingParty {
223223
private final boolean allowUnrequestedExtensions = false;
224224

225225
/**
226-
* If <code>true</code>, {@link #finishRegistration(FinishRegistrationOptions) finishRegistration} will only allow
226+
* If <code>false</code>, {@link #finishRegistration(FinishRegistrationOptions) finishRegistration} will only allow
227227
* registrations where the attestation signature can be linked to a trusted attestation root. This excludes self
228228
* attestation and none attestation.
229229
*
@@ -292,6 +292,7 @@ public PublicKeyCredentialCreationOptions startRegistration(StartRegistrationOpt
292292
)
293293
.authenticatorSelection(startRegistrationOptions.getAuthenticatorSelection())
294294
.extensions(startRegistrationOptions.getExtensions())
295+
.timeout(startRegistrationOptions.getTimeout())
295296
;
296297
attestationConveyancePreference.ifPresent(builder::attestation);
297298
return builder.build();
@@ -344,6 +345,7 @@ public AssertionRequest startAssertion(StartAssertionOptions startAssertionOptio
344345
.appid(appId)
345346
.build()
346347
)
348+
.timeout(startAssertionOptions.getTimeout())
347349
;
348350

349351
startAssertionOptions.getUserVerification().ifPresent(pkcro::userVerification);

webauthn-server-core/src/main/java/com/yubico/webauthn/StartAssertionOptions.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,24 @@ public class StartAssertionOptions {
8080
@NonNull
8181
private final Optional<UserVerificationRequirement> userVerification;
8282

83+
/**
84+
* The value for {@link PublicKeyCredentialRequestOptions#getTimeout()} for this authentication operation.
85+
* <p>
86+
* This library does not take the timeout into account in any way, other than passing it through to the {@link
87+
* PublicKeyCredentialRequestOptions} so it can be used as an argument to
88+
* <code>navigator.credentials.get()</code> on the client side.
89+
* </p>
90+
* <p>
91+
* The default is empty.
92+
* </p>
93+
*/
94+
@NonNull
95+
private final Optional<Long> timeout;
96+
8397
public static class StartAssertionOptionsBuilder {
8498
private @NonNull Optional<String> username = Optional.empty();
8599
private @NonNull Optional<UserVerificationRequirement> userVerification = Optional.empty();
100+
private @NonNull Optional<Long> timeout = Optional.empty();
86101

87102
/**
88103
* The username of the user to authenticate, if the user has already been identified.
@@ -141,5 +156,39 @@ public StartAssertionOptionsBuilder userVerification(@NonNull Optional<UserVerif
141156
public StartAssertionOptionsBuilder userVerification(@NonNull UserVerificationRequirement userVerification) {
142157
return this.userVerification(Optional.of(userVerification));
143158
}
159+
160+
/**
161+
* The value for {@link PublicKeyCredentialRequestOptions#getTimeout()} for this authentication operation.
162+
* <p>
163+
* This library does not take the timeout into account in any way, other than passing it through to the {@link
164+
* PublicKeyCredentialRequestOptions} so it can be used as an argument to
165+
* <code>navigator.credentials.get()</code> on the client side.
166+
* </p>
167+
* <p>
168+
* The default is empty.
169+
* </p>
170+
*/
171+
public StartAssertionOptionsBuilder timeout(@NonNull Optional<Long> timeout) {
172+
if (timeout.isPresent() && timeout.get() <= 0) {
173+
throw new IllegalArgumentException("timeout must be positive, was: " + timeout.get());
174+
}
175+
this.timeout = timeout;
176+
return this;
177+
}
178+
179+
/**
180+
* The value for {@link PublicKeyCredentialRequestOptions#getTimeout()} for this authentication operation.
181+
* <p>
182+
* This library does not take the timeout into account in any way, other than passing it through to the {@link
183+
* PublicKeyCredentialRequestOptions} so it can be used as an argument to
184+
* <code>navigator.credentials.get()</code> on the client side.
185+
* </p>
186+
* <p>
187+
* The default is empty.
188+
* </p>
189+
*/
190+
public StartAssertionOptionsBuilder timeout(long timeout) {
191+
return this.timeout(Optional.of(timeout));
192+
}
144193
}
145194
}

0 commit comments

Comments
 (0)