-
-
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 249e5832f..c1962a79e 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ae04661ee..37aef8d3f 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index a69d9cb6c..aeb74cbb4 100755
--- a/gradlew
+++ b/gradlew
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
esac
done
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
diff --git a/gradlew.bat b/gradlew.bat
index f127cfd49..93e3f59f1 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 9c076aa98..4c4394666 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -10,3 +10,29 @@ include(":test-dependent-projects:java-dep-webauthn-server-core")
include(":test-dependent-projects:java-dep-webauthn-server-core-and-bouncycastle")
include(":test-dependent-projects:java-dep-yubico-util")
include(":test-platform")
+
+dependencyResolutionManagement {
+ versionCatalogs {
+ create("constraintLibs") {
+ library("cbor", "com.upokecenter:cbor:[4.5.1,5)")
+ library("cose", "com.augustcellars.cose:cose-java:[1.0.0,2)")
+ library("guava", "com.google.guava:guava:[24.1.1,32)")
+ library("httpclient5", "org.apache.httpcomponents.client5:httpclient5:[5.0.0,6)")
+ library("slf4j", "org.slf4j:slf4j-api:[1.7.25,3)")
+
+ val jacksonVer = version("jackson", "[2.13.2.1,3)")
+ library("jackson-bom", "com.fasterxml.jackson", "jackson-bom").versionRef(jacksonVer)
+ library("jackson-databind", "com.fasterxml.jackson.core", "jackson-databind").versionRef(jacksonVer)
+ library("jackson-dataformat-cbor", "com.fasterxml.jackson.dataformat", "jackson-dataformat-cbor").versionRef(jacksonVer)
+ library("jackson-datatype-jdk8", "com.fasterxml.jackson.datatype", "jackson-datatype-jdk8").versionRef(jacksonVer)
+ library("jackson-datatype-jsr310", "com.fasterxml.jackson.datatype", "jackson-datatype-jsr310").versionRef(jacksonVer)
+ bundle("jackson", listOf(
+ "jackson-bom",
+ "jackson-databind",
+ "jackson-dataformat-cbor",
+ "jackson-datatype-jdk8",
+ "jackson-datatype-jsr310",
+ ))
+ }
+ }
+}
diff --git a/test-dependent-projects/build.gradle.kts b/test-dependent-projects/build.gradle.kts
deleted file mode 100644
index 2221c1110..000000000
--- a/test-dependent-projects/build.gradle.kts
+++ /dev/null
@@ -1,4 +0,0 @@
-plugins {
- // This is needed because the root project needs the sourceCompatibility property to exist.
- `java-library`
-}
diff --git a/webauthn-server-attestation/README.adoc b/webauthn-server-attestation/README.adoc
index 131ff7f3e..11eb29a4c 100644
--- a/webauthn-server-attestation/README.adoc
+++ b/webauthn-server-attestation/README.adoc
@@ -21,7 +21,7 @@ This module does four things:
- Re-download the metadata BLOB when out of date or invalid.
- Provide utilities for selecting trusted metadata entries and authenticators.
- Integrate with the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
class in the base library, to provide trust root certificates
for verifying attestation statements during credential registrations.
@@ -30,18 +30,18 @@ Notable *non-features* include:
- *Scheduled BLOB downloads.*
+
The
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
class will attempt to download a new BLOB only when its
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html#loadCachedBlob()[`loadCachedBlob()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html#loadCachedBlob()[`loadCachedBlob()`]
or
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html#refreshBlob()[`refreshBlob()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html#refreshBlob()[`refreshBlob()`]
method is executed.
As the names suggest,
`loadCachedBlob()` downloads a new BLOB only if the cache is empty
or the cached BLOB is invalid or out of date,
while `refreshBlob()` always downloads a new BLOB and falls back
to the cached BLOB only when the new BLOB is invalid in some way.
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
will never re-download a new BLOB once instantiated.
+
You should use some external scheduling mechanism to re-run `loadCachedBlob()`
@@ -54,12 +54,12 @@ classes keep no internal mutable state.
+
The FIDO Metadata Service may from time to time report security issues with particular authenticator models.
The
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
class can be configured with a filter for which authenticators to trust,
and untrusted authenticators can be rejected during registration by setting
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`]
on
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.html[`RelyingParty`],
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.html[`RelyingParty`],
but this will not affect any credentials already registered.
@@ -94,7 +94,7 @@ Maven:
com.yubicowebauthn-server-attestation
- 2.4.0
+ 2.4.1compile
----------
@@ -102,7 +102,7 @@ Maven:
Gradle:
----------
-compile 'com.yubico:webauthn-server-attestation:2.4.0'
+compile 'com.yubico:webauthn-server-attestation:2.4.1'
----------
@@ -111,7 +111,7 @@ compile 'com.yubico:webauthn-server-attestation:2.4.0'
This library uses link:https://semver.org/[semantic versioning].
The public API consists of all public classes, methods and fields in the `com.yubico.fido.metadata` package and its subpackages,
i.e., everything covered by the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/package-summary.html[Javadoc].
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/package-summary.html[Javadoc].
Package-private classes and methods are NOT part of the public API.
The `com.yubico:yubico-util` module is NOT part of the public API.
@@ -120,26 +120,26 @@ Breaking changes to these will NOT be reflected in version numbers.
== Getting started
-Using this module consists of 4 major steps:
+Using this module consists of 5 major steps:
1. Create a
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
instance to download and cache metadata BLOBs,
and a
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
instance to make use of the downloaded BLOB.
See the JavaDoc for these classes for details on how to construct them.
+
[WARNING]
=====
Unlike other classes in this module and the core library,
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
is NOT THREAD SAFE since its
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html#loadCachedBlob()[`loadCachedBlob()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html#loadCachedBlob()[`loadCachedBlob()`]
and
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html#refreshBlob()[`refreshBlob()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html#refreshBlob()[`refreshBlob()`]
methods read and write caches.
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`],
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`],
on the other hand, is thread safe,
and `FidoMetadataDownloader` instances can be reused
for subsequent `loadCachedBlob()` and `refreshBlob()` calls
@@ -162,18 +162,18 @@ FidoMetadataService mds = FidoMetadataService.builder()
----------
2. Set the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
as the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#attestationTrustSource(com.yubico.webauthn.attestation.AttestationTrustSource)[`attestationTrustSource`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#attestationTrustSource(com.yubico.webauthn.attestation.AttestationTrustSource)[`attestationTrustSource`]
on your
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
instance,
and set
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#attestationConveyancePreference(com.yubico.webauthn.data.AttestationConveyancePreference)[`attestationConveyancePreference(AttestationConveyancePreference.DIRECT)`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#attestationConveyancePreference(com.yubico.webauthn.data.AttestationConveyancePreference)[`attestationConveyancePreference(AttestationConveyancePreference.DIRECT)`]
on `RelyingParty`
to request an attestation statement for new registrations.
Optionally also set
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`]
on `RelyingParty` to require trusted attestation for new registrations.
+
[source,java]
@@ -188,9 +188,9 @@ RelyingParty rp = RelyingParty.builder()
----------
3. After performing registrations, inspect the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RegistrationResult.html#isAttestationTrusted()[`isAttestationTrusted()`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RegistrationResult.html#isAttestationTrusted()[`isAttestationTrusted()`]
result in
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RegistrationResult.html[`RegistrationResult`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RegistrationResult.html[`RegistrationResult`]
to determine whether the authenticator presented an attestation statement that could be verified
by any of the trusted attestation certificates in the FIDO Metadata Service.
+
@@ -207,7 +207,7 @@ if (result.isAttestationTrusted()) {
----------
4. If needed, use the `findEntries` methods of
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
to retrieve additional authenticator metadata for new registrations.
+
[source,java]
@@ -218,31 +218,34 @@ RegistrationResult result = rp.finishRegistration(/* ... */);
Set metadata = mds.findEntries(result);
----------
-By default,
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
-will probably use the SUN provider for the `PKIX` certificate path validation algorithm.
-This requires the `com.sun.security.enableCRLDP` system property set to `true` in order to verify the BLOB signature.
+ 5. If you use the SUN provider for the `PKIX` certificate path validation algorithm, which many deployments do by default:
+ set the `com.sun.security.enableCRLDP` system property to `true`.
+ This is required for the SUN `PKIX` provider to support the CRL Distribution Points extension,
+ which is needed in order to verify the BLOB signature.
++
For example, this can be done on the JVM command line using a `-Dcom.sun.security.enableCRLDP=true` option.
-See the https://docs.oracle.com/javase/9/security/java-pki-programmers-guide.htm#JSSEC-GUID-EB250086-0AC1-4D60-AE2A-FC7461374746[Java PKI Programmers Guide]
+See the https://docs.oracle.com/javase/9/security/java-pki-programmers-guide.htm#GUID-EB250086-0AC1-4D60-AE2A-FC7461374746__SECTION-139-623E860E[Java PKI Programmers Guide]
for details.
++
+This step may not be necessary if you use a different provider for the `PKIX` certificate path validation algorithm.
== Selecting trusted authenticators
The
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
class can be configured with filters for which authenticators to trust.
When the `FidoMetadataService` is used as the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#attestationTrustSource(com.yubico.webauthn.attestation.AttestationTrustSource)[`attestationTrustSource`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#attestationTrustSource(com.yubico.webauthn.attestation.AttestationTrustSource)[`attestationTrustSource`]
in
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.html[`RelyingParty`],
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.html[`RelyingParty`],
this will be reflected in the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RegistrationResult.html#isAttestationTrusted()[`.isAttestationTrusted()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RegistrationResult.html#isAttestationTrusted()[`.isAttestationTrusted()`]
result in
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RegistrationResult.html[`RegistrationResult`].
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RegistrationResult.html[`RegistrationResult`].
Any authenticators not trusted will also be rejected for new registrations
if you set
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`]
on `RelyingParty`.
The filter has two stages: a "prefilter" which selects metadata entries to include in the data source,
@@ -305,17 +308,17 @@ entry,
and the default registration-time filter excludes any authenticator
with a matching `ATTESTATION_KEY_COMPROMISE` status report entry.
To customize the filters, configure the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.FidoMetadataServiceBuilder.html#prefilter(java.util.function.Predicate)[`.prefilter(Predicate)`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.FidoMetadataServiceBuilder.html#prefilter(java.util.function.Predicate)[`.prefilter(Predicate)`]
and
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.FidoMetadataServiceBuilder.html#filter(java.util.function.Predicate)[`.filter(Predicate)`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.FidoMetadataServiceBuilder.html#filter(java.util.function.Predicate)[`.filter(Predicate)`]
settings in
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`].
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`].
The filters are predicate functions;
each metadata entry will be included in the data source if and only if the prefilter predicate returns `true` for that entry.
Similarly during registration or metadata lookup, the authenticator will be matched with each metadata entry
only if the registration-time filter returns `true` for that pair of authenticator and metadata entry.
You can also use the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.Filters.html#allOf(java.util.function.Predicate\...)[`FidoMetadataService.Filters.allOf()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.Filters.html#allOf(java.util.function.Predicate\...)[`FidoMetadataService.Filters.allOf()`]
combinator to merge several predicates into one.
[NOTE]
@@ -325,10 +328,10 @@ This is true for both the prefilter and the registration-time filter.
If you want to maintain the default filter in addition to the new behaviour,
you must include the default condition in the new filter.
For example, you can use
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.Filters.html#allOf(java.util.function.Predicate\...)[`FidoMetadataService.Filters.allOf()`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.Filters.html#allOf(java.util.function.Predicate\...)[`FidoMetadataService.Filters.allOf()`]
to combine a predefined filter with a custom one.
The default filters are available via static functions in
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.Filters.html[`FidoMetadataService.Filters`].
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.Filters.html[`FidoMetadataService.Filters`].
=====
@@ -349,9 +352,9 @@ This is why any enforceable attestation policy must disallow unknown trust roots
Note that unknown and untrusted attestation is allowed by default,
but can be disallowed by explicitly configuring
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
with
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`].
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.RelyingPartyBuilder.html#allowUntrustedAttestation(boolean)[`.allowUntrustedAttestation(false)`].
== Alignment with FIDO MDS spec
@@ -361,17 +364,17 @@ link:https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.h
The library implements these as closely as possible, but with some slight departures from the spec:
* Processing rules steps 1-7 are implemented as specified, by the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
class.
All "SHOULD" clauses are also respected, with some caveats:
** Step 3 states "The `nextUpdate` field of the Metadata BLOB specifies a date when the download SHOULD occur at latest".
`FidoMetadataDownloader` does not automatically re-download the BLOB.
Instead, each time the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html#loadCachedBlob()[`loadCachedBlob()`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html#loadCachedBlob()[`loadCachedBlob()`]
method is executed it checks whether a new BLOB should be downloaded.
The
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html#refreshBlob()[`refreshBlob()`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html#refreshBlob()[`refreshBlob()`]
method always attempts to download a new BLOB when executed,
but also does not trigger re-downloads automatically.
+
@@ -383,7 +386,7 @@ until the next execution of `.loadCachedBlob()` or `.refreshBlob()`.
* Metadata entries are not stored or cached individually, instead the BLOB is cached as a whole.
In processing rules step 8, neither `FidoMetadataDownloader` nor
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
performs any comparison between versions of a metadata entry.
Policy for ignoring metadata entries can be configured via the filter settings in `FidoMetadataService`.
See above for details.
@@ -395,7 +398,7 @@ There are also some other requirements throughout the spec, which may not be obv
states that "The Relying party MUST reject the Metadata Statement if the `authenticatorVersion` has not increased"
in an `UPDATE_AVAILABLE` status report.
Thus,
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataService.html[`FidoMetadataService`]
silently ignores any `MetadataBLOBPayloadEntry`
whose `metadataStatement.authenticatorVersion` is present and not greater than or equal to
the `authenticatorVersion` in the respective status report.
@@ -405,16 +408,16 @@ There are also some other requirements throughout the spec, which may not be obv
link:https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html#info-statuses[AuthenticatorStatus section]
states that "FIDO Servers MUST silently ignore all unknown AuthenticatorStatus values".
Thus any unknown status values will be parsed as
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/AuthenticatorStatus.html#UNKNOWN[`AuthenticatorStatus.UNKNOWN`],
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/AuthenticatorStatus.html#UNKNOWN[`AuthenticatorStatus.UNKNOWN`],
and
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/MetadataBLOBPayloadEntry.html[`MetadataBLOBPayloadEntry`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/MetadataBLOBPayloadEntry.html[`MetadataBLOBPayloadEntry`]
will silently ignore any status report with that status.
== Overriding certificate path validation
The
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.0/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-attestation/2.4.1/com/yubico/fido/metadata/FidoMetadataDownloader.html[`FidoMetadataDownloader`]
class uses `CertPathValidator.getInstance("PKIX")` to retrieve a `CertPathValidator` instance.
If you need to override any aspect of certificate path validation,
such as CRL retrieval or OCSP, you may provide a custom `CertPathValidator` provider for the `"PKIX"` algorithm.
diff --git a/webauthn-server-attestation/build.gradle.kts b/webauthn-server-attestation/build.gradle.kts
index fd4af93dc..fdcbb8e4c 100644
--- a/webauthn-server-attestation/build.gradle.kts
+++ b/webauthn-server-attestation/build.gradle.kts
@@ -1,23 +1,16 @@
-import com.yubico.gradle.GitUtils
-
plugins {
`java-library`
- scala
- `maven-publish`
- signing
- id("info.solidsoft.pitest")
- id("io.github.cosmicsilence.scalafix")
+ `project-convention-java`
+ `project-convention-scala`
+ `project-convention-lombok`
+ `project-convention-code-formatting`
+ `project-convention-archives`
+ `project-convention-publish`
+ `project-convention-pitest`
}
description = "Yubico WebAuthn attestation subsystem"
-val publishMe by extra(true)
-
-java {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
-}
-
sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
@@ -81,24 +74,19 @@ tasks.jar {
attributes(mapOf(
"Implementation-Id" to "java-webauthn-server-attestation",
"Implementation-Title" to project.description,
- "Implementation-Version" to project.version,
- "Implementation-Vendor" to "Yubico",
- "Git-Commit" to GitUtils.getGitCommitOrUnknown(projectDir),
))
}
}
-pitest {
- pitestVersion.set("1.9.5")
- timestampedReports.set(false)
+// Configure cross-links from webauthn-server-attestation JavaDoc to core JavaDoc
+tasks.javadoc.configure {
+ val coreProj = project(":webauthn-server-core")
+ val coreJavadoc = coreProj.tasks.javadoc.get()
+ inputs.files(coreJavadoc.outputs.files)
- outputFormats.set(listOf("XML", "HTML"))
+ // These links won't work locally, but they will work on developers.yubico.com
+ (options as StandardJavadocDocletOptions).linksOffline("../../webauthn-server-core/${coreProj.version}", "${coreJavadoc.destinationDir}")
- avoidCallsTo.set(listOf(
- "java.util.logging",
- "org.apache.log4j",
- "org.slf4j",
- "org.apache.commons.logging",
- "com.google.common.io.Closeables",
- ))
+ // Use this instead for local testing
+ //(options as StandardJavadocDocletOptions).linksOffline("file://${coreJavadoc.destinationDir}", "${coreJavadoc.destinationDir}")
}
diff --git a/webauthn-server-core/build.gradle.kts b/webauthn-server-core/build.gradle.kts
index 8816b72ff..69cf488b8 100644
--- a/webauthn-server-core/build.gradle.kts
+++ b/webauthn-server-core/build.gradle.kts
@@ -1,24 +1,17 @@
-import com.yubico.gradle.GitUtils
-
plugins {
`java-library`
- scala
- `maven-publish`
- signing
- id("info.solidsoft.pitest")
- id("io.github.cosmicsilence.scalafix")
id("me.champeau.jmh") version "0.6.8"
+ `project-convention-java`
+ `project-convention-scala`
+ `project-convention-lombok`
+ `project-convention-code-formatting`
+ `project-convention-archives`
+ `project-convention-publish`
+ `project-convention-pitest`
}
description = "Yubico WebAuthn server core API"
-val publishMe by extra(true)
-
-java {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
-}
-
dependencies {
api(platform(rootProject))
@@ -59,39 +52,18 @@ configurations.jmhRuntimeClasspath {
exclude(module = "slf4j-test")
}
-tasks.jar {
+tasks.withType(Jar::class) {
manifest {
attributes(mapOf(
+ "Implementation-Title" to "Yubico Web Authentication server library",
+
"Specification-Title" to "Web Authentication: An API for accessing Public Key Credentials",
"Specification-Version" to "Level 2 Proposed Recommendation 2021-04-08",
"Specification-Vendor" to "World Wide Web Consortium",
-
"Specification-Url" to "https://www.w3.org/TR/2021/REC-webauthn-2-20210408/",
"Specification-Url-Latest" to "https://www.w3.org/TR/webauthn-2/",
"Specification-W3c-Status" to "recommendation",
"Specification-Release-Date" to "2021-04-08",
-
- "Implementation-Id" to "java-webauthn-server",
- "Implementation-Title" to "Yubico Web Authentication server library",
- "Implementation-Version" to project.version,
- "Implementation-Vendor" to "Yubico",
- "Implementation-Source-Url" to "https://github.com/Yubico/java-webauthn-server",
- "Git-Commit" to GitUtils.getGitCommitOrUnknown(projectDir),
))
}
}
-
-pitest {
- pitestVersion.set("1.9.5")
- timestampedReports.set(false)
-
- outputFormats.set(listOf("XML", "HTML"))
-
- avoidCallsTo.set(listOf(
- "java.util.logging",
- "org.apache.log4j",
- "org.slf4j",
- "org.apache.commons.logging",
- "com.google.common.io.Closeables",
- ))
-}
diff --git a/webauthn-server-demo/README b/webauthn-server-demo/README
index 12b1f2a45..f1e50c32f 100644
--- a/webauthn-server-demo/README
+++ b/webauthn-server-demo/README
@@ -15,10 +15,8 @@ class which provides the REST API on top of it.
== Quick start
-```
-$ ./gradlew run
-$ $BROWSER https://localhost:8443/
-```
+ $ ./gradlew run
+ $ $BROWSER https://localhost:8443/
== Architecture
@@ -40,7 +38,7 @@ layer.
This layer manages the general architecture of the system, and is where most
business logic and integration code would go. The demo server implements the
"persistent" storage of users and credential registrations - the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/CredentialRepository.html[`CredentialRepository`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/CredentialRepository.html[`CredentialRepository`]
integration point - as the
link:src/main/java/demo/webauthn/InMemoryRegistrationStorage.java[`InMemoryRegistrationStorage`]
class, which simply keeps them stored in memory for a limited time. The
@@ -54,7 +52,7 @@ would be specific to a particular Relying Party (RP) would go in this layer.
- The server layer in turn calls the *library layer*, which is where the
link:../webauthn-server-core/[`webauthn-server-core`]
library gets involved. The entry point into the library is the
- link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
+ link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/RelyingParty.html[`RelyingParty`]
class.
+
This layer implements the Web Authentication
@@ -65,11 +63,11 @@ and exposes integration points for storage of challenges and credentials. Some
notable integration points are:
+
** The library user must provide an implementation of the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/CredentialRepository.html[`CredentialRepository`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/CredentialRepository.html[`CredentialRepository`]
interface to use for looking up stored public keys, user handles and signature
counters.
** The library user can optionally provide an instance of the
-link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.0/com/yubico/webauthn/attestation/AttestationTrustSource.html[`AttestationTrustSource`]
+link:https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.4.1/com/yubico/webauthn/attestation/AttestationTrustSource.html[`AttestationTrustSource`]
interface to enable identification and validation of authenticator models. This
instance is then used to look up trusted attestation root certificates. The
link:../webauthn-server-attestation/[`webauthn-server-attestation`]
diff --git a/webauthn-server-demo/build.gradle.kts b/webauthn-server-demo/build.gradle.kts
index 99f5b84b6..7a77b2347 100644
--- a/webauthn-server-demo/build.gradle.kts
+++ b/webauthn-server-demo/build.gradle.kts
@@ -1,9 +1,10 @@
plugins {
- java
war
application
- scala
- id("io.github.cosmicsilence.scalafix")
+ `project-convention-java`
+ `project-convention-scala`
+ `project-convention-lombok`
+ `project-convention-code-formatting`
}
description = "WebAuthn demo"
diff --git a/yubico-util-scala/build.gradle.kts b/yubico-util-scala/build.gradle.kts
index 8e5ee2718..75ec36b00 100644
--- a/yubico-util-scala/build.gradle.kts
+++ b/yubico-util-scala/build.gradle.kts
@@ -1,14 +1,11 @@
plugins {
- scala
- id("io.github.cosmicsilence.scalafix")
+ `project-convention-java`
+ `project-convention-scala`
+ `project-convention-code-formatting`
}
description = "Yubico internal Scala utilities"
-java {
- targetCompatibility = JavaVersion.VERSION_1_8
-}
-
dependencies {
implementation(platform(rootProject))
implementation(platform(project(":test-platform")))
diff --git a/yubico-util/build.gradle.kts b/yubico-util/build.gradle.kts
index ba6974f9e..c5849fdfa 100644
--- a/yubico-util/build.gradle.kts
+++ b/yubico-util/build.gradle.kts
@@ -1,22 +1,17 @@
plugins {
`java-library`
- scala
- `maven-publish`
- signing
- id("info.solidsoft.pitest")
- id("io.github.cosmicsilence.scalafix")
id("me.champeau.jmh") version "0.6.8"
+ `project-convention-java`
+ `project-convention-scala`
+ `project-convention-lombok`
+ `project-convention-code-formatting`
+ `project-convention-archives`
+ `project-convention-publish`
+ `project-convention-pitest`
}
description = "Yubico internal utilities"
-val publishMe by extra(true)
-
-java {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
-}
-
dependencies {
api(platform(rootProject))
@@ -45,29 +40,11 @@ configurations.jmhRuntimeClasspath {
exclude(module = "slf4j-test")
}
-
tasks.jar {
manifest {
attributes(mapOf(
"Implementation-Id" to "yubico-util",
"Implementation-Title" to project.description,
- "Implementation-Version" to project.version,
- "Implementation-Vendor" to "Yubico",
))
}
}
-
-pitest {
- pitestVersion.set("1.9.5")
- timestampedReports.set(false)
-
- outputFormats.set(listOf("XML", "HTML"))
-
- avoidCallsTo.set(listOf(
- "java.util.logging",
- "org.apache.log4j",
- "org.slf4j",
- "org.apache.commons.logging",
- "com.google.common.io.Closeables",
- ))
-}
diff --git a/yubico-util/src/main/java/com/yubico/internal/util/JacksonCodecs.java b/yubico-util/src/main/java/com/yubico/internal/util/JacksonCodecs.java
index f9c1027c9..1c4e1a960 100644
--- a/yubico-util/src/main/java/com/yubico/internal/util/JacksonCodecs.java
+++ b/yubico-util/src/main/java/com/yubico/internal/util/JacksonCodecs.java
@@ -3,8 +3,10 @@
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.Base64Variants;
import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
@@ -19,13 +21,15 @@ public static ObjectMapper cbor() {
}
public static ObjectMapper json() {
- return new ObjectMapper()
+ return JsonMapper.builder()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
- .setSerializationInclusion(Include.NON_ABSENT)
- .setBase64Variant(Base64Variants.MODIFIED_FOR_URL)
- .registerModule(new Jdk8Module())
- .registerModule(new JavaTimeModule());
+ .configure(MapperFeature.PROPAGATE_TRANSIENT_MARKER, true)
+ .serializationInclusion(Include.NON_ABSENT)
+ .defaultBase64Variant(Base64Variants.MODIFIED_FOR_URL)
+ .addModule(new Jdk8Module())
+ .addModule(new JavaTimeModule())
+ .build();
}
public static CBORObject deepCopy(CBORObject a) {