Skip to content

Commit

Permalink
Merge PR Yubico#820.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Nov 17, 2022
2 parents f588ec5 + 19d72f0 commit caea13c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 37 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Version 6.0.1 (released 2022-11-17)
** Android: Fix issues of YubiKey NEO NFC connectivity on certain phones

* Version 6.0.0 (released 2022-11-15)
** Complete redesign of the UI using Flutter.
** Add support for Android.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import com.yubico.authenticator.yubikit.withConnection
import com.yubico.yubikit.android.transport.usb.UsbYubiKeyDevice
import com.yubico.yubikit.core.Transport
import com.yubico.yubikit.core.YubiKeyDevice
import com.yubico.yubikit.core.YubiKeyType
import com.yubico.yubikit.core.application.ApplicationNotAvailableException
import com.yubico.yubikit.core.smartcard.ApduException
import com.yubico.yubikit.core.smartcard.SW
import com.yubico.yubikit.core.smartcard.SmartCardConnection
import com.yubico.yubikit.core.smartcard.SmartCardProtocol
import com.yubico.yubikit.core.util.Result
import com.yubico.yubikit.oath.*
import com.yubico.yubikit.support.DeviceUtil
Expand All @@ -61,6 +61,7 @@ class OathManager(
companion object {
const val TAG = "OathManager"
const val NFC_DATA_CLEANUP_DELAY = 30L * 1000 // 30s
val OTP_AID = byteArrayOf(0xa0.toByte(), 0x00, 0x00, 0x05, 0x27, 0x20, 0x01, 0x01)
}

private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()
Expand Down Expand Up @@ -253,35 +254,22 @@ class OathManager(
}
}

// Update deviceInfo since the deviceId has changed
if (oath.version.isLessThan(4, 0, 0) && connection.transport == Transport.NFC) {
// NEO over NFC, need a new connection to select another applet
device.requestConnection(SmartCardConnection::class.java) {
try {
val deviceInfo = DeviceUtil.readInfo(it.value, null)
appViewModel.setDeviceInfo(
deviceInfo.model(
DeviceUtil.getName(deviceInfo, YubiKeyType.NEO),
true,
null
)
)
} catch (e: Exception) {
Log.e(TAG, "Failed to read device info", e.toString())
}
}
} else {
// Not a NEO over NFC, reuse existing connection
val pid = (device as? UsbYubiKeyDevice)?.pid
val deviceInfo = DeviceUtil.readInfo(connection, pid)
appViewModel.setDeviceInfo(
deviceInfo.model(
DeviceUtil.getName(deviceInfo, pid?.type),
device.transport == Transport.NFC,
pid?.value
)
)
// NEO over NFC, select OTP applet before reading info
SmartCardProtocol(connection).select(OTP_AID)
}

// Update deviceInfo since the deviceId has changed
val pid = (device as? UsbYubiKeyDevice)?.pid
val deviceInfo = DeviceUtil.readInfo(connection, pid)
appViewModel.setDeviceInfo(
deviceInfo.model(
DeviceUtil.getName(deviceInfo, pid?.type),
device.transport == Transport.NFC,
pid?.value
)
)

}
}
Log.d(
Expand Down
10 changes: 5 additions & 5 deletions helper/version_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(6, 0, 1, 0),
prodvers=(6, 0, 1, 0),
filevers=(6, 0, 2, 0),
prodvers=(6, 0, 2, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -31,12 +31,12 @@ VSVersionInfo(
'040904b0',
[StringStruct('CompanyName', 'Yubico'),
StringStruct('FileDescription', 'Yubico Authenticator Helper'),
StringStruct('FileVersion', '6.0.1-dev.1'),
StringStruct('FileVersion', '6.0.2-dev.1'),
StringStruct('LegalCopyright', 'Copyright (c) 2022 Yubico AB'),
StringStruct('OriginalFilename', 'authenticator-helper.exe'),
StringStruct('ProductName', 'Yubico Authenticator'),
StringStruct('ProductVersion', '6.0.1-dev.1')])
]),
StringStruct('ProductVersion', '6.0.2-dev.1')])
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]
)
4 changes: 2 additions & 2 deletions lib/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# This field is updated by running ./set-version.py <version>
# DO NOT MANUALLY EDIT THIS!
version: 6.0.1-dev.1+60003
version: 6.0.2-dev.1+60004

environment:
sdk: ">=2.17.0 <3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion resources/win/release-win.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$version="6.0.1-dev.1"
$version="6.0.2-dev.1"

echo "Renaming the Actions folder and moving it"
mv yubioath-desktop-* release
Expand Down

0 comments on commit caea13c

Please sign in to comment.