aboutsummaryrefslogtreecommitdiff
path: root/misc.cc
Commit message (Collapse)AuthorAge
* Use strnlen to determine string lengthSzczepan Zalega2018-02-12
| | | | | | | | | strnlen stops scanning after reaching big_string_size and returns last position in the searched string. If a string terminator is not found then the big_string_size is returned hence the modification of the later size-checking condition. Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Null-terminate string before calling strtoulRobin Krahl2018-02-12
| | | | | | | | hex_string_to_byte in misc.cc calls strtoul with a non-null-terminated string, causing a buffer over-read. This patch extends the buffer to always include a null character in the end. Fixes issue #95.
* Update license/copyright linesSzczepan Zalega2018-01-16
| | | | | | Remove redundant file Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Adjust code to make compilation under MSVC 2017Szczepan Zalega2017-06-28
|
* Use correct format letterSzczepan Zalega2017-04-03
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Fix compilation warningsSzczepan Zalega2017-03-31
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Get proper card serial for Storage. Get serial as one number.Szczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Adjust for compilation on Visual Studio 2017Szczepan Zalega2017-03-11
| | | | Building works however tests are not. Possibly linking with original hidapi solution would work.
* Fix getting card serialSzczepan Zalega2017-03-11
| | | | | todo: remove whitespace at the string end Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Support sending empty OTP secrets for slot edit (+test)Szczepan Zalega2016-12-03
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Support longer secrets (40 bytes) for NK Pro 0.8Szczepan Zalega2016-12-03
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Print ascii representation of dump in hexdumpSzczepan Zalega2016-11-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Remove asserts in favor of exceptions or warnings. Test changes in Python.Szczepan Zalega2016-09-10
| | | | | | On possible data truncation return LibraryError(exception) instead of silently truncating and logging warning Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add hex to binary converting functionSzczepan Zalega2016-09-10
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Allow disabling hexdump headerSzczepan Zalega2016-09-08
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Remove compilation warning regarding printf format in hexdumpSzczepan Zalega2016-08-09
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* formatted code with clang-format-3.6 with style=googleSzczepan Zalega2016-03-05
|
* Minor fixes, working versionMateusz Zalega2015-10-26