-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
288 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
core/src/main/java/com/yubico/yubikit/core/application/SessionVersionOverride.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (C) 2024 Yubico. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.yubico.yubikit.core.application; | ||
|
||
import com.yubico.yubikit.core.Version; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* Adds support for overriding YubiKey session version number. | ||
* <p> | ||
* Internal use only. | ||
*/ | ||
public class SessionVersionOverride { | ||
|
||
@Nullable | ||
private static Version versionOverride = null; | ||
|
||
/** | ||
* Internal use only. | ||
* <p> | ||
* Override version of connected YubiKey with the specified version. | ||
* | ||
* @param version version to use instead of YubiKey version. Only applies if the major version | ||
* of the YubiKey is 0. | ||
*/ | ||
public static void set(@Nullable Version version) { | ||
versionOverride = version; | ||
} | ||
|
||
/** | ||
* Returns an applicable override of version. | ||
* | ||
* @param version The version which might be overridden. | ||
* @return Version to use. | ||
*/ | ||
static Version overrideOf(Version version) { | ||
return (versionOverride != null && version.major == 0) | ||
? versionOverride | ||
: version; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
core/src/main/java/com/yubico/yubikit/core/fido/FidoProtocol.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
core/src/main/java/com/yubico/yubikit/core/util/RandomUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
== Security domain | ||
yubikit-android 2.7.0 adds support for smart card communication over secure channel protocol (SCP) and management of SCP key information. The supported SCP versions are SCP03, SCP11a, SCP11b and SCP11c. | ||
|
||
More information about the protocols can be found at the following URLs: | ||
|
||
SCP03: https://globalplatform.org/specs-library/secure-channel-protocol-03-amendment-d-v1-2/ | ||
|
||
SCP11: https://globalplatform.org/specs-library/secure-channel-protocol-11-amendment-f/ | ||
|
||
The support is provided directly through the SDK's smart card protocol, which handles necessary handshakes and data encryption/decryption. Secure channel key management is handled by Security Domain Session. | ||
|
||
- SCP can be used for USB and NFC connections | ||
- because of how SCP works, communication over NFC might be less performant | ||
- SCP03 is supported only by Yubikeys with firmware version at least 5.3.0 | ||
- SCP11 is supported on firmware versions 5.7.2 and later | ||
- can be used over NFC or USB smart-card connection | ||
- any YubiKey application can be used over SCP | ||
- only NFC hardware with extended APDUs support can be used for SCP over NFC | ||
=== Using SCP | ||
To use SCP, an application first needs to acquire `ScpKeyParams` which contain information needed for establishing and communicating over the secured channel. | ||
|
||
The parameters are then used when constructing a specific session object. The following snippet shows how to create a SCP PIV session. | ||
|
||
[source,java] | ||
---- | ||
ScpKeyParams scpKeyParams = ...; | ||
PivSession piv = new PivSession(smartCardConnection, scpKeyParams); | ||
// use the session | ||
// all communication in the session is now secured through SCP | ||
piv.verifyPin(...); | ||
---- | ||
|
||
For working examples of SCP key management, see `SecurityDomainTests` tests suite. | ||
|
||
|
||
|
2 changes: 1 addition & 1 deletion
2
fido/src/main/java/com/yubico/yubikit/fido/ctap/PinUvAuthProtocolV1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
fido/src/main/java/com/yubico/yubikit/fido/ctap/PinUvAuthProtocolV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.