| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
NK_list_devices corresponds to NitrokeyManager::list_devices. It
returns a linked list of NK_device_info, which has to be freed using the
NK_free_device_info function.
|
|
|
|
|
|
|
| |
For easier handling, we should use a std::string instead of
std::wstring for the serial number in DeviceInfo. For the conversion, I
assume that the serial number is valid UTF-8. As it should be
alphanumeric and ASCII only, this should be true.
|
|
|
|
| |
NK_connect_with_path corresponds to NitrokeyManager::connect_with_path.
|
|
|
|
|
|
| |
The current test case is renamed to “Use Storage API” as it queries the
storage status. The new test case, “Use API”, lists all connected
devices and prints their model, path and serial number.
|
|
|
|
|
|
|
|
|
|
| |
Previously, Stick20 was hardcoded in connect_with_path. Now we first
use hid_enumerate to find out the model on that path, then we connect to
that model.
We also could have added the model as a parameter to connect_with_path.
Yet we cannot directly check the model after connecting, so this would
be error-prone.
|
|
|
|
|
|
| |
The current test case is renamed to “List Storage devices” as it also
displays the SD card ID. The new test case, “List devices”, lists all
connected devices and prints their model, path and serial number.
|
| |
|
|
|
|
|
| |
The method makes it easier to create a std::shared_ptr<Device> from a
model enum instance.
|
|
|
|
|
|
|
|
|
|
|
| |
Device::enumerate does not need any instance data, therefore it is made
static. Note that this not only changes the public API by making the
method static. We also return all connected Nitrokey devices instead of
only Storage devices.
The NitrokeyManager method list_devices_by_cpuID is changed to check the
device type so that they still only return Storage devices. The
list_device method now returns both Storage and Pro devices.
|
| |
|
|
|
|
|
| |
Option<T> is a simple replacement for std::optional, which was
introduced in C++17. It stores a value that can be present or absent.
|
| |
|
|
|
|
|
|
| |
In the previous commit, we changed the return value of Device::enumerate
to std::vector<DeviceInfo>. Now we change Nitrokey::list_devices to
also return DeviceInfo instances.
|
|
|
|
|
|
| |
The return type of Device::enumerate is changed from
std::vector<std::string> to std::vector<DeviceInfo> to expose the
additional information contained in the DeviceInfo struct.
|
|
|
|
|
|
| |
This is a preparation for a future patch that will change the enumerate
method to return a vector of DeviceInfo instances instead of a vector of
strings.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Update C++ tests
Add safe C++ test for simple connection test, device agnostic.
Better describe the use case of C++ tests in the Readme.
Related: https://github.com/d-e-s-o/nitrocli/issues/39
|
| |
| |
| |
| |
| |
| |
| | |
Describe better C++ tests
Related: https://github.com/d-e-s-o/nitrocli/issues/39
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
| |
| |
| |
| |
| |
| | |
Related to #133
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
| |
| |
| |
| | |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|/
|
|
| |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|\
| |
| |
| | |
Adding corrections found while testing Storage v0.53 RC1.
|
| |
| |
| |
| | |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|/
|
|
|
|
|
|
| |
Handle UNKNOWN_ERROR code (introduced in Storage v0.51, firmware commit
687d4aca31ce405db41231be73864ee2f91b3714) and is returned,
when device fails to retrieve the AES key.
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Add virtual destructor to logger classes.
Fixes compilation warning
Fixes #131
Fixes #129
|
| |
| |
| |
| |
| | |
Fixes: https://github.com/Nitrokey/libnitrokey/issues/129
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Update Catch to 2.3.0
Both CMake and Meson build files updated.
Tests compile (with both) and run with a Storage device.
Fixes #132
|
| | | |
|
| | | |
|
|/ / |
|
|\ \
| |/
|/|
| |
| | |
Meson: copy udev, fallback for git version.
Fixes #130
|
| |
| |
| |
| | |
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|/
|
|
| |
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|\
| |
| |
| |
| |
| | |
Meson fixes for tests build
Fixes #128
|
| |
| |
| |
| |
| |
| | |
Better to use meson's subproject, but let's go with submodule for now.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
| |
| |
| |
| | |
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|/
|
|
| |
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Meson:
- fix typo in lib name
- use real library version in getter
Fixes #127
|
| |
| |
| |
| | |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|/
|
|
| |
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|\
| |
| |
| |
| |
| | |
Support build via Meson and Ninja
Fixes #85
|
| |
| |
| |
| | |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
| |
| |
| |
| | |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|/
|
|
|
| |
References: https://github.com/Nitrokey/nitrokey-app/issues/306
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
|
|
| |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|
|
|
|
|
| |
Return version 3.0 and Git string "unknown"
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|
|
|
| |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|
|
|
|
|
|
| |
Sets version to "unknown"
Fixes #126
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
|\
| |
| |
| |
| |
| | |
Allow to connect to device with model specified by enum.
Fixes #116
|
| |
| |
| |
| | |
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|
| |
| |
| |
| |
| |
| |
| | |
Using return value instead of memory manipulation seem to be cleaner solution and less error prone
due to avoiding pointer usage.
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
|