aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Merge branch 'pr_148'Szczepan Zalega2019-01-24
|\ | | | | | | | | | | Generate documentation for C API using Doxygen Fixes #148
| * Update readme for `make doc`Robin Krahl2019-01-16
| |
| * Add \mainpage to the C API documentationRobin Krahl2019-01-16
| | | | | | | | | | The main page contains a reference to the header containing all functions of the C API and a short example of how to use it.
| * Add a \file doc comment to libnitrokeyRobin Krahl2019-01-16
| | | | | | | | | | | | Doxygen does not include top-level functions unless the file is documented. Therefore we have to add a \file doc comment so that the functions show up in the Doxygen output.
| * Add a doc target that generates C API documentationRobin Krahl2019-01-16
| | | | | | | | | | | | | | Doxygen is used generate the C API documentation. The Doxygen configuration is stored in the Doxygen.in file (that is processed by CMake). To generate the documentation, run make doc in the build directory.
* | Merge branch 'pr_149'Szczepan Zalega2019-01-24
|\ \ | | | | | | | | | | | | | | | Return uint8_t from version getters Fixes #149
| * | Return firmware version parts as uint8_t instead of intRobin Krahl2019-01-17
| | | | | | | | | | | | | | | | | | | | | | | | The firmware version parts returned by the Nitrokey devices are uint8_t values. This is part of the public API as part of the NK_storage_status struct. For consistency with this API, this patch changes the functions NK_get_major_firmware_version and NK_get_minor_firmware_version to return uint8_t instead of int.
* | | Merge branch 'pr_152'Szczepan Zalega2019-01-24
|\ \ \ | |/ / |/| | | | | | | | | | | Export PWS slot count in C API Fixes #152
| * | Export PWS slot count in C APIRobin Krahl2019-01-24
|/ / | | | | | | | | | | | | The C++ API already defines the number of slots in device_proto.h. This patch adds it to the C API. It is especially important to have this constant in the C API as it is the length of the array returned by NK_get_password_safe_slot_status.
* | Merge branch 'pr_146'Szczepan Zalega2019-01-15
|\ \ | | | | | | | | | | | | | | | Correct README - links to header files Fixes #146
| * | Correct other links as wellSzczepan Zalega2019-01-15
| | | | | | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * | Fix links to header files in READMEMartin Müller2019-01-15
|/ /
* | Merge branch 'contributions'Szczepan Zalega2019-01-15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Multiple PR's merged and tested as a whole Platform: Pro v0.7 Storage v0.53 Fedora 29 Run Python tests
| * \ Merge branch 'pr_138' into contributionsSzczepan Zalega2019-01-15
| |\ \ | | | | | | | | | | | | | | | | | | | | Improve support for multiple devices Fixes #138
| | * | Add test for NK_list_devices to test_multiple_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | As we cannot test this function properly in Python (due to missing struct definitions), we test it in the C++ test suite.
| | * | Add test for NK_connect_with_pathRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | As we cannot read the output of NK_list_devices in the Python tests at the moment, this test case uses NK_list_devices_by_cpuID instead.
| | * | Add simple test for NK_list_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, I cannot test more as the current ffi implementation does not allow me to import struct definitions. Without the definition for the NK_device_info struct, I cannot inspect the result of the NK_list_devices function.
| | * | Add NK_device_info, NK_list_devices and NK_free_device_infoRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Change std::wstring to std::string in DeviceInfoRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Add NK_connect_with_path to C APIRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | NK_connect_with_path corresponds to NitrokeyManager::connect_with_path.
| | * | Add test case for NitrokeyManager::connect_with_path to test_multiple_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Change NitrokeyManager::connect_with_path to also work with ProRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Add test case for Device::enumerate to test_multiple_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Implement operator<< for DeviceModelRobin Krahl2019-01-13
| | | |
| | * | Add Device::create static methodRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | The method makes it easier to create a std::shared_ptr<Device> from a model enum instance.
| | * | Make Device::enumerate staticRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Add product_id_to_model functionRobin Krahl2019-01-13
| | | |
| | * | Add misc::Option<T> classRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | 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.
| | * | Extract vendor and product IDs into constantsRobin Krahl2019-01-13
| | | |
| | * | Change Nitrokey::list_devices return type to use DeviceInfoRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Change Device::enumerate return type to use DeviceInfoRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Add DeviceInfo struct for enumerationRobin Krahl2019-01-13
| | |/ | | | | | | | | | | | | | | | 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.
| * | Merge branch 'pr_145' into contributionsSzczepan Zalega2019-01-15
| |\ \ | | | | | | | | | | | | | | | | | | | | Add NK_get_SD_usage_data function to C API Fixes #145
| | * | Add NK_get_SD_usage_data function to C APIRobin Krahl2019-01-14
| | |/ | | | | | | | | | | | | | | | The NK_get_SD_usage_data function returns the minimum and maximum write level for the SD card. This function cannot be tested due to the missing struct support in the Python tests.
| * | Merge branch 'pr_143' into contributionsSzczepan Zalega2019-01-15
| |\ \ | | | | | | | | | | | | | | | | | | | | Return -2 if an error occured in NK_get_progress_bar_value Fixes #143
| | * | Return -2 if an error occured in NK_get_progress_bar_valueRobin Krahl2019-01-14
| | |/ | | | | | | | | | | | | | | | | | | | | | NK_get_progress_bar_value returns the progress value from 0 to 100 or -1 if there is no pending operation. In the previous implementation, it also returned zero if an error occurred, making it impossible to distinguish progress zero and an error. Therefore, we change the return value to -2 if an error occured.
| * | Merge branch 'pr_139' into contributionsSzczepan Zalega2019-01-15
|/| | | | | | | | | | | | | | | | | Add tqdm to Python's tests requirements Fixes #139
| * | Add tqdm to unittest/requirements.txtRobin Krahl2019-01-13
| |/ | | | | | | | | | | The test_mulitple.py unit test requires tqdm, which is not a dependency of any of the requirements and was not included in the requirements list.
* | Merge branch '144-python_multiline'Szczepan Zalega2019-01-15
|\ \ | |/ |/| | | | | | | | | | | | | Add Python support for multiline declarations in NK_C_API.h Add test for reading a structure, which uses multiline declaration Add offline test for Python CI: execute offline test for Python (GCC5 build only) Fixes #144
| * CI: add pip-required requests packageSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Print used Git version for the librarySzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * CI: install git to get the library version on buildSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * CI: run Python offline testsSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Add Python offline testsSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Use logger instead of bare printingSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Add proxy object for logging libnitrokey callsSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Add support for multiline C definitions in NK_C_API + testSzczepan Zalega2019-01-15
|/ | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Merge branch 'cpp_tests_update'Szczepan Zalega2019-01-02
|\ | | | | | | | | | | | | | | | | 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
| * Update Readme, mostly test sectionSzczepan Zalega2019-01-02
| | | | | | | | | | | | | | Describe better C++ tests Related: https://github.com/d-e-s-o/nitrocli/issues/39 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Mention potential test failure cause, when no git version is providedSzczepan Zalega2019-01-02
| | | | | | | | | | | | Related to #133 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>