Loading play-services-fido-api/src/main/java/com/google/android/gms/fido/fido2/api/common/AuthenticationExtensions.java +6 −5 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ package com.google.android.gms.fido.fido2.api.common; import org.microg.gms.common.PublicApi; import org.microg.gms.utils.ToStringHelper; import org.microg.safeparcel.AutoSafeParcelable; import java.util.Arrays; Loading Loading @@ -58,11 +59,11 @@ public class AuthenticationExtensions extends AutoSafeParcelable { @Override public String toString() { return "AuthenticationExtensions{" + "fidoAppIdExtension=" + fidoAppIdExtension + ", cableAuthenticationExtension=" + cableAuthenticationExtension + ", userVerificationMethodExtension=" + userVerificationMethodExtension + '}'; return ToStringHelper.name("AuthenticationExtensions") .field("fidoAppIdExtension", fidoAppIdExtension != null ? fidoAppIdExtension.getAppId() : null) .field("cableAuthenticationExtension", cableAuthenticationExtension) .field("userVerificationMethodExtension", userVerificationMethodExtension != null ? userVerificationMethodExtension.getUvm() : null) .end(); } /** Loading play-services-fido-core/src/main/kotlin/org/microg/gms/fido/core/protocol/msgs/AuthenticatorGetAssertion.kt +5 −4 Original line number Diff line number Diff line Loading @@ -45,12 +45,13 @@ class AuthenticatorGetAssertionRequest( companion object { class Options( val userPresence: Boolean? = true, val userVerification: Boolean? = false val userPresence: Boolean = true, val userVerification: Boolean = false ) { fun encodeAsCbor(): CBORObject = CBORObject.NewMap().apply { if (userPresence != null) set("up", userPresence.encodeAsCbor()) if (userVerification != null) set("uv", userVerification.encodeAsCbor()) // Only encode non-default values if (!userPresence) set("up", userPresence.encodeAsCbor()) if (userVerification) set("uv", userVerification.encodeAsCbor()) } } } Loading play-services-fido-core/src/main/kotlin/org/microg/gms/fido/core/protocol/msgs/AuthenticatorMakeCredential.kt +5 −4 Original line number Diff line number Diff line Loading @@ -49,12 +49,13 @@ class AuthenticatorMakeCredentialRequest( companion object { class Options( val residentKey: Boolean? = false, val userVerification: Boolean? = false val residentKey: Boolean = false, val userVerification: Boolean = false ) { fun encodeAsCbor() = CBORObject.NewMap().apply { if (residentKey != null) set("rk", residentKey.encodeAsCbor()) if (userVerification != null) set("uv", userVerification.encodeAsCbor()) // Only encode non-default values if (residentKey) set("rk", residentKey.encodeAsCbor()) if (userVerification) set("uv", userVerification.encodeAsCbor()) } } } Loading play-services-fido-core/src/main/kotlin/org/microg/gms/fido/core/transport/TransportHandler.kt +4 −3 Original line number Diff line number Diff line Loading @@ -49,8 +49,9 @@ abstract class TransportHandler(val transport: Transport, val callback: Transpor clientDataHash: ByteArray ): Pair<AuthenticatorMakeCredentialResponse, ByteArray?> { val reqOptions = AuthenticatorMakeCredentialRequest.Companion.Options( options.registerOptions.authenticatorSelection?.requireResidentKey, options.registerOptions.authenticatorSelection?.requireUserVerification?.let { it == UserVerificationRequirement.REQUIRED }) options.registerOptions.authenticatorSelection?.requireResidentKey == true, options.registerOptions.authenticatorSelection?.requireUserVerification == UserVerificationRequirement.REQUIRED ) val extensions = mutableMapOf<String, CBORObject>() if (options.authenticationExtensions?.fidoAppIdExtension?.appId != null) { extensions["appidExclude"] = Loading Loading @@ -163,7 +164,7 @@ abstract class TransportHandler(val transport: Transport, val callback: Transpor clientDataHash: ByteArray ): Pair<AuthenticatorGetAssertionResponse, ByteArray?> { val reqOptions = AuthenticatorGetAssertionRequest.Companion.Options( userVerification = options.signOptions.requireUserVerification?.let { it == UserVerificationRequirement.REQUIRED } userVerification = options.signOptions.requireUserVerification == UserVerificationRequirement.REQUIRED ) val extensions = mutableMapOf<String, CBORObject>() if (options.authenticationExtensions?.fidoAppIdExtension?.appId != null) { Loading Loading
play-services-fido-api/src/main/java/com/google/android/gms/fido/fido2/api/common/AuthenticationExtensions.java +6 −5 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ package com.google.android.gms.fido.fido2.api.common; import org.microg.gms.common.PublicApi; import org.microg.gms.utils.ToStringHelper; import org.microg.safeparcel.AutoSafeParcelable; import java.util.Arrays; Loading Loading @@ -58,11 +59,11 @@ public class AuthenticationExtensions extends AutoSafeParcelable { @Override public String toString() { return "AuthenticationExtensions{" + "fidoAppIdExtension=" + fidoAppIdExtension + ", cableAuthenticationExtension=" + cableAuthenticationExtension + ", userVerificationMethodExtension=" + userVerificationMethodExtension + '}'; return ToStringHelper.name("AuthenticationExtensions") .field("fidoAppIdExtension", fidoAppIdExtension != null ? fidoAppIdExtension.getAppId() : null) .field("cableAuthenticationExtension", cableAuthenticationExtension) .field("userVerificationMethodExtension", userVerificationMethodExtension != null ? userVerificationMethodExtension.getUvm() : null) .end(); } /** Loading
play-services-fido-core/src/main/kotlin/org/microg/gms/fido/core/protocol/msgs/AuthenticatorGetAssertion.kt +5 −4 Original line number Diff line number Diff line Loading @@ -45,12 +45,13 @@ class AuthenticatorGetAssertionRequest( companion object { class Options( val userPresence: Boolean? = true, val userVerification: Boolean? = false val userPresence: Boolean = true, val userVerification: Boolean = false ) { fun encodeAsCbor(): CBORObject = CBORObject.NewMap().apply { if (userPresence != null) set("up", userPresence.encodeAsCbor()) if (userVerification != null) set("uv", userVerification.encodeAsCbor()) // Only encode non-default values if (!userPresence) set("up", userPresence.encodeAsCbor()) if (userVerification) set("uv", userVerification.encodeAsCbor()) } } } Loading
play-services-fido-core/src/main/kotlin/org/microg/gms/fido/core/protocol/msgs/AuthenticatorMakeCredential.kt +5 −4 Original line number Diff line number Diff line Loading @@ -49,12 +49,13 @@ class AuthenticatorMakeCredentialRequest( companion object { class Options( val residentKey: Boolean? = false, val userVerification: Boolean? = false val residentKey: Boolean = false, val userVerification: Boolean = false ) { fun encodeAsCbor() = CBORObject.NewMap().apply { if (residentKey != null) set("rk", residentKey.encodeAsCbor()) if (userVerification != null) set("uv", userVerification.encodeAsCbor()) // Only encode non-default values if (residentKey) set("rk", residentKey.encodeAsCbor()) if (userVerification) set("uv", userVerification.encodeAsCbor()) } } } Loading
play-services-fido-core/src/main/kotlin/org/microg/gms/fido/core/transport/TransportHandler.kt +4 −3 Original line number Diff line number Diff line Loading @@ -49,8 +49,9 @@ abstract class TransportHandler(val transport: Transport, val callback: Transpor clientDataHash: ByteArray ): Pair<AuthenticatorMakeCredentialResponse, ByteArray?> { val reqOptions = AuthenticatorMakeCredentialRequest.Companion.Options( options.registerOptions.authenticatorSelection?.requireResidentKey, options.registerOptions.authenticatorSelection?.requireUserVerification?.let { it == UserVerificationRequirement.REQUIRED }) options.registerOptions.authenticatorSelection?.requireResidentKey == true, options.registerOptions.authenticatorSelection?.requireUserVerification == UserVerificationRequirement.REQUIRED ) val extensions = mutableMapOf<String, CBORObject>() if (options.authenticationExtensions?.fidoAppIdExtension?.appId != null) { extensions["appidExclude"] = Loading Loading @@ -163,7 +164,7 @@ abstract class TransportHandler(val transport: Transport, val callback: Transpor clientDataHash: ByteArray ): Pair<AuthenticatorGetAssertionResponse, ByteArray?> { val reqOptions = AuthenticatorGetAssertionRequest.Companion.Options( userVerification = options.signOptions.requireUserVerification?.let { it == UserVerificationRequirement.REQUIRED } userVerification = options.signOptions.requireUserVerification == UserVerificationRequirement.REQUIRED ) val extensions = mutableMapOf<String, CBORObject>() if (options.authenticationExtensions?.fidoAppIdExtension?.appId != null) { Loading