├── .travis.yml ├── fidouafclient ├── settings.gradle ├── app │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── d.tar.gz │ │ │ ├── drawable-hdpi │ │ │ │ ├── key.png │ │ │ │ ├── back.png │ │ │ │ ├── check.png │ │ │ │ ├── info.png │ │ │ │ ├── play.png │ │ │ │ ├── reset.png │ │ │ │ ├── tile.9.png │ │ │ │ ├── hourglass.png │ │ │ │ ├── ic_fp_40px.png │ │ │ │ ├── register.jpeg │ │ │ │ ├── separator.png │ │ │ │ ├── authenticate.jpeg │ │ │ │ ├── deregister.jpeg │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── s_back.xml │ │ │ │ ├── s_proceed.xml │ │ │ │ ├── s_register.xml │ │ │ │ ├── s_deregister.xml │ │ │ │ └── s_authenticate.xml │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_fp_40px.png │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_fp_40px.png │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_fp_40px.png │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ └── ic_fp_40px.png │ │ │ ├── drawable-nodpi │ │ │ │ └── android_robot.png │ │ │ ├── values-sw600dp │ │ │ │ └── dimens.xml │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ └── template-dimens.xml │ │ │ ├── values-sw720dp-land │ │ │ │ └── dimens.xml │ │ │ ├── values-v11 │ │ │ │ └── styles.xml │ │ │ ├── values-v14 │ │ │ │ └── styles.xml │ │ │ ├── layout │ │ │ │ ├── dialog_save_message.xml │ │ │ │ ├── fingerprint_dialog_backup.xml │ │ │ │ ├── fingerprint_dialog_container.xml │ │ │ │ └── fingerprint_dialog_content.xml │ │ │ ├── menu │ │ │ │ └── main.xml │ │ │ └── drawable │ │ │ │ ├── card.xml │ │ │ │ ├── ic_fingerprint_success.xml │ │ │ │ └── ic_fingerprint_error.xml │ │ │ ├── java │ │ │ └── org │ │ │ │ └── ebayopensource │ │ │ │ ├── fido │ │ │ │ └── uaf │ │ │ │ │ ├── crypto │ │ │ │ │ ├── FidoAttestationSigner.java │ │ │ │ │ ├── FidoSigner.java │ │ │ │ │ ├── Notary.java │ │ │ │ │ ├── FidoSignerAndroidM.java │ │ │ │ │ ├── Utils.java │ │ │ │ │ ├── FidoKeystore.java │ │ │ │ │ ├── FidoSignerBC.java │ │ │ │ │ ├── Base64url.java │ │ │ │ │ ├── FixedCertFidoAttestationSigner.java │ │ │ │ │ ├── SHA.java │ │ │ │ │ ├── HMAC.java │ │ │ │ │ └── FidoKeyStoreBC.java │ │ │ │ │ ├── msg │ │ │ │ │ ├── TrustedFacetsList.java │ │ │ │ │ ├── TrustedFacets.java │ │ │ │ │ ├── Operation.java │ │ │ │ │ ├── client │ │ │ │ │ │ ├── UAFMessage.java │ │ │ │ │ │ └── UAFIntentType.java │ │ │ │ │ ├── asm │ │ │ │ │ │ ├── obj │ │ │ │ │ │ │ ├── GetInfoOut.java │ │ │ │ │ │ │ ├── GetRegistrationsOut.java │ │ │ │ │ │ │ ├── AuthenticatorInfo.java │ │ │ │ │ │ │ ├── DeregisterIn.java │ │ │ │ │ │ │ ├── AppRegistration.java │ │ │ │ │ │ │ ├── RegisterOut.java │ │ │ │ │ │ │ ├── AuthenticateOut.java │ │ │ │ │ │ │ ├── AuthenticateIn.java │ │ │ │ │ │ │ └── RegisterIn.java │ │ │ │ │ │ ├── ASMResponse.java │ │ │ │ │ │ ├── Request.java │ │ │ │ │ │ └── ASMRequest.java │ │ │ │ │ ├── Policy.java │ │ │ │ │ ├── DeregisterAuthenticator.java │ │ │ │ │ ├── Extension.java │ │ │ │ │ ├── rgbPalletteEntry.java │ │ │ │ │ ├── DeregistrationRequest.java │ │ │ │ │ ├── DeregistrationOperationHeader.java │ │ │ │ │ ├── JwkKey.java │ │ │ │ │ ├── AuthenticatorSignAssertion.java │ │ │ │ │ ├── AuthenticationResponse.java │ │ │ │ │ ├── RegistrationRequest.java │ │ │ │ │ ├── Transaction.java │ │ │ │ │ ├── RegistrationResponse.java │ │ │ │ │ ├── ChannelBinding.java │ │ │ │ │ ├── OperationHeader.java │ │ │ │ │ ├── AuthenticationRequest.java │ │ │ │ │ ├── FinalChallengeParams.java │ │ │ │ │ ├── Version.java │ │ │ │ │ ├── AuthenticatorRegistrationAssertion.java │ │ │ │ │ ├── DisplayPNGCharacteristicsDescriptor.java │ │ │ │ │ └── MatchCriteria.java │ │ │ │ │ ├── tlv │ │ │ │ │ ├── InvalidArgumentException.java │ │ │ │ │ ├── AlgAndEncodingEnum.java │ │ │ │ │ ├── Tag.java │ │ │ │ │ ├── UnsignedUtil.java │ │ │ │ │ ├── Tags.java │ │ │ │ │ ├── TagsEnum.java │ │ │ │ │ ├── ByteInputStream.java │ │ │ │ │ └── TagAssertionInfo.java │ │ │ │ │ └── client │ │ │ │ │ ├── AttestCert.java │ │ │ │ │ └── op │ │ │ │ │ ├── Auth.java │ │ │ │ │ └── Dereg.java │ │ │ │ └── fidouafclient │ │ │ │ ├── fp │ │ │ │ └── FingerprintAuthProcessor.java │ │ │ │ └── util │ │ │ │ ├── ApplicationContextProvider.java │ │ │ │ └── Preferences.java │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle └── gradlew.bat ├── fido-uaf-core ├── .gitignore ├── build.gradle ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── ebayopensource │ │ │ └── fido │ │ │ └── uaf │ │ │ ├── crypto │ │ │ ├── CertificateValidator.java │ │ │ ├── Notary.java │ │ │ ├── SHA.java │ │ │ └── HMAC.java │ │ │ ├── msg │ │ │ ├── Operation.java │ │ │ ├── DeregisterAuthenticator.java │ │ │ ├── Policy.java │ │ │ ├── Extension.java │ │ │ ├── rgbPalletteEntry.java │ │ │ ├── DeregistrationRequest.java │ │ │ ├── AuthenticatorRegistrationAssertion.java │ │ │ ├── JwkKey.java │ │ │ ├── AuthenticatorSignAssertion.java │ │ │ ├── RegistrationRequest.java │ │ │ ├── Transaction.java │ │ │ ├── AuthenticationResponse.java │ │ │ ├── RegistrationResponse.java │ │ │ ├── AuthenticationRequest.java │ │ │ ├── ChannelBinding.java │ │ │ ├── FinalChallengeParams.java │ │ │ ├── OperationHeader.java │ │ │ ├── Version.java │ │ │ ├── DisplayPNGCharacteristicsDescriptor.java │ │ │ └── MatchCriteria.java │ │ │ ├── storage │ │ │ ├── SystemErrorException.java │ │ │ ├── DuplicateKeyException.java │ │ │ ├── AuthenticatorRecord.java │ │ │ ├── StorageInterface.java │ │ │ └── RegistrationRecord.java │ │ │ ├── ops │ │ │ ├── ServerDataExpiredException.java │ │ │ └── ServerDataSignatureNotMatchException.java │ │ │ ├── tlv │ │ │ ├── InvalidArgumentException.java │ │ │ ├── Tag.java │ │ │ ├── UnsignedUtil.java │ │ │ ├── AlgAndEncodingEnum.java │ │ │ ├── Tags.java │ │ │ ├── TagsEnum.java │ │ │ ├── ByteInputStream.java │ │ │ └── TagAssertionInfo.java │ │ │ └── ri │ │ │ └── client │ │ │ └── Constants.java │ └── test │ │ └── java │ │ └── org │ │ └── ebayopensource │ │ └── fido │ │ └── uaf │ │ ├── ri │ │ └── client │ │ │ └── AppTest.java │ │ ├── crypto │ │ ├── BCryptTest.java │ │ ├── SHATest.java │ │ ├── HMACTest.java │ │ ├── Asn1Test.java │ │ └── TestData.java │ │ ├── tlv │ │ └── UnsignedUtilTest.java │ │ ├── msg │ │ ├── DeregisterAuthenticatorTest.java │ │ ├── DeregistrationRequestTest.java │ │ ├── MatchCriteriaTest.java │ │ ├── FinalChallengeParamsTest.java │ │ ├── AuthenticationRequestTest.java │ │ ├── RegistrationResponseTest.java │ │ ├── RegistrationRequestTest.java │ │ └── AuthenticationResponseTest.java │ │ └── ops │ │ ├── AuthenticationRequestGenerationTest.java │ │ └── RegistrationRequestGenerationTest.java ├── findbugsExclude.xml ├── LICENSE.md ├── FAQ.md └── README.md ├── fidouaf ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── ebayopensource │ │ │ │ └── fidouaf │ │ │ │ ├── res │ │ │ │ ├── config.properties │ │ │ │ ├── Hello.java │ │ │ │ └── util │ │ │ │ │ ├── FetchRequest.java │ │ │ │ │ ├── NotaryImpl.java │ │ │ │ │ ├── DeregRequestProcessor.java │ │ │ │ │ └── ProcessResponse.java │ │ │ │ ├── stats │ │ │ │ ├── Info.java │ │ │ │ └── Dash.java │ │ │ │ ├── facets │ │ │ │ ├── Facets.java │ │ │ │ └── TrustedFacets.java │ │ │ │ └── RPserver │ │ │ │ └── msg │ │ │ │ ├── Token.java │ │ │ │ ├── TokenType.java │ │ │ │ ├── GetUAFRequest.java │ │ │ │ ├── ServerResponse.java │ │ │ │ ├── ReturnUAFRegistrationRequest.java │ │ │ │ ├── ReturnUAFAuthenticationRequest.java │ │ │ │ └── ReturnUAFDeregistrationRequest.java │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── web.xml │ └── test │ │ └── java │ │ └── org │ │ └── ebayopensource │ │ └── fidouaf │ │ └── res │ │ └── util │ │ └── StorageImplTest.java ├── build.gradle ├── .gitignore └── pom.xml ├── settings.gradle └── .gitignore /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | -------------------------------------------------------------------------------- /fidouafclient/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /fido-uaf-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/d.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/d.tar.gz -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/res/config.properties: -------------------------------------------------------------------------------- 1 | facetId=android:apk-key-hash:n2ljoc0IF9QE2PQk9xDEcxlF0iU -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | // fido uaf core library 2 | include ':fido-uaf-core' 3 | // fido uaf demo server 4 | include ':fidouaf' 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | gradle 3 | .gradle 4 | build 5 | .classes 6 | .idea 7 | .idea/* 8 | *.iml 9 | local.properties 10 | -------------------------------------------------------------------------------- /fidouafclient/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/key.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/back.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/check.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/info.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/play.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/reset.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/tile.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/tile.9.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/hourglass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/hourglass.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/register.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/register.jpeg -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/separator.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-mdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-mdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/authenticate.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/authenticate.jpeg -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/deregister.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/deregister.jpeg -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-xhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-xhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-xxhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-xxhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-xxxhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-xxxhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-nodpi/android_robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eBay/UAF/HEAD/fidouafclient/app/src/main/res/drawable-nodpi/android_robot.png -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/FidoAttestationSigner.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | public interface FidoAttestationSigner { 4 | 5 | public byte[] signWithAttestationCert(byte[] dataForSigning); 6 | } 7 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/FidoSigner.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import java.security.KeyPair; 4 | 5 | public interface FidoSigner { 6 | 7 | public abstract byte[] sign(byte[] dataToSign, KeyPair keyPair); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/s_back.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/s_proceed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/s_register.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /fidouafclient/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/s_deregister.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable-hdpi/s_authenticate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /fidouaf/src/test/java/org/ebayopensource/fidouaf/res/util/StorageImplTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fidouaf.res.util; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class StorageImplTest { 8 | 9 | @Test 10 | public void basic() { 11 | assertNotNull(StorageImpl.getInstance()); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fidouafclient/fp/FingerprintAuthProcessor.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fidouafclient.fp; 2 | 3 | import android.hardware.fingerprint.FingerprintManager; 4 | 5 | public interface FingerprintAuthProcessor { 6 | 7 | void processAuthentication(FingerprintManager.CryptoObject cryptObj); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/TrustedFacetsList.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | public class TrustedFacetsList { 4 | private TrustedFacets[] trustedFacets; 5 | 6 | public TrustedFacetsList(){ 7 | 8 | } 9 | 10 | public TrustedFacets[] getTrustedFacets() { 11 | return trustedFacets; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fidouafclient/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:2.3.1' 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | jcenter() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fidouaf/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'maven' 3 | 4 | sourceCompatibility = 1.6 5 | targetCompatibility = 1.6 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | compile 'com.sun.jersey:jersey-server:1.8' 13 | compile 'com.sun.jersey:jersey-json:1.8' 14 | compile project(':fido-uaf-core') 15 | 16 | testCompile 'junit:junit:4.12' 17 | } 18 | -------------------------------------------------------------------------------- /fidouaf/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | build 3 | bin 4 | rebel.xml 5 | MANIFEST.MF 6 | /tests/ 7 | /coverage/ 8 | /cobertura.ser 9 | */ebay.log 10 | *.class 11 | *.jar 12 | *.zip 13 | */target/* 14 | */temp_persist_config_*.xml 15 | */src/main/resources/buildinfo.properties 16 | /.idea/ 17 | **/*.iml 18 | build.xml 19 | ebay-build.xml 20 | 4cc.checksum 21 | /.metadata 22 | /.project 23 | /target 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /fido-uaf-core/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'maven' 3 | 4 | group = 'org.ebayopensource' 5 | version = '0.0.1-SNAPSHOT' 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | compile 'com.google.code.gson:gson:2.3.1' 13 | compile 'commons-codec:commons-codec:1.9' 14 | compile 'org.bouncycastle:bcprov-jdk15on:1.51' 15 | 16 | testCompile 'junit:junit:4.12' 17 | } 18 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/crypto/CertificateValidator.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | public interface CertificateValidator { 4 | public boolean validate(String cert, String signedData, String signature) 5 | throws Exception; 6 | 7 | public boolean validate(byte[] certBytes, byte[] signedDataBytes, 8 | byte[] signatureBytes) throws Exception; 9 | } 10 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/ri/client/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.ri.client; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class AppTest { 8 | 9 | App app = new App(); 10 | 11 | @Test 12 | public void end2end() throws Exception { 13 | app.startRegistration(); 14 | String accessToken = app.uafAuthentication(); 15 | assertNotNull(accessToken); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /fido-uaf-core/findbugsExclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/crypto/BCryptTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class BCryptTest { 8 | 9 | @Test 10 | public void basic() { 11 | String hashpw = BCrypt.hashpw("password", BCrypt.gensalt()); 12 | assertTrue(BCrypt.checkpw("password", hashpw)); 13 | 14 | String gensalt = BCrypt.gensalt(); 15 | hashpw = BCrypt.hashpw(gensalt, BCrypt.gensalt()); 16 | assertTrue(BCrypt.checkpw(gensalt, hashpw)); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/layout/dialog_save_message.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/tlv/UnsignedUtilTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.tlv; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.io.IOException; 6 | 7 | import org.junit.Test; 8 | 9 | public class UnsignedUtilTest { 10 | 11 | @Test 12 | public void test() throws IOException { 13 | TagsEnum t = TagsEnum.TAG_ASSERTION_INFO; 14 | int checkId = UnsignedUtil.read_UAFV1_UINT16(new ByteInputStream(UnsignedUtil.encodeInt(t.id))); 15 | if (checkId != t.id){ 16 | fail("Conversion error"); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /fido-uaf-core/LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2015 eBay Software Foundation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/TrustedFacets.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | 4 | public class TrustedFacets { 5 | private Version version; 6 | private String[] ids; 7 | 8 | public TrustedFacets(){ 9 | 10 | } 11 | 12 | public Version getVersion() { 13 | return version; 14 | } 15 | 16 | public void setVersion(Version version) { 17 | this.version = version; 18 | } 19 | 20 | public String[] getIds() { 21 | return ids; 22 | } 23 | 24 | public void setIds(String[] ids) { 25 | this.ids = ids; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/stats/Info.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fidouaf.stats; 2 | 3 | public class Info { 4 | public String description = "Example UAF server"; 5 | public String regRequestEndpoint = "/fidouaf/v1/public/regRequest/{user}"; 6 | public String regResponseEndpoint = "/fidouaf/v1/public/regResponse"; 7 | public String authRequestEndpoint = "/fidouaf/v1/public/authRequest"; 8 | public String authResponseEndpoint = "/fidouaf/v1/public/authResponse"; 9 | public String whitelistuuidEndpoint = "/fidouaf/v1/whitelistuuid/{ure_encodedd_uuid}"; 10 | public String whitelistfacetidEndpoint = "/fidouaf/v1/whitelistfacetid/{url_encoded_facedid}"; 11 | public String historyEndpoint = "/fidouaf/v1/history"; 12 | public String registrationsEndpoint = "/fidouaf/v1/registrations"; 13 | } 14 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/msg/DeregisterAuthenticatorTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | import org.junit.Test; 8 | 9 | import com.google.gson.Gson; 10 | 11 | public class DeregisterAuthenticatorTest { 12 | 13 | private Logger logger = Logger.getLogger(this.getClass().getName()); 14 | Gson gson = new Gson (); 15 | 16 | @Test 17 | public void test() { 18 | DeregisterAuthenticator deregAuth = gson.fromJson(getTestDeregAuth(), DeregisterAuthenticator.class); 19 | assertNotNull(deregAuth); 20 | logger.info(gson.toJson(deregAuth)); 21 | } 22 | 23 | String getTestDeregAuth (){ 24 | return "{\"aaid\": \"ABCD#ABCD\",\"keyID\": \"ZMCPn92yHv1Ip-iCiBb6i4ADq6ZOv569KFQCvYSJfNg\"}"; 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/Operation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public enum Operation { 20 | Reg, 21 | Auth, 22 | Dereg 23 | } 24 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/facets/Facets.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.facets; 18 | 19 | public class Facets { 20 | 21 | public TrustedFacets[] trustedFacets; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "26.0.0" 6 | useLibrary 'org.apache.http.legacy' 7 | 8 | defaultConfig { 9 | applicationId "org.ebayopensource.fidouafclient" 10 | minSdkVersion 21 11 | targetSdkVersion 25 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.android.support:support-v4:25.0.0' 24 | compile 'com.google.code.gson:gson:2.3.1' 25 | compile group: 'com.madgag.spongycastle', name: 'prov', version: '1.58.0.0' 26 | compile group: 'commons-codec', name: 'commons-codec', version: '1.10' 27 | } 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/Operation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public enum Operation { 20 | Reg, 21 | Auth, 22 | Dereg 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/client/UAFMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.client; 18 | 19 | public class UAFMessage { 20 | public String uafProtocolMessage; 21 | } 22 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/Token.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | public class Token 20 | { 21 | public TokenType type; 22 | public String value; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/GetInfoOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class GetInfoOut { 20 | public AuthenticatorInfo[] Authenticators; 21 | } 22 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/DeregisterAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DeregisterAuthenticator { 20 | public String aaid; 21 | public String keyID; 22 | } 23 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/Policy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Policy { 20 | public MatchCriteria[][] accepted; 21 | //public MatchCriteria[] disallowed; 22 | } 23 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/Policy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Policy { 20 | public MatchCriteria[][] accepted; 21 | public MatchCriteria[] disallowed; 22 | } 23 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/ASMResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm; 18 | 19 | public class ASMResponse { 20 | public int statusCode; 21 | public T responseData; 22 | } 23 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/GetRegistrationsOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class GetRegistrationsOut { 20 | public AppRegistration[] appRegs; 21 | } 22 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/DeregisterAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DeregisterAuthenticator { 20 | public String aaid; 21 | public String keyID; 22 | } 23 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/AuthenticatorInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class AuthenticatorInfo { 20 | 21 | public int authenticatorIndex; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/DeregisterIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class DeregisterIn { 20 | public String appID; 21 | public String keyID; 22 | } 23 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/Extension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Extension { 20 | public String id; 21 | public String data; 22 | public boolean fail_if_unknown; 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/rgbPalletteEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class rgbPalletteEntry { 20 | public short r; 21 | public short g; 22 | public short b; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/Extension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Extension { 20 | public String id; 21 | public String data; 22 | public boolean fail_if_unknown; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/AppRegistration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class AppRegistration { 20 | public String appID; 21 | public String[] keyIDs; 22 | } 23 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/rgbPalletteEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class rgbPalletteEntry { 20 | public short r; 21 | public short g; 22 | public short b; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/RegisterOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class RegisterOut { 20 | public String assertion; 21 | public String assertionScheme; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/AuthenticateOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class AuthenticateOut { 20 | public String assertion; 21 | public String assertionScheme; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/DeregistrationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DeregistrationRequest { 20 | public OperationHeader header; 21 | public DeregisterAuthenticator[] authenticators; 22 | } 23 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticatorRegistrationAssertion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticatorRegistrationAssertion { 20 | public String assertionScheme; 21 | public String assertion; 22 | } 23 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/JwkKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class JwkKey { 20 | public String kty = "EC"; 21 | public String crv = "P-256"; 22 | public String x; 23 | public String y; 24 | } 25 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/TokenType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | public enum TokenType 20 | { 21 | HTTP_COOKIE, 22 | OAUTH, 23 | OAUTH2, 24 | SAML1_1, 25 | SAML2, 26 | JWT, 27 | OPENID_CONNECT 28 | } 29 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/DeregistrationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DeregistrationRequest { 20 | public OperationHeader header; 21 | public DeregisterAuthenticator[] authenticators; 22 | } 23 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/facets/TrustedFacets.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.facets; 18 | 19 | import org.ebayopensource.fido.uaf.msg.Version; 20 | 21 | public class TrustedFacets { 22 | public Version version; 23 | public String[] ids; 24 | } 25 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/DeregistrationOperationHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DeregistrationOperationHeader { 20 | public Version upv; 21 | public Operation op; 22 | public String appID; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/JwkKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class JwkKey { 20 | public String kty = "EC"; 21 | public String crv = "P-256"; 22 | public String x; 23 | public String y; 24 | } 25 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/crypto/Notary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | public interface Notary { 20 | 21 | public String sign(String dataToSign); 22 | 23 | public boolean verify(String dataToSign, String signature); 24 | } 25 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/Notary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | public interface Notary { 20 | 21 | public String sign (String dataToSign); 22 | public boolean verify (String dataToSign, String signature); 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticatorSignAssertion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticatorSignAssertion { 20 | public String assertionScheme; 21 | public String assertion; 22 | public Extension[] exts; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/FidoSignerAndroidM.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import java.security.KeyPair; 4 | import java.security.Signature; 5 | import java.security.SignatureException; 6 | 7 | public class FidoSignerAndroidM implements FidoSigner { 8 | 9 | private static final String TAG = FidoSignerAndroidM.class.getSimpleName(); 10 | 11 | private Signature signature; 12 | 13 | // signature object needs to be initialized with proper keystore key 14 | public FidoSignerAndroidM(Signature signature) { 15 | this.signature = signature; 16 | } 17 | 18 | @Override 19 | public byte[] sign(byte[] dataToSign, KeyPair keyPair) { 20 | try { 21 | signature.update(dataToSign); 22 | 23 | return signature.sign(); 24 | } catch (SignatureException e) { 25 | throw new RuntimeException(e); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticatorSignAssertion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticatorSignAssertion { 20 | public String assertionScheme; 21 | public String assertion; 22 | public Extension[] exts; 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/RegistrationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class RegistrationRequest { 20 | public OperationHeader header; 21 | public String challenge; 22 | public String username; 23 | public Policy policy; 24 | } 25 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/Transaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Transaction { 20 | public String contentType; 21 | public String content; 22 | public DisplayPNGCharacteristicsDescriptor tcDisplayPNGCharacteristics; 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/storage/SystemErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.storage; 18 | 19 | public class SystemErrorException extends Exception { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/InvalidArgumentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public class InvalidArgumentException extends Exception { 20 | 21 | public InvalidArgumentException(String msg) { 22 | super (msg); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fidouafclient/util/ApplicationContextProvider.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fidouafclient.util; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import java.security.Security; 7 | 8 | public class ApplicationContextProvider extends Application { 9 | 10 | static { 11 | Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider()); 12 | } 13 | 14 | /** 15 | * Keeps a reference of the application context 16 | */ 17 | private static Context sContext; 18 | 19 | @Override 20 | public void onCreate() { 21 | super.onCreate(); 22 | 23 | sContext = getApplicationContext(); 24 | 25 | } 26 | 27 | /** 28 | * Returns the application context 29 | * 30 | * @return application context 31 | */ 32 | public static Context getContext() { 33 | return sContext; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #f4511e 19 | #42000000 20 | #009688 21 | 22 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticationResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticationResponse { 20 | public OperationHeader header; 21 | public String fcParams; 22 | public AuthenticatorSignAssertion[] assertions; 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/RegistrationResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class RegistrationResponse { 20 | public OperationHeader header; 21 | public String fcParams; 22 | public AuthenticatorRegistrationAssertion[] assertions; 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/ops/ServerDataExpiredException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.ops; 18 | 19 | public class ServerDataExpiredException extends Exception { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/storage/DuplicateKeyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.storage; 18 | 19 | public class DuplicateKeyException extends Exception { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticationResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticationResponse { 20 | public OperationHeader header; 21 | public String fcParams; 22 | public AuthenticatorSignAssertion[] assertions; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/RegistrationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class RegistrationRequest { 20 | public OperationHeader header; 21 | public String challenge; 22 | public String username; 23 | public Policy policy; 24 | } 25 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/Transaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Transaction { 20 | public String contentType; 21 | public String content; 22 | public DisplayPNGCharacteristicsDescriptor tcDisplayPNGCharacteristics; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/Request.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm; 18 | 19 | public enum Request { 20 | GetInfo, 21 | Register, 22 | Authenticate, 23 | Deregister, 24 | GetRegistrations, 25 | OpenSettings 26 | } 27 | 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/RegistrationResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class RegistrationResponse { 20 | public OperationHeader header; 21 | public String fcParams; 22 | public AuthenticatorRegistrationAssertion[] assertions; 23 | } 24 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable/card.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 21 | 22 | 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticationRequest { 20 | public OperationHeader header; 21 | public String challenge; 22 | public Transaction[] transaction; 23 | public Policy policy; 24 | } 25 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/ChannelBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class ChannelBinding { 20 | public String serverEndPoint; 21 | public String tlsServerCertificate; 22 | public String tlsUnique; 23 | public String cid_pubkey; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/FinalChallengeParams.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class FinalChallengeParams { 20 | public String appID; 21 | public String challenge; 22 | public String facetID; 23 | public ChannelBinding channelBinding; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/OperationHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class OperationHeader { 20 | public Version upv; 21 | public Operation op; 22 | public String appID; 23 | public String serverData; 24 | //public Extension[] exts; 25 | } 26 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/ChannelBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class ChannelBinding { 20 | public String serverEndPoint; 21 | public String tlsServerCertificate; 22 | public String tlsUnique; 23 | public String cid_pubkey; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/OperationHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class OperationHeader { 20 | public Version upv; 21 | public Operation op; 22 | public String appID; 23 | public String serverData; 24 | public Extension[] exts; 25 | } 26 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticationRequest { 20 | public OperationHeader header; 21 | public String challenge; 22 | public Transaction[] transaction; 23 | public Policy policy; 24 | } 25 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/FinalChallengeParams.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class FinalChallengeParams { 20 | public String appID; 21 | public String challenge; 22 | public String facetID; 23 | public ChannelBinding channelBinding; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/ops/ServerDataSignatureNotMatchException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.ops; 18 | 19 | public class ServerDataSignatureNotMatchException extends Exception { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Version { 20 | public int major; 21 | public int minor; 22 | 23 | public Version (int major, int minor){ 24 | this.major = major; 25 | this.minor = minor; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/GetUAFRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | import org.ebayopensource.fido.uaf.msg.Operation; 20 | 21 | public class GetUAFRequest 22 | { 23 | public Operation op; 24 | public String previousRequest; 25 | public String context; 26 | } 27 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class Version { 20 | public int major; 21 | public int minor; 22 | 23 | public Version (int major, int minor){ 24 | this.major = major; 25 | this.minor = minor; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/msg/DeregistrationRequestTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | import org.junit.Test; 8 | 9 | import com.google.gson.Gson; 10 | 11 | public class DeregistrationRequestTest { 12 | 13 | private Logger logger = Logger.getLogger(this.getClass().getName()); 14 | Gson gson = new Gson (); 15 | 16 | @Test 17 | public void test() { 18 | DeregistrationRequest deregRequest = gson.fromJson(getTestDeregRequest(), DeregistrationRequest.class); 19 | assertNotNull(deregRequest); 20 | logger.info(gson.toJson(deregRequest)); 21 | } 22 | 23 | String getTestDeregRequest (){ 24 | return "{\"header\": {\"op\": \"Dereg\",\"upv\": {\"major\": 1,\"minor\": 0},\"appID\": \"https://uaf-test-1.noknoktest.com:8443/SampleApp/uaf/facets\"},\"authenticators\": [{\"aaid\": \"ABCD#ABCD\",\"keyID\": \"ZMCPn92yHv1Ip-iCiBb6i4ADq6ZOv569KFQCvYSJfNg\"}]}"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/client/UAFIntentType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.client; 18 | 19 | public enum UAFIntentType { 20 | DISCOVER, 21 | DISCOVER_RESULT, 22 | CHECK_POLICY, 23 | CHECK_POLICY_RESULT, 24 | UAF_OPERATION, 25 | UAF_OPERATION_RESULT, 26 | UAF_OPERATION_COMPLETION_STATUS 27 | } 28 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/ServerResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | public class ServerResponse 20 | { 21 | public long statusCode; 22 | public String Description; 23 | public Token[] token; 24 | public String location; 25 | public String postData; 26 | public String newUAFRequest; 27 | } 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/ASMRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm; 18 | 19 | import org.ebayopensource.fido.uaf.msg.Version; 20 | 21 | public class ASMRequest { 22 | 23 | public Request requestType; 24 | public Version asmVersion; 25 | public int authenticatorIndex; 26 | public T args; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/AuthenticateIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class AuthenticateIn { 20 | public String appID; //required DOMString appID; 21 | public String[] keyIDs; //DOMString[] keyIDs; 22 | public String finalChallenge; //required DOMString finalChallenge; 23 | } 24 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/InvalidArgumentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public class InvalidArgumentException extends Exception { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | public InvalidArgumentException(String msg) { 27 | super (msg); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | public class Utils { 20 | 21 | public static byte[] copyOf(byte[] in, int length) { 22 | byte[] out = new byte[length]; 23 | System.arraycopy(in, 0, out, 0, Math.min(length, in.length)); 24 | return out; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/AuthenticatorRegistrationAssertion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class AuthenticatorRegistrationAssertion { 20 | public String assertionScheme; 21 | public String assertion; 22 | public DisplayPNGCharacteristicsDescriptor[] tcDisplayPNGCharacteristics; 23 | public Extension[] exts; 24 | } 25 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/ri/client/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.ri.client; 18 | 19 | public interface Constants { 20 | 21 | public static final String APP_ID = "https://www.head2toes.org/fidouaf/v1/public/uaf/facets"; 22 | public static final String FACET_ID = "https://www.head2toes.org"; 23 | public static final String AAID = "EBA0#0101"; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/msg/MatchCriteriaTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | import org.junit.Test; 8 | 9 | import com.google.gson.Gson; 10 | 11 | public class MatchCriteriaTest { 12 | 13 | private Logger logger = Logger.getLogger(this.getClass().getName()); 14 | Gson gson = new Gson (); 15 | 16 | @Test 17 | public void test() { 18 | MatchCriteria matchCrit = gson.fromJson(getTestMatchCrit(), MatchCriteria.class); 19 | assertNotNull(matchCrit); 20 | logger.info(gson.toJson(matchCrit)); 21 | } 22 | 23 | String getTestMatchCrit (){ 24 | return "{\"aaid\": [\"1234#5678\"], \"vendorID\": [\"1234\"], \"userVerificationDetails\": [ [ { \"userVerification\": 2, \"baDesc\": { \"FAR\": 0.001 } } ] ], \"keyProtection\": 6, \"matcherProtection\": 2, \"attachmentHint\": 1, \"tcDisplay\": 4, \"authenticationAlgorithms\": [1], \"assertionScheme\": \"UAFV1TLV\", \"attestationTypes\": [15879], \"authenticatorVersion\": 2 }"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/FidoKeystore.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import android.content.Context; 4 | import android.hardware.fingerprint.FingerprintManager; 5 | import android.os.Build; 6 | 7 | import java.security.KeyPair; 8 | import java.security.PublicKey; 9 | import java.security.cert.X509Certificate; 10 | 11 | public abstract class FidoKeystore { 12 | 13 | public static FidoKeystore createKeyStore(Context context) { 14 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 15 | return new FidoKeystoreAndroidM(context.getSystemService(FingerprintManager.class)); 16 | } 17 | 18 | return new FidoKeyStoreBC(); 19 | } 20 | 21 | public abstract KeyPair generateKeyPair(String username); 22 | 23 | public abstract KeyPair getKeyPair(String username); 24 | 25 | public abstract PublicKey getPublicKey(String username); 26 | 27 | public abstract X509Certificate getCertificate(String username); 28 | 29 | public abstract FidoSigner getSigner(String username); 30 | } 31 | -------------------------------------------------------------------------------- /fidouaf/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 6 | Restful Web Application 7 | 8 | 9 | jersey-serlvet 10 | 11 | com.sun.jersey.spi.container.servlet.ServletContainer 12 | 13 | 14 | com.sun.jersey.config.property.packages 15 | org.ebayopensource.fidouaf.res 16 | 17 | 18 | com.sun.jersey.api.json.POJOMappingFeature 19 | true 20 | 21 | 1 22 | 23 | 24 | 25 | jersey-serlvet 26 | /* 27 | 28 | 29 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/DisplayPNGCharacteristicsDescriptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DisplayPNGCharacteristicsDescriptor { 20 | public long width; 21 | public long height; 22 | public String bitDepth; 23 | public String colorType; 24 | public String compression; 25 | public String filter; 26 | public String interlace; 27 | public rgbPalletteEntry[] plte; 28 | } 29 | -------------------------------------------------------------------------------- /fidouaf/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.ebayopensource 5 | fidouaf 6 | 0.0.1-SNAPSHOT 7 | war 8 | 9 | 10 | 11 | com.sun.jersey 12 | jersey-server 13 | 1.8 14 | 15 | 16 | com.sun.jersey 17 | jersey-json 18 | 1.8 19 | 20 | 21 | org.ebayopensource 22 | fido-uaf-core 23 | 0.0.1-SNAPSHOT 24 | 25 | 26 | com.google.code.gson 27 | gson 28 | 2.8.9 29 | 30 | 31 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/crypto/SHATest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class SHATest { 8 | 9 | private static final String SOME_OTHER_STRING = "SomeOtherString"; 10 | private static final String SOME_STRING = "SomeString"; 11 | 12 | @Test 13 | public void basic() { 14 | String sha256 = SHA.sha256(SOME_STRING); 15 | assertNotNull(sha256); 16 | assertTrue(!sha256.equals(SOME_STRING)); 17 | } 18 | 19 | @Test 20 | public void uniqeResult() { 21 | String sha1 = SHA.sha256(SOME_STRING); 22 | String sha2 = SHA.sha256(SOME_OTHER_STRING); 23 | assertTrue(!sha1.equals(sha2)); 24 | } 25 | 26 | @Test 27 | public void deterministic() { 28 | String sha1 = SHA.sha256(SOME_STRING); 29 | assertTrue(sha1.equals(SHA.sha256(SOME_STRING))); 30 | } 31 | 32 | @Test 33 | public void nullInput() { 34 | String sha256; 35 | try { 36 | sha256 = SHA.sha256(null); 37 | } catch (Exception e) { 38 | assertTrue(e instanceof RuntimeException); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/DisplayPNGCharacteristicsDescriptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class DisplayPNGCharacteristicsDescriptor { 20 | public long width; 21 | public long height; 22 | public String bitDepth; 23 | public String colorType; 24 | public String compression; 25 | public String filter; 26 | public String interlace; 27 | public rgbPalletteEntry[] plte; 28 | } 29 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/asm/obj/RegisterIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg.asm.obj; 18 | 19 | public class RegisterIn { 20 | public String appID; //required DOMString appID; 21 | public String username; //required DOMString username; 22 | public String finalChallenge; //required DOMString finalChallenge; 23 | public int attestationType; //required unsigned short attestationType; 24 | } 25 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/storage/AuthenticatorRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.storage; 18 | 19 | public class AuthenticatorRecord { 20 | 21 | private static final String DLM = "#"; 22 | 23 | public String AAID; 24 | public String KeyID; 25 | public String deviceId; 26 | public String username; 27 | public String status; 28 | 29 | public String toString() { 30 | return AAID + DLM + KeyID; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/ReturnUAFRegistrationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | import org.ebayopensource.fido.uaf.msg.Operation; 20 | import org.ebayopensource.fido.uaf.msg.RegistrationRequest; 21 | 22 | public class ReturnUAFRegistrationRequest 23 | { 24 | public long statusCode; 25 | public RegistrationRequest[] uafRequest; 26 | public Operation op; 27 | public long lifetimeMillis; 28 | } 29 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/ReturnUAFAuthenticationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | import org.ebayopensource.fido.uaf.msg.AuthenticationRequest; 20 | import org.ebayopensource.fido.uaf.msg.Operation; 21 | 22 | public class ReturnUAFAuthenticationRequest 23 | { 24 | public long statusCode; 25 | public AuthenticationRequest[] uafRequest; 26 | public Operation op; 27 | public long lifetimeMillis; 28 | } 29 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/RPserver/msg/ReturnUAFDeregistrationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.RPserver.msg; 18 | 19 | import org.ebayopensource.fido.uaf.msg.DeregistrationRequest; 20 | import org.ebayopensource.fido.uaf.msg.Operation; 21 | 22 | public class ReturnUAFDeregistrationRequest 23 | { 24 | public long statusCode; 25 | public DeregistrationRequest uafRequest; 26 | public Operation op; 27 | public long lifetimeMillis; 28 | } 29 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/AlgAndEncodingEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public enum AlgAndEncodingEnum { 20 | 21 | UAF_ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW (0x01), 22 | UAF_ALG_SIGN_SECP256R1_ECDSA_SHA256_DER (0x02), 23 | UAF_ALG_KEY_ECC_X962_RAW (0x100), 24 | UAF_ALG_KEY_ECC_X962_DER (0x101) 25 | ; 26 | 27 | public final int id; 28 | 29 | AlgAndEncodingEnum (int id){ 30 | this.id = id; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/res/Hello.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.res; 18 | 19 | import javax.ws.rs.GET; 20 | import javax.ws.rs.Path; 21 | import javax.ws.rs.PathParam; 22 | import javax.ws.rs.core.Response; 23 | 24 | @Path("/hello") 25 | public class Hello { 26 | 27 | @GET 28 | @Path("/{param}") 29 | public Response getMsg(@PathParam("param") String msg) { 30 | 31 | String output = "Jersey say : " + msg; 32 | 33 | return Response.status(200).entity(output).build(); 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/Tag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public class Tag { 20 | public int statusId = 0x00; 21 | public int id; 22 | public int length; 23 | public byte[] value; 24 | 25 | public String toString (){ 26 | String ret = "Tag id:"+id; 27 | ret = ret + " Tag name: " + TagsEnum.get(id); 28 | if (value != null){ 29 | ret = ret + " Tag value:"+ android.util.Base64.encode(value, android.util.Base64.URL_SAFE); 30 | } 31 | return ret; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fidouafclient/util/Preferences.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fidouafclient.util; 2 | 3 | import android.content.SharedPreferences; 4 | 5 | public class Preferences { 6 | 7 | private static String PREFERANCES = "Preferances"; 8 | 9 | public static String getSettingsParam(String paramName) { 10 | SharedPreferences settings = getPrefferences(); 11 | return settings.getString(paramName, ""); 12 | } 13 | 14 | public static SharedPreferences getPrefferences() { 15 | SharedPreferences settings = ApplicationContextProvider.getContext() 16 | .getSharedPreferences(PREFERANCES, 0); 17 | return settings; 18 | } 19 | 20 | public static void setSettingsParam(String paramName, String paramValue) { 21 | SharedPreferences settings = getPrefferences(); 22 | SharedPreferences.Editor editor = settings.edit(); 23 | editor.putString(paramName, paramValue); 24 | editor.commit(); 25 | } 26 | 27 | public static void setSettingsParamLong(String paramName, long paramValue) { 28 | SharedPreferences settings = getPrefferences(); 29 | SharedPreferences.Editor editor = settings.edit(); 30 | editor.putLong(paramName, paramValue); 31 | editor.commit(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/crypto/HMACTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.security.InvalidParameterException; 6 | 7 | import org.junit.Test; 8 | 9 | public class HMACTest { 10 | 11 | @Test 12 | public void testSignNotNullNotEqual() 13 | { 14 | try 15 | { 16 | byte[] Signature = HMAC.sign("Some_String", "Password"); 17 | assertNotNull(Signature); 18 | assertTrue(!Signature.toString().equals("SOME_STRING")); 19 | } 20 | catch (Exception e) 21 | { 22 | assertTrue(e instanceof Exception); 23 | } 24 | } 25 | 26 | @Test 27 | public void nullPassword() 28 | { 29 | String result=""; 30 | try 31 | { 32 | result = HMAC.sign("Some_String", null).toString(); 33 | } 34 | catch (Exception e) 35 | { 36 | assertTrue(e instanceof InvalidParameterException); 37 | } 38 | } 39 | 40 | @Test 41 | public void nullInputString() 42 | { 43 | String result=""; 44 | try 45 | { 46 | result = HMAC.sign(null, "Password").toString(); 47 | } 48 | catch (Exception e) 49 | { 50 | e.printStackTrace(); 51 | assertTrue(e instanceof InvalidParameterException); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/Tag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | import org.apache.commons.codec.binary.Base64; 20 | 21 | public class Tag { 22 | public int statusId = 0x00; 23 | public int id; 24 | public int length; 25 | public byte[] value; 26 | 27 | public String toString() { 28 | String ret = "Tag id:" + id; 29 | ret = ret + " Tag name: " + TagsEnum.get(id); 30 | if (value != null) { 31 | ret = ret + " Tag value:" + Base64.encodeBase64URLSafeString(value); 32 | } 33 | return ret; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/FidoSignerBC.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import java.io.IOException; 4 | import java.math.BigInteger; 5 | import java.security.KeyPair; 6 | import java.security.NoSuchAlgorithmException; 7 | 8 | public class FidoSignerBC implements FidoSigner { 9 | 10 | @Override 11 | public byte[] sign(byte[] dataToSign, KeyPair keyPair) { 12 | try { 13 | BigInteger[] signatureGen = NamedCurve.signAndFromatToRS(keyPair.getPrivate(), 14 | SHA.sha(dataToSign, "SHA-256")); 15 | 16 | boolean verify = NamedCurve.verify( 17 | KeyCodec.getPubKeyAsRawBytes(keyPair.getPublic()), 18 | SHA.sha(dataToSign, "SHA-256"), 19 | Asn1.decodeToBigIntegerArray(Asn1.getEncoded(signatureGen))); 20 | if (!verify) { 21 | throw new RuntimeException("Signatire match fail"); 22 | } 23 | byte[] ret = Asn1.toRawSignatureBytes(signatureGen); 24 | 25 | return ret; 26 | } catch (NoSuchAlgorithmException | IOException e) { 27 | throw new RuntimeException(e); 28 | } 29 | 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/UnsignedUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | import java.io.IOException; 20 | 21 | public class UnsignedUtil { 22 | 23 | public static int read_UAFV1_UINT16(ByteInputStream bytes) throws IOException { 24 | int a = bytes.readUnsignedByte(); 25 | int b = bytes.readUnsignedByte(); 26 | return a + b * 256; 27 | } 28 | 29 | public static byte[] encodeInt(int id) { 30 | 31 | byte[] bytes = new byte[2]; 32 | bytes[0] = (byte)(id&0x00ff); 33 | bytes[1] = (byte)((id&0xff00)>>8); 34 | return bytes; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/UnsignedUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | import java.io.IOException; 20 | 21 | public class UnsignedUtil { 22 | 23 | public static int read_UAFV1_UINT16(ByteInputStream bytes) 24 | throws IOException { 25 | int a = bytes.readUnsignedByte(); 26 | int b = bytes.readUnsignedByte(); 27 | return a + b * 256; 28 | } 29 | 30 | public static byte[] encodeInt(int id) { 31 | 32 | byte[] bytes = new byte[2]; 33 | bytes[0] = (byte) (id & 0x00ff); 34 | bytes[1] = (byte) ((id & 0xff00) >> 8); 35 | return bytes; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/msg/MatchCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class MatchCriteria { 20 | public String[] aaid; 21 | //public String[] vendorID; 22 | public String[] keyIDs; 23 | // public long userVerification; 24 | // public int keyProtection; 25 | //public int matcherProtection; 26 | public long attachmentHint; 27 | //public int tcDisplay; 28 | //public int[] authenticationAlgorithms; 29 | //public String[] assertionSchemes; 30 | //public int[] attestationTypes; 31 | public int authenticatorVersion; 32 | public Extension[] exts; 33 | } 34 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/values/template-dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 4dp 22 | 8dp 23 | 16dp 24 | 32dp 25 | 64dp 26 | 27 | 28 | 29 | @dimen/margin_medium 30 | @dimen/margin_medium 31 | 32 | 33 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/msg/MatchCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.msg; 18 | 19 | public class MatchCriteria { 20 | public String[] aaid; 21 | //public String[] vendorID; 22 | // public String[] keyIDs; 23 | // public long userVerification; 24 | // public int keyProtection; 25 | //public int matcherProtection; 26 | // public long attachmentHint; 27 | //public int tcDisplay; 28 | //public int[] authenticationAlgorithms; 29 | //public String[] assertionSchemes; 30 | //public int[] attestationTypes; 31 | // public int authenticatorVersion; 32 | // public Extension[] exts; 33 | } 34 | -------------------------------------------------------------------------------- /fido-uaf-core/FAQ.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | ## What is UAF? 3 | UAF can stand as an acronym for many different things. 4 | 5 | Is it the [University of Alaska Fairbanks](https://uaf.edu/)? 6 | 7 | Could be. But not in this case. In this case it is reference to the [Universal Authentication Framework](https://fidoalliance.org/wp-content/uploads/html/fido-uaf-overview-v1.0-ps-20141208.html) 8 | 9 | The framework is describing a protocol for passwordless authentication. It is putting at work different authenticators and crypto together to provide secure and convenient way of authentication. 10 | 11 | ## What is UAF Authenticator? 12 | An authenticator is a way to prove to a computer system that you really are who you are (called authentication) 13 | 14 | UAF Authenticators may take different forms. Implementations may range from a secure application running inside tamper-resistant hardware to software-only solutions on consumer devices. 15 | 16 | Some examples could be: 17 | - Fingerprint scanner (like one you can find in iPhone or Samsung S6 phones) 18 | - Pin verification 19 | 20 | ## What is crypto? 21 | Short for cryptography, the science of coding and decoding messages so as to keep these messages secure. Coding (see encryption) takes place using a key that ideally is known only by the sender and intended recipient of the message. 22 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/storage/StorageInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.storage; 18 | 19 | import org.ebayopensource.fido.uaf.storage.RegistrationRecord; 20 | 21 | public interface StorageInterface { 22 | 23 | public void storeServerDataString(String username, String serverDataString); 24 | 25 | public String getUsername(String serverDataString); 26 | 27 | public void store(RegistrationRecord[] records) 28 | throws DuplicateKeyException, SystemErrorException; 29 | 30 | public RegistrationRecord readRegistrationRecord(String key); 31 | 32 | public void update(RegistrationRecord[] records); 33 | } 34 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/storage/RegistrationRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.storage; 18 | 19 | public class RegistrationRecord { 20 | public AuthenticatorRecord authenticator; 21 | public String PublicKey; 22 | public String SignCounter; 23 | public String AuthenticatorVersion; 24 | public String tcDisplayPNGCharacteristics; 25 | public String username; 26 | public String userId; 27 | public String deviceId; 28 | public String timeStamp; 29 | public String status; 30 | public String attestCert; 31 | public String attestDataToSign; 32 | public String attestSignature; 33 | public String attestVerifiedStatus; 34 | } 35 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/AlgAndEncodingEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public enum AlgAndEncodingEnum { 20 | 21 | UAF_ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW (0x01), 22 | UAF_ALG_SIGN_SECP256R1_ECDSA_SHA256_DER (0x02), 23 | UAF_ALG_SIGN_RSASSA_PSS_SHA256_RAW(0x03), 24 | UAF_ALG_SIGN_RSASSA_PSS_SHA256_DER (0x04), 25 | UAF_ALG_KEY_ECC_X962_RAW (0x100), 26 | UAF_ALG_KEY_ECC_X962_DER (0x101), 27 | UAF_ALG_KEY_RSA_2048_PSS_RAW(0x102), 28 | UAF_ALG_KEY_RSA_2048_PSS_DER(0x103), 29 | UAF_ALG_SIGN_SECP256K1_ECDSA_SHA256_DER (0x06) 30 | ; 31 | 32 | public final int id; 33 | 34 | AlgAndEncodingEnum (int id){ 35 | this.id = id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/msg/FinalChallengeParamsTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.io.UnsupportedEncodingException; 6 | import java.util.logging.Logger; 7 | 8 | import org.apache.commons.codec.binary.Base64; 9 | import org.junit.Test; 10 | 11 | import com.google.gson.Gson; 12 | 13 | public class FinalChallengeParamsTest { 14 | 15 | private Logger logger = Logger.getLogger(this.getClass().getName()); 16 | Gson gson = new Gson(); 17 | 18 | @Test 19 | public void test() throws UnsupportedEncodingException { 20 | String fcParamsAsJson = new String( 21 | Base64.decodeBase64(getTestfcParamsAsBase64())); 22 | // String fcParamsAsJson = new 23 | // String(Base64.decodeBase64(getTestfcParamsAsBase64().getBytes())); 24 | logger.info(fcParamsAsJson); 25 | FinalChallengeParams fromJson = gson.fromJson(fcParamsAsJson, 26 | FinalChallengeParams.class); 27 | assertNotNull(fromJson); 28 | logger.info(gson.toJson(fromJson)); 29 | } 30 | 31 | String getTestfcParamsAsBase64() { 32 | return "eyJhcHBJRCI6Imh0dHBzOi8vdWFmLXRlc3QtMS5ub2tub2t0ZXN0LmNvbTo4NDQzL1NhbXBsZUFwcC91YWYvZmFjZXRzIiwiY2hhbGxlbmdlIjoiSDlpVzl5QTlhQVhGX2xlbFFvaV9EaFVrNTE0QWQ4VHF2MHpDbkNxS0RwbyIsImNoYW5uZWxCaW5kaW5nIjp7fSwiZmFjZXRJRCI6ImNvbS5ub2tub2suYW5kcm9pZC5zYW1wbGVhcHAifQ"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable/ic_fingerprint_success.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /fido-uaf-core/README.md: -------------------------------------------------------------------------------- 1 | # Implementation of FIDO UAF Server Side 2 | [FIDO Specification](http://fidoalliance.org/specifications/download) 3 | 4 | # Message Object And Operations 5 | [Fido UAF Protocol](http://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-protocol-v1.0-ps-20141208.html) 6 | 7 | # Implementing Registration Data Storage 8 | The storage where the registration data will be kept is something that is specific to the particular deployment. 9 | 10 | It is opposite to how the UAF operations are set: The same operation implementation can be used in any deployment. 11 | 12 | For that reason storage can be implemented separately by implementing this interface: 13 | ``` 14 | org.ebayopensource.fido.uaf.storage.StorageInterface 15 | ``` 16 | 17 | ### Implementing Notary Service 18 | Similar to the storage, the way how the server data will be authenticated by the server is matter of the particular deployment. 19 | 20 | In this case it is assumed that if server data is signed with a key only known by the server, this would be good enough to verify data later on. By verifying the signature, server can decide if this was the server data produced by it earlier. 21 | 22 | The actual implementation needs to be done for each use-case, by implementing the following interface: 23 | ``` 24 | org.ebayopensource.fido.uaf.crypto.Notary; 25 | ``` 26 | 27 | # References 28 | - [FAQ](FAQ.md) 29 | - [LICENSE](LICENSE.md) 30 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/drawable/ic_fingerprint_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/Base64url.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import android.util.Base64; 4 | 5 | /* 6 | * Copyright 2016 eBay Software Foundation 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | public final class Base64url { 22 | private static final int BASE64URL_FLAGS = Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP; 23 | 24 | public static String encodeToString(byte[] input) { 25 | return Base64.encodeToString(input, BASE64URL_FLAGS); 26 | } 27 | 28 | public static byte[] encode(byte[] input) { 29 | return Base64.encode(input, BASE64URL_FLAGS); 30 | } 31 | 32 | public static byte[] decode(String input) { 33 | return Base64.decode(input, BASE64URL_FLAGS); 34 | } 35 | 36 | private Base64url() { 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/ops/AuthenticationRequestGenerationTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.ops; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | import org.ebayopensource.fido.uaf.crypto.Notary; 8 | import org.ebayopensource.fido.uaf.msg.AuthenticationRequest; 9 | import org.junit.Test; 10 | 11 | import com.google.gson.Gson; 12 | 13 | public class AuthenticationRequestGenerationTest { 14 | 15 | private Logger logger = Logger.getLogger(this.getClass().getName()); 16 | private static final String TEST_SIGNATURE = "test_signature"; 17 | Gson gson = new Gson (); 18 | 19 | @Test 20 | public void notNull() { 21 | AuthenticationRequest authReq= new AuthenticationRequestGeneration().createAuthenticationRequest(new NotaryImpl()); 22 | assertNotNull(authReq); 23 | logger.info(gson.toJson(authReq)); 24 | } 25 | 26 | @Test 27 | public void withPolicy() { 28 | String[] aaids = {"ABCD#ABCD"}; 29 | AuthenticationRequest authReq= new AuthenticationRequestGeneration("https://uaf.ebay.com/uaf/facets",aaids ).createAuthenticationRequest(new NotaryImpl()); 30 | assertNotNull(authReq); 31 | logger.info(gson.toJson(authReq)); 32 | } 33 | 34 | class NotaryImpl implements Notary { 35 | 36 | public boolean verify(String dataToSign, String signature) { 37 | return signature.startsWith(TEST_SIGNATURE); 38 | } 39 | 40 | public String sign(String dataToSign) { 41 | // For testing 42 | return TEST_SIGNATURE; 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/Tags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | import java.util.Map.Entry; 22 | 23 | public class Tags { 24 | 25 | private Map tags = new HashMap(); 26 | 27 | public void add(Tag t) { 28 | tags.put(t.id, t); 29 | } 30 | 31 | public void addAll(Tags all) { 32 | tags.putAll(all.getTags()); 33 | } 34 | 35 | public Map getTags() { 36 | return tags; 37 | } 38 | 39 | public String toString() { 40 | StringBuilder res = new StringBuilder(); 41 | for (Entry tag : tags.entrySet()) { 42 | res.append(", "); 43 | res.append(tag.getValue().toString()); 44 | } 45 | if (res.length() > 0) { 46 | return "{" + res.substring(1) + "}"; 47 | } else { 48 | return "{}"; 49 | } 50 | 51 | } 52 | 53 | public String toUAFV1TLV() { 54 | return null; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/Tags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | import java.util.Map.Entry; 22 | 23 | public class Tags { 24 | 25 | private Map tags = new HashMap(); 26 | 27 | public void add (Tag t){ 28 | tags.put(t.id, t); 29 | } 30 | 31 | public void addAll (Tags all){ 32 | tags.putAll(all.getTags()); 33 | } 34 | 35 | public Map getTags (){ 36 | return tags; 37 | } 38 | 39 | public String toString (){ 40 | StringBuilder res = new StringBuilder(); 41 | for (Entry tag : tags.entrySet()) { 42 | res.append(", "); 43 | res.append(tag.getValue().toString()); 44 | } 45 | if (res.length()>0){ 46 | return "{" + res.substring(1) + "}"; 47 | } else { 48 | return "{}"; 49 | } 50 | 51 | } 52 | 53 | public String toUAFV1TLV (){ 54 | return null; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/TagsEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public enum TagsEnum { 20 | 21 | UAF_CMD_STATUS_ERR_UNKNOWN (0x01), 22 | TAG_UAFV1_REG_ASSERTION(0x3E01), 23 | TAG_UAFV1_AUTH_ASSERTION(0x3E02), 24 | TAG_UAFV1_KRD(0x3E03), 25 | TAG_UAFV1_SIGNED_DATA(0x3E04), 26 | TAG_ATTESTATION_CERT(0x2E05), 27 | TAG_SIGNATURE(0x2E06), 28 | TAG_ATTESTATION_BASIC_FULL(0x3E07), 29 | TAG_ATTESTATION_BASIC_SURROGATE(0x3E08), 30 | TAG_KEYID(0x2E09), 31 | TAG_FINAL_CHALLENGE(0x2E0A), 32 | TAG_AAID(0x2E0B), 33 | TAG_PUB_KEY(0x2E0C), 34 | TAG_COUNTERS(0x2E0D), 35 | TAG_ASSERTION_INFO(0x2E0E), 36 | TAG_AUTHENTICATOR_NONCE(0x2E0F), 37 | TAG_TRANSACTION_CONTENT_HASH(0x2E10), 38 | TAG_EXTENSION(0x3E11), 39 | TAG_EXTENSION_NON_CRITICAL(0x3E12), 40 | TAG_EXTENSION_ID(0x2E13), 41 | TAG_EXTENSION_DATA(0x2E14) 42 | ; 43 | 44 | final public int id; 45 | 46 | TagsEnum (int id){ 47 | this.id = id; 48 | } 49 | 50 | public static TagsEnum get(int id){ 51 | for (TagsEnum tag : TagsEnum.values()) { 52 | if (tag.id == id){ 53 | return tag; 54 | } 55 | } 56 | return null; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/ops/RegistrationRequestGenerationTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.ops; 2 | 3 | import static org.junit.Assert.assertNotNull; 4 | import static org.junit.Assert.assertTrue; 5 | 6 | import java.util.logging.Logger; 7 | 8 | import org.bouncycastle.util.encoders.Base64; 9 | import org.ebayopensource.fido.uaf.crypto.Notary; 10 | import org.ebayopensource.fido.uaf.msg.RegistrationRequest; 11 | import org.junit.Test; 12 | 13 | import com.google.gson.Gson; 14 | 15 | public class RegistrationRequestGenerationTest { 16 | 17 | private static final String TEST_SIGNATURE = "test_signature"; 18 | private Logger logger = Logger.getLogger(this.getClass().getName()); 19 | Gson gson = new Gson (); 20 | 21 | @Test 22 | public void notNull() { 23 | RegistrationRequest regReq = new RegistrationRequestGeneration().createRegistrationRequest("Username", new NotaryImpl()); 24 | 25 | assertNotNull(regReq); 26 | logger.info(gson.toJson(regReq)); 27 | } 28 | 29 | @Test 30 | public void basic() { 31 | Notary notary = new NotaryImpl(); 32 | RegistrationRequest regReq = new RegistrationRequestGeneration().createRegistrationRequest("Username", notary); 33 | 34 | String serverData = regReq.header.serverData; 35 | serverData = new String (Base64.decode(serverData)); 36 | assertTrue(notary.verify(serverData,serverData)); 37 | assertTrue(RegistrationRequestGeneration.APP_ID.equals(regReq.header.appID)); 38 | logger.info(gson.toJson(regReq)); 39 | } 40 | 41 | class NotaryImpl implements Notary { 42 | 43 | public boolean verify(String dataToSign, String signature) { 44 | return signature.startsWith(TEST_SIGNATURE); 45 | } 46 | 47 | public String sign(String dataToSign) { 48 | // For testing 49 | return TEST_SIGNATURE; 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/stats/Dash.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.stats; 18 | 19 | import java.util.ArrayList; 20 | import java.util.HashMap; 21 | import java.util.List; 22 | import java.util.Map; 23 | import java.util.Properties; 24 | 25 | public class Dash { 26 | 27 | public static String LAST_REG_REQ = "LAST_REG_REQ"; 28 | public static String LAST_REG_RES = "LAST_REG_RES"; 29 | public static String LAST_AUTH_REQ = "LAST_AUTH_REQ"; 30 | public static String LAST_AUTH_RES = "LAST_AUTH_RES"; 31 | public static String LAST_DEREG_REQ = "LAST_DEREG_REQ"; 32 | 33 | private static Dash instance = new Dash(); 34 | public Map stats = new HashMap(); 35 | public List history = new ArrayList(100); 36 | public List uuids = new ArrayList(); 37 | public List facetIds = new ArrayList(); 38 | 39 | private Dash (){ 40 | //Init 41 | } 42 | 43 | public static Dash getInstance (){ 44 | return instance; 45 | } 46 | 47 | public void add(Object o){ 48 | if (history.size() >99){ 49 | history.remove(0); 50 | } 51 | history.add(o); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/TagsEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.tlv; 18 | 19 | public enum TagsEnum { 20 | 21 | 22 | UAF_CMD_STATUS_ERR_UNKNOWN (0x01), 23 | TAG_UAFV1_REG_ASSERTION(0x3E01), 24 | TAG_UAFV1_AUTH_ASSERTION(0x3E02), 25 | TAG_UAFV1_KRD(0x3E03), 26 | TAG_UAFV1_SIGNED_DATA(0x3E04), 27 | TAG_ATTESTATION_CERT(0x2E05), 28 | TAG_SIGNATURE(0x2E06), 29 | TAG_ATTESTATION_BASIC_FULL(0x3E07), 30 | TAG_ATTESTATION_BASIC_SURROGATE(0x3E08), 31 | TAG_KEYID(0x2E09), 32 | TAG_FINAL_CHALLENGE(0x2E0A), 33 | TAG_AAID(0x2E0B), 34 | TAG_PUB_KEY(0x2E0C), 35 | TAG_COUNTERS(0x2E0D), 36 | TAG_ASSERTION_INFO(0x2E0E), 37 | TAG_AUTHENTICATOR_NONCE(0x2E0F), 38 | TAG_TRANSACTION_CONTENT_HASH(0x2E10), 39 | TAG_EXTENSION(0x3E11), 40 | TAG_EXTENSION_NON_CRITICAL(0x3E12), 41 | TAG_EXTENSION_ID(0x2E13), 42 | TAG_EXTENSION_DATA(0x2E14) 43 | ; 44 | 45 | final public int id; 46 | 47 | TagsEnum (int id){ 48 | this.id = id; 49 | } 50 | 51 | public static TagsEnum get(int id){ 52 | for (TagsEnum tag : TagsEnum.values()) { 53 | if (tag.id == id){ 54 | return tag; 55 | } 56 | } 57 | return null; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/layout/fingerprint_dialog_backup.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 33 | 34 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/FixedCertFidoAttestationSigner.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import android.util.Log; 4 | 5 | import org.ebayopensource.fido.uaf.client.AttestCert; 6 | import org.spongycastle.jce.interfaces.ECPublicKey; 7 | 8 | import java.io.IOException; 9 | import java.math.BigInteger; 10 | import java.security.GeneralSecurityException; 11 | import java.security.PrivateKey; 12 | 13 | public class FixedCertFidoAttestationSigner implements FidoAttestationSigner { 14 | 15 | private static final String TAG = FixedCertFidoAttestationSigner.class.getSimpleName(); 16 | 17 | public byte[] signWithAttestationCert(byte[] dataForSigning) { 18 | try { 19 | PrivateKey priv = 20 | KeyCodec.getPrivKey(Base64url.decode(AttestCert.priv)); 21 | 22 | Log.i(TAG, " : dataForSigning : " 23 | + Base64url.encodeToString(dataForSigning)); 24 | 25 | BigInteger[] signatureGen = NamedCurve.signAndFromatToRS(priv, 26 | SHA.sha(dataForSigning, "SHA-256")); 27 | 28 | boolean verify = NamedCurve.verify( 29 | KeyCodec.getBCKeyAsRawBytes((ECPublicKey) KeyCodec.getPubKey(Base64url.decode(AttestCert.pubCert))), 30 | SHA.sha(dataForSigning, "SHA-256"), 31 | Asn1.decodeToBigIntegerArray(Asn1.getEncoded(signatureGen))); 32 | if (!verify) { 33 | throw new RuntimeException("Signatire match fail"); 34 | } 35 | byte[] ret = Asn1.toRawSignatureBytes(signatureGen); 36 | Log.i(TAG, " : signature : " + Base64url.encodeToString(ret)); 37 | 38 | return ret; 39 | } catch(GeneralSecurityException | IOException e) { 40 | throw new RuntimeException(e); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/SHA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | import java.security.MessageDigest; 20 | import java.security.NoSuchAlgorithmException; 21 | 22 | public class SHA { 23 | 24 | public static String sha1(String base) { 25 | return sha(base, "SHA-1"); 26 | } 27 | 28 | public static String sha256(String base) { 29 | return sha(base, "SHA-256"); 30 | } 31 | 32 | public static String sha(String base, String alg) { 33 | try { 34 | MessageDigest digest = MessageDigest.getInstance(alg); 35 | byte[] hash = digest.digest(base.getBytes("UTF-8")); 36 | StringBuffer hexString = new StringBuffer(); 37 | 38 | for (int i = 0; i < hash.length; i++) { 39 | String hex = Integer.toHexString(0xff & hash[i]); 40 | if (hex.length() == 1) 41 | hexString.append('0'); 42 | hexString.append(hex); 43 | } 44 | 45 | return hexString.toString(); 46 | } catch (Exception ex) { 47 | throw new RuntimeException(ex); 48 | } 49 | } 50 | 51 | public static byte[] sha(byte[] base, String alg) throws NoSuchAlgorithmException { 52 | MessageDigest digest = MessageDigest.getInstance(alg); 53 | return digest.digest(base); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/crypto/SHA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | import java.security.MessageDigest; 20 | import java.security.NoSuchAlgorithmException; 21 | 22 | public class SHA { 23 | 24 | public static String sha1(String base) { 25 | return sha(base, "SHA-1"); 26 | } 27 | 28 | public static String sha256(String base) { 29 | return sha(base, "SHA-256"); 30 | } 31 | 32 | public static String sha(String base, String alg) { 33 | try { 34 | MessageDigest digest = MessageDigest.getInstance(alg); 35 | byte[] hash = digest.digest(base.getBytes("UTF-8")); 36 | StringBuffer hexString = new StringBuffer(); 37 | 38 | for (int i = 0; i < hash.length; i++) { 39 | String hex = Integer.toHexString(0xff & hash[i]); 40 | if (hex.length() == 1) 41 | hexString.append('0'); 42 | hexString.append(hex); 43 | } 44 | 45 | return hexString.toString(); 46 | } catch (Exception ex) { 47 | throw new RuntimeException(ex); 48 | } 49 | } 50 | 51 | public static byte[] sha(byte[] base, String alg) 52 | throws NoSuchAlgorithmException { 53 | MessageDigest digest = MessageDigest.getInstance(alg); 54 | return digest.digest(base); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/res/util/FetchRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.res.util; 18 | 19 | import org.ebayopensource.fido.uaf.msg.AuthenticationRequest; 20 | import org.ebayopensource.fido.uaf.msg.RegistrationRequest; 21 | import org.ebayopensource.fido.uaf.ops.AuthenticationRequestGeneration; 22 | import org.ebayopensource.fido.uaf.ops.RegistrationRequestGeneration; 23 | 24 | public class FetchRequest { 25 | 26 | private String appId; 27 | private String[] aaids; 28 | 29 | public FetchRequest() { 30 | this.appId = ""; 31 | this.aaids = null; 32 | } 33 | 34 | public FetchRequest(String appId, String[] aaids) { 35 | this.appId = appId; 36 | this.aaids = aaids; 37 | } 38 | 39 | public RegistrationRequest getRegistrationRequest(String username) { 40 | RegistrationRequest request = new RegistrationRequestGeneration(appId, 41 | aaids).createRegistrationRequest(username, 42 | NotaryImpl.getInstance()); 43 | return request; 44 | } 45 | 46 | public AuthenticationRequest getAuthenticationRequest() { 47 | AuthenticationRequest authReq = new AuthenticationRequestGeneration( 48 | appId, aaids).createAuthenticationRequest(NotaryImpl 49 | .getInstance()); 50 | return authReq; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/client/AttestCert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.client; 18 | 19 | public class AttestCert { 20 | 21 | public static String base64DERCert = "MIIB-TCCAZ-gAwIBAgIEVTFM0zAJBgcqhkjOPQQBMIGEMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCFNhbiBKb3NlMRMwEQYDVQQKDAplQmF5LCBJbmMuMQwwCgYDVQQLDANUTlMxEjAQBgNVBAMMCWVCYXksIEluYzEeMBwGCSqGSIb3DQEJARYPbnBlc2ljQGViYXkuY29tMB4XDTE1MDQxNzE4MTEzMVoXDTE1MDQyNzE4MTEzMVowgYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAoMCmVCYXksIEluYy4xDDAKBgNVBAsMA1ROUzESMBAGA1UEAwwJZUJheSwgSW5jMR4wHAYJKoZIhvcNAQkBFg9ucGVzaWNAZWJheS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ8hw5lHTUXvZ3SzY9argbOOBD2pn5zAM4mbShwQyCL5bRskTL3HVPWPQxqYVM-3pJtJILYqOWsIMd5Rb_h8D-EMAkGByqGSM49BAEDSQAwRgIhAIpkop_L3fOtm79Q2lKrKxea-KcvA1g6qkzaj42VD2hgAiEArtPpTEADIWz2yrl5XGfJVcfcFmvpMAuMKvuE1J73jp4"; 22 | public static String pubCert = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPIcOZR01F72d0s2PWq4GzjgQ9qZ-cwDOJm0ocEMgi-W0bJEy9x1T1j0MamFTPt6SbSSC2KjlrCDHeUW_4fA_hA"; 23 | public static String priv = "MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgezOOy1TykYoCiwOdJkKCfScV3-lN1v_E9keawMikuFygCgYIKoZIzj0DAQehRANCAAQ8hw5lHTUXvZ3SzY9argbOOBD2pn5zAM4mbShwQyCL5bRskTL3HVPWPQxqYVM-3pJtJILYqOWsIMd5Rb_h8D-E"; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/crypto/Asn1Test.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.crypto; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.io.IOException; 6 | import java.math.BigInteger; 7 | 8 | import org.apache.commons.codec.binary.Base64; 9 | import org.junit.Test; 10 | 11 | 12 | public class Asn1Test { 13 | 14 | @Test 15 | public void test() throws IOException { 16 | String signatureB64 = "MEUCIAbY7xI6QfBlurbgIax85rB583xy37CdFadbvR9QJJAHAiEA8REEB2ouX34TYPqeSDQigJTKg3GmeS1sx6_5BJjtT6U"; 17 | BigInteger[] bigIntegerArray = Asn1.decodeToBigIntegerArray(Base64.decodeBase64(signatureB64)); 18 | byte[] encoded = Asn1.getEncoded(bigIntegerArray); 19 | assertTrue(signatureB64.equals(Base64.encodeBase64URLSafeString(encoded))); 20 | } 21 | 22 | @Test 23 | public void rick() throws IOException { 24 | String signatureB64 = "MEQCIAwtk4DStr2MqkrAlOVG+nyQxbS6tnBpVi7OcKCm8/5lAiBjVsv+b+7nI/306iNHrso/ruOaxY8IJy3jw2/zr17JEQ=="; 25 | BigInteger[] bigIntegerArray = Asn1.decodeToBigIntegerArray(Base64.decodeBase64(signatureB64)); 26 | byte[] encoded = Asn1.getEncoded(bigIntegerArray); 27 | String encodeBackToBase64 = Base64.encodeBase64String(encoded); 28 | assertTrue(signatureB64.equals(encodeBackToBase64)); 29 | } 30 | 31 | @Test 32 | public void rickSafeURLEncoding() throws IOException { 33 | String signatureB64 = "MEQCIAwtk4DStr2MqkrAlOVG+nyQxbS6tnBpVi7OcKCm8/5lAiBjVsv+b+7nI/306iNHrso/ruOaxY8IJy3jw2/zr17JEQ=="; 34 | String signatureB64Safe = "MEQCIAwtk4DStr2MqkrAlOVG-nyQxbS6tnBpVi7OcKCm8_5lAiBjVsv-b-7nI_306iNHrso_ruOaxY8IJy3jw2_zr17JEQ"; 35 | BigInteger[] bigIntegerArray = Asn1.decodeToBigIntegerArray(Base64.decodeBase64(signatureB64)); 36 | BigInteger[] bigIntegerArrayFromURLSafe = Asn1.decodeToBigIntegerArray(Base64.decodeBase64(signatureB64Safe)); 37 | assertTrue(bigIntegerArray[0].equals(bigIntegerArrayFromURLSafe[0])); 38 | assertTrue(bigIntegerArray[1].equals(bigIntegerArrayFromURLSafe[1])); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/tlv/ByteInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Yubico. 3 | * 4 | * Use of this source code is governed by a BSD-style 5 | * license that can be found in the LICENSE file. 6 | */ 7 | 8 | package org.ebayopensource.fido.uaf.tlv; 9 | 10 | import java.io.ByteArrayInputStream; 11 | import java.io.DataInputStream; 12 | import java.io.IOException; 13 | 14 | /** 15 | * Provides an easy way to read a byte array in chunks. 16 | */ 17 | // ByteArrayInputStream cannot throw IOExceptions, so this class is converting checked exceptions to unchecked. 18 | public class ByteInputStream extends DataInputStream { 19 | 20 | public ByteInputStream(byte[] data) { 21 | super(new ByteArrayInputStream(data)); 22 | } 23 | 24 | public byte[] read(int numberOfBytes) { 25 | byte[] readBytes = new byte[numberOfBytes]; 26 | try { 27 | readFully(readBytes); 28 | } catch (IOException e) { 29 | throw new AssertionError(); 30 | } 31 | return readBytes; 32 | } 33 | 34 | public byte[] readAll() { 35 | try { 36 | byte[] readBytes = new byte[available()]; 37 | readFully(readBytes); 38 | return readBytes; 39 | } catch (IOException e) { 40 | throw new AssertionError(); 41 | } 42 | } 43 | 44 | public int readInteger() { 45 | try { 46 | return readInt(); 47 | } catch (IOException e) { 48 | throw new AssertionError(); 49 | } 50 | } 51 | 52 | public byte readSigned() { 53 | try { 54 | return readByte(); 55 | } catch (IOException e) { 56 | throw new AssertionError(); 57 | } 58 | } 59 | 60 | public int readUnsigned() { 61 | try { 62 | return readUnsignedByte(); 63 | } catch (IOException e) { 64 | throw new AssertionError(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/tlv/ByteInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Yubico. 3 | * 4 | * Use of this source code is governed by a BSD-style 5 | * license that can be found in the LICENSE file. 6 | */ 7 | 8 | package org.ebayopensource.fido.uaf.tlv; 9 | 10 | import java.io.ByteArrayInputStream; 11 | import java.io.DataInputStream; 12 | import java.io.IOException; 13 | 14 | /** 15 | * Provides an easy way to read a byte array in chunks. 16 | */ 17 | // ByteArrayInputStream cannot throw IOExceptions, so this class is converting checked exceptions to unchecked. 18 | public class ByteInputStream extends DataInputStream { 19 | 20 | public ByteInputStream(byte[] data) { 21 | super(new ByteArrayInputStream(data)); 22 | } 23 | 24 | public byte[] read(int numberOfBytes) { 25 | byte[] readBytes = new byte[numberOfBytes]; 26 | try { 27 | readFully(readBytes); 28 | } catch (IOException e) { 29 | throw new AssertionError(); 30 | } 31 | return readBytes; 32 | } 33 | 34 | public byte[] readAll() { 35 | try { 36 | byte[] readBytes = new byte[available()]; 37 | readFully(readBytes); 38 | return readBytes; 39 | } catch (IOException e) { 40 | throw new AssertionError(); 41 | } 42 | } 43 | 44 | public int readInteger() { 45 | try { 46 | return readInt(); 47 | } catch (IOException e) { 48 | throw new AssertionError(); 49 | } 50 | } 51 | 52 | public byte readSigned() { 53 | try { 54 | return readByte(); 55 | } catch (IOException e) { 56 | throw new AssertionError(); 57 | } 58 | } 59 | 60 | public int readUnsigned() { 61 | try { 62 | return readUnsignedByte(); 63 | } catch (IOException e) { 64 | throw new AssertionError(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/res/util/NotaryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.res.util; 18 | 19 | import org.ebayopensource.fido.uaf.crypto.Notary; 20 | import org.ebayopensource.fido.uaf.crypto.SHA; 21 | import org.ebayopensource.fido.uaf.crypto.HMAC; 22 | import org.apache.commons.codec.binary.Base64; 23 | import java.security.MessageDigest; 24 | 25 | import java.util.logging.Logger; 26 | 27 | /** 28 | * This is just en example implementation. You should implement this class based on your operational environment. 29 | */ 30 | public class NotaryImpl implements Notary { 31 | 32 | private Logger logger = Logger.getLogger(this.getClass().getName()); 33 | private String hmacSecret = "HMAC-is-just-one-way"; 34 | private static Notary instance = new NotaryImpl(); 35 | 36 | private NotaryImpl() { 37 | // Init 38 | } 39 | 40 | public static Notary getInstance() { 41 | return instance; 42 | } 43 | 44 | public String sign(String signData) { 45 | try { 46 | return Base64.encodeBase64URLSafeString(HMAC.sign(signData, hmacSecret)); 47 | } catch (Exception e) { 48 | logger.info(e.toString()); 49 | } 50 | return null; 51 | } 52 | 53 | public boolean verify(String signData, String signature) { 54 | try { 55 | return MessageDigest.isEqual(Base64.decodeBase64(signature), HMAC.sign(signData, hmacSecret)); 56 | } catch (Exception e) { 57 | logger.info(e.toString()); 58 | } 59 | return false; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /fidouaf/src/main/java/org/ebayopensource/fidouaf/res/util/DeregRequestProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fidouaf.res.util; 18 | 19 | import org.ebayopensource.fido.uaf.msg.DeregisterAuthenticator; 20 | import org.ebayopensource.fido.uaf.msg.DeregistrationRequest; 21 | import org.ebayopensource.fido.uaf.storage.AuthenticatorRecord; 22 | import org.ebayopensource.fidouaf.stats.Dash; 23 | 24 | import com.google.gson.Gson; 25 | 26 | public class DeregRequestProcessor { 27 | private Gson gson = new Gson(); 28 | 29 | public String process(String payload) { 30 | if (!payload.isEmpty()) { 31 | try { 32 | DeregistrationRequest[] deregFromJson = gson.fromJson(payload, 33 | DeregistrationRequest[].class); 34 | DeregistrationRequest deregRequest = deregFromJson[0]; 35 | Dash.getInstance().stats.put(Dash.LAST_DEREG_REQ, deregFromJson); 36 | AuthenticatorRecord authRecord = new AuthenticatorRecord(); 37 | for (DeregisterAuthenticator authenticator : deregRequest.authenticators) { 38 | authRecord.AAID = authenticator.aaid; 39 | authRecord.KeyID = authenticator.keyID; 40 | try { 41 | String Key = authRecord.toString(); 42 | StorageImpl.getInstance().deleteRegistrationRecord(Key); 43 | } catch (Exception e) { 44 | return "Failure: Problem in deleting record from local DB"; 45 | } 46 | } 47 | } catch (Exception e) { 48 | return "Failure: problem processing deregistration request"; 49 | } 50 | return "Success"; 51 | } 52 | return "Failure: problem processing deregistration request"; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /fido-uaf-core/src/main/java/org/ebayopensource/fido/uaf/crypto/HMAC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | import java.io.UnsupportedEncodingException; 20 | import java.security.InvalidKeyException; 21 | import java.security.InvalidParameterException; 22 | import java.security.NoSuchAlgorithmException; 23 | import java.security.spec.InvalidKeySpecException; 24 | 25 | import javax.crypto.Mac; 26 | import javax.crypto.SecretKey; 27 | import javax.crypto.SecretKeyFactory; 28 | import javax.crypto.spec.PBEKeySpec; 29 | 30 | public class HMAC { 31 | 32 | public static byte[] sign(String toSign, String secret) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, UnsupportedEncodingException { 33 | validateParameters(toSign, secret); 34 | String password = secret; 35 | PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray()); 36 | SecretKeyFactory kf = SecretKeyFactory 37 | .getInstance("PBEWithMD5AndDES"); 38 | SecretKey passwordKey = kf.generateSecret(keySpec); 39 | 40 | Mac mac = Mac.getInstance("HmacSHA256"); 41 | mac.init(passwordKey); 42 | byte[] text = toSign.getBytes("UTF-8"); 43 | byte[] signatureBytes = mac.doFinal(text); 44 | 45 | return signatureBytes; 46 | } 47 | 48 | private static void validateParameters(String toSign, String secret) { 49 | if (toSign == null || toSign.isEmpty()){ 50 | throw new InvalidParameterException("Empty string for signing"); 51 | } 52 | if (secret == null || secret.isEmpty()){ 53 | throw new InvalidParameterException("Empty secret for signing"); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /fidouafclient/app/src/main/java/org/ebayopensource/fido/uaf/crypto/HMAC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 eBay Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.ebayopensource.fido.uaf.crypto; 18 | 19 | import java.io.UnsupportedEncodingException; 20 | import java.security.InvalidKeyException; 21 | import java.security.InvalidParameterException; 22 | import java.security.NoSuchAlgorithmException; 23 | import java.security.spec.InvalidKeySpecException; 24 | 25 | import javax.crypto.Mac; 26 | import javax.crypto.SecretKey; 27 | import javax.crypto.SecretKeyFactory; 28 | import javax.crypto.spec.PBEKeySpec; 29 | 30 | public class HMAC { 31 | 32 | public static byte[] sign(String toSign, String secret) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, UnsupportedEncodingException { 33 | validateParameters(toSign, secret); 34 | String password = secret; 35 | PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray()); 36 | SecretKeyFactory kf = SecretKeyFactory 37 | .getInstance("PBEWithMD5AndDES"); 38 | SecretKey passwordKey = kf.generateSecret(keySpec); 39 | 40 | Mac mac = Mac.getInstance("HmacSHA256"); 41 | mac.init(passwordKey); 42 | byte[] text = toSign.getBytes("UTF-8"); 43 | byte[] signatureBytes = mac.doFinal(text); 44 | 45 | return signatureBytes; 46 | } 47 | 48 | private static void validateParameters(String toSign, String secret) { 49 | if (toSign == null || toSign.isEmpty()){ 50 | throw new InvalidParameterException("Empty string for signing"); 51 | } 52 | if (secret == null || secret.isEmpty()){ 53 | throw new InvalidParameterException("Empty secret for signing"); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /fido-uaf-core/src/test/java/org/ebayopensource/fido/uaf/msg/AuthenticationRequestTest.java: -------------------------------------------------------------------------------- 1 | package org.ebayopensource.fido.uaf.msg; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | import org.junit.Test; 8 | 9 | import com.google.gson.Gson; 10 | 11 | public class AuthenticationRequestTest { 12 | 13 | private Logger logger = Logger.getLogger(this.getClass().getName()); 14 | Gson gson = new Gson (); 15 | 16 | @Test 17 | public void test() { 18 | AuthenticationRequest authRequest = gson.fromJson(getTestAuthRequest(), AuthenticationRequest.class); 19 | assertNotNull(authRequest); 20 | logger.info(gson.toJson(authRequest)); 21 | } 22 | 23 | String getTestAuthRequest (){ 24 | return "{\"header\": {\"upv\": {\"major\": 1,\"minor\": 0},\"op\": \"Auth\",\"appID\": \"https://uaf-test-1.noknoktest.com:8443/SampleApp/uaf/facets\",\"serverData\": \"5s7n8-7_LDAtRIKKYqbAtTTOezVKCjl2mPorYzbpxRrZ-_3wWroMXsF_pLYjNVm_l7bplAx4bkEwK6ibil9EHGfdfKOQ1q0tyEkNJFOgqdjVmLioroxgThlj8Istpt7q\"},\"challenge\": \"HQ1VkTUQC1NJDOo6OOWdxewrb9i5WthjfKIehFxpeuU\",\"policy\": {\"accepted\": [[{\"userVerification\": 512,\"keyProtection\": 1,\"tcDisplay\": 1,\"authenticationAlgorithms\": [1],\"assertionSchemes\": [\"UAFV1TLV\"]}],[{\"userVerification\": 4,\"keyProtection\": 1,\"tcDisplay\": 1,\"authenticationAlgorithms\": [1],\"assertionSchemes\": [\"UAFV1TLV\"]}],[{\"userVerification\": 4,\"keyProtection\": 1,\"tcDisplay\": 1,\"authenticationAlgorithms\": [2]}],[{\"userVerification\": 2,\"keyProtection\": 4,\"tcDisplay\": 1,\"authenticationAlgorithms\": [2]}],[{\"userVerification\": 4,\"keyProtection\": 2,\"tcDisplay\": 1,\"authenticationAlgorithms\": [1,3]}],[{\"userVerification\": 2,\"keyProtection\": 2,\"authenticationAlgorithms\": [2]}],[{\"userVerification\": 32,\"keyProtection\": 2,\"assertionSchemes\": [\"UAFV1TLV\"]},{\"userVerification\": 2,\"authenticationAlgorithms\": [1,3],\"assertionSchemes\": [\"UAFV1TLV\"]},{\"userVerification\": 2,\"authenticationAlgorithms\": [1,3],\"assertionSchemes\": [\"UAFV1TLV\"]},{\"userVerification\": 4,\"keyProtection\": 1,\"authenticationAlgorithms\": [1,3],\"assertionSchemes\": [\"UAFV1TLV\"]}]],\"disallowed\": [{\"userVerification\": 512,\"keyProtection\": 16,\"assertionSchemes\": [\"UAFV1TLV\"]},{\"userVerification\": 256,\"keyProtection\": 16}]}}"; 25 | } 26 | } -------------------------------------------------------------------------------- /fidouafclient/app/src/main/res/layout/fingerprint_dialog_container.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 45 | 46 | 52 |