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