From e0baabd1046087a9f545d9ef65539c23eb91e85f Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 6 Jan 2020 11:12:50 +0000 Subject: Update the list of unsupported functions After some more research, I decided not to implement some of the methods provided by libnitrokey. This patch adds them to the list of unsupported functions in the readme, and removes them from the list of unimplemented functions in the todo list. --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index d4451bc..71d2377 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ Copyright (C) 2019-2020 Robin Krahl SPDX-License-Identifier: CC0-1.0 --> +# Unreleased +- List these libnitrokey functions as unsupported: + - `NK_change_firmware_password_pro` + - `NK_connect_with_ID` + - `NK_enable_firmware_update_pro` + - `NK_list_devices_by_cpuID` + - `NK_send_startup` + # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. - Implement `Display` for `Version`. -- cgit v1.2.1 From ddb175bd963070e837aa9207c2dee32ffffc51f4 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 30 Dec 2019 10:53:54 +0100 Subject: Add the Error::UnsupportedModelError variant This patch adds the UnsupportedModelError variant to the Error enum: When parsing the model returned by libnitrokey, we should provide a meaningful error message for unknown values. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 71d2377..73bf782 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ SPDX-License-Identifier: CC0-1.0 - `NK_enable_firmware_update_pro` - `NK_list_devices_by_cpuID` - `NK_send_startup` +- Implement connection by path: + - Add the `Error::UnsupportedDeviceError` variant. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From bcad061ed3e7777547c1b6fc9223dd65f752d94e Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 28 Dec 2019 23:53:24 +0100 Subject: Add the DeviceInfo struct In the next patch, we will add support for the NK_list_devices functions that returns a list of NK_device_info structs with information about the connected devices. This patch introduces the DeviceInfo struct that holds the information returned by NK_list_devices and that can be created from a NK_device_info struct. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 73bf782..3798540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ SPDX-License-Identifier: CC0-1.0 - `NK_send_startup` - Implement connection by path: - Add the `Error::UnsupportedDeviceError` variant. + - Add the `DeviceInfo` struct. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From c74b8b3ea8dc4fe7c6891ae120540f8da5623227 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 29 Dec 2019 12:51:28 +0100 Subject: Add list_devices function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds support for libnitrokey’s NK_list_devices function by introducing the top-level list_devices function. It returns a vector of DeviceInfo structs with information about all connected Nitrokey devices. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 3798540..15c76b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ SPDX-License-Identifier: CC0-1.0 - Implement connection by path: - Add the `Error::UnsupportedDeviceError` variant. - Add the `DeviceInfo` struct. + - Add the `list_devices` function. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From 97c772724dd1fe395e7154e0d71c3b2408436082 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 29 Dec 2019 13:15:04 +0100 Subject: Add the connect_path function to the Manager struct This patch adds the connect_path function to the Manager struct that uses NK_connect_with_path to connect to a Nitrokey device at a given USB path. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c76b3..abdcab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ SPDX-License-Identifier: CC0-1.0 - Add the `Error::UnsupportedDeviceError` variant. - Add the `DeviceInfo` struct. - Add the `list_devices` function. + - Add the `connect_path` function to the `Manager` struct. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From dbee55efa41496c8a683bfab96163facc93d6639 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 11 Jan 2020 20:05:39 +0100 Subject: Add support for the GET_STATUS command This patch adds support for the GET_STATUS command that returns the status information common to all Nitrokey devices. It can be accessed using the Device::get_status function and is stored in a Status struct. Due to a bug in the Storage firmware [0], the GET_STATUS command returns wrong firmware versions and serial numbers. Until this is fixed in libnitrokey [1], we have to manually execute the GET_DEVICE_STATUS command to fix these values for the Nitrokey Storage. Also, this leads to a name clash with the existing Storage::get_status function, which will be renamed in an upcoming patch. [0] https://github.com/Nitrokey/nitrokey-storage-firmware/issues/96 [1] https://github.com/Nitrokey/libnitrokey/issues/166 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index abdcab7..a9ef359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ SPDX-License-Identifier: CC0-1.0 - Add the `DeviceInfo` struct. - Add the `list_devices` function. - Add the `connect_path` function to the `Manager` struct. +- Add the `get_status` function to the `Device` trait. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From 6142752da1563c1ab873dc7069aeec72522cca99 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 11 Jan 2020 20:13:22 +0100 Subject: Rename Status::get_status to get_storage_status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the last patch, we added the get_status function to the Device trait. This patch renames the Storage::get_status function to get_storage_status to resolve the name clash – though allowed by the compiler, it is rather confusing for the end user. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index a9ef359..b477c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ SPDX-License-Identifier: CC0-1.0 - Add the `list_devices` function. - Add the `connect_path` function to the `Manager` struct. - Add the `get_status` function to the `Device` trait. +- Rename `Status::get_status` to `get_storage_status`. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From 73c8aebac338d3454d7e345ffd687324317077ec Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2020 12:00:15 +0100 Subject: Add the get_sd_card_usage function to the Storage struct This patch adds support for the NK_get_SD_usage_data function. It returns a range of the SD card that has not been accessed during this power cycle. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index b477c3b..cebe8cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ SPDX-License-Identifier: CC0-1.0 - Add the `connect_path` function to the `Manager` struct. - Add the `get_status` function to the `Device` trait. - Rename `Status::get_status` to `get_storage_status`. +- Add the `get_sd_card_usage` function to the `Storage` struct. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From f266ea63039c87886f871b068ef3dcdf851a1eca Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2020 13:48:56 +0100 Subject: Add the get_operation_status function to the Storage struct This patch adds support for the NK_get_progress_bar_value function: It adds the OperationStatus enum that stores the return value of this command and adds the get_operation_status function to the Storage struct that executes the command. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index cebe8cb..419a942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ SPDX-License-Identifier: CC0-1.0 - Add the `get_status` function to the `Device` trait. - Rename `Status::get_status` to `get_storage_status`. - Add the `get_sd_card_usage` function to the `Storage` struct. +- Add the `OperationStatus` enum and the `get_operation_status` function for + the `Storage` struct. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From 2e543445c3059fa9decdbef718caf84696bb8786 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2020 16:15:40 +0100 Subject: Add the fill_sd_card function to Storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds support for libnitrokey’s NK_fill_SD_card_with_random_data function. It is executed by the fill_sd_card function of the Storage struct. We also add a new test case that is set to ignore because it takes between 30 and 60 minutes to run. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 419a942..06836d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ SPDX-License-Identifier: CC0-1.0 - Add the `get_sd_card_usage` function to the `Storage` struct. - Add the `OperationStatus` enum and the `get_operation_status` function for the `Storage` struct. +- Add the `fill_sd_card` function to the `Storage` struct. # v0.4.0 (2020-01-02) - Remove the `test-pro` and `test-storage` features. -- cgit v1.2.1 From 43664ca3c449008e2859feb94e3142db3fa98625 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2020 17:45:06 +0100 Subject: Release v0.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This release adds support for these Nitrokey commands: For all devices: - Listing the connected devices and connecting to one of them (list_devices and Manager::connect_path). - Querying the status of a Nitrokey device (Device::get_status). For the Nitrokey Storage: - Getting the SD card usage (Storage::get_sd_card_usage). - Getting the status of a background operation (Storage::get_operation_status). - Filling the SD card with random data (Storage::fill_sd_card). With this release, we support all functions provided by libnitrokey – except those listed as unsupported in the readme file. Therefore we should be able to release a stable version 1.0.0 soon. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 06836d9..54ee7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Copyright (C) 2019-2020 Robin Krahl SPDX-License-Identifier: CC0-1.0 --> -# Unreleased +# v0.5.0 (2020-01-14) - List these libnitrokey functions as unsupported: - `NK_change_firmware_password_pro` - `NK_connect_with_ID` -- cgit v1.2.1