aboutsummaryrefslogtreecommitdiff
path: root/libnitrokey
Commit message (Collapse)AuthorAge
* log: define default virtual destructor for LogHandlerIgor Gnatenko2018-07-18
| | | | | Fixes: https://github.com/Nitrokey/libnitrokey/issues/129 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Add general DEPRECATED macro for marking deprecated functions.Szczepan Zalega2018-07-07
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Handle command for getting production dataSzczepan Zalega2018-06-28
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Handle WINK commandSzczepan Zalega2018-06-23
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add "deprecated" tags to get_time and NK_totp_get_time functionsSzczepan Zalega2018-06-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add set_time_soft to replace get_timeRobin Krahl2018-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The SetTime command supports two modes: set the time without checking the currently set time, or verify that the currently set time is not zero and not larger than the new time (see cmd_set_time(uint8_t*, uint8_t*) in src/keyboard/report_protocol.c, lines 678--710, in the Nitrokey Pro firmware). NitrokeyManager called these two modes set_time(uint64_t) and get_time(uint64_t), which is highly misleading -- the command does never get the time. Furthermore, the get_time method per default calls the command with the time zero, which will always result in an error. The C API has the methods NK_totp_set_time(uint64_t) and NK_totp_get_time(). NK_totp_get_time() calls get_time(uint64_t) with the time zero, leading to an error, and is therefore useless. This patch proposes a new wording. While it would make sense to call the first mode “reset” and the second mode “set”, this would break compatibility. Therefore, new methods set_time_soft(uint64_t) and NK_totp_set_time_soft(uint64_t) are introduced to represent the difference between a hard and a soft setting of the time. The old methods, get_time(uint64_t) and NK_totp_get_time(), are not removed but marked as deprecated. They should be removed in an upcoming major release.
* Move implementation from header back to compilation unitSzczepan Zalega2018-06-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add getters for the library versionRobin Krahl2018-05-25
| | | | | | | CMake generates version.h from version.h.in and sets the major and minor version as specified in CMakeLists.txt and the current git version as returned by `git describe --always`. These values are also added to the C API as NK_get{_major,_minor,}_library_version.
* Change const char* to char* for functions returning duplicated strings.Szczepan Zalega2018-04-19
| | | | | | | All functions returning duplicated C-strings, which needs to be deallocated on caller side, are typed char* instead of const char* Issue #110 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Merge branch '102-get_status_invalid'Szczepan Zalega2018-04-10
|\ | | | | | | Fixes #102
| * Name magic numbers in validation functionsSzczepan Zalega2018-04-10
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Correct validation functions for GetStatus and WriteGeneralConfig structsSzczepan Zalega2018-04-10
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | Add a NitrokeyManager::connect overload for enumRobin Krahl2018-04-10
|/ | | | | | | Identifying the model to connect to by the first character of a string is not intuitive. This patch adds an overload for the connect function that accepts a device::DeviceModel enum value, providing a cleaner interface.
* Make unbundling easierDavid Seifert2018-03-13