<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nitrokey-rs/tests, branch v0.4.0-alpha.1</title>
<subtitle>Rust interface to libnitrokey</subtitle>
<id>https://git.ireas.org/nitrokey-rs/atom?h=v0.4.0-alpha.1</id>
<link rel='self' href='https://git.ireas.org/nitrokey-rs/atom?h=v0.4.0-alpha.1'/>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/'/>
<updated>2019-02-02T10:25:02Z</updated>
<entry>
<title>Refactor User and Admin to use a mutable reference</title>
<updated>2019-02-02T10:25:02Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T14:24:12Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=0972bbe82623c3d9649b6023d8f50d304aa0cde6'/>
<id>urn:sha1:0972bbe82623c3d9649b6023d8f50d304aa0cde6</id>
<content type='text'>
In the initial nitrokey-rs implementation, the Admin and the User struct
take the Device by value to make sure that the user cannot initiate a
second authentication while this first is still active (which would
invalidate the temporary password).  Now we realized that this is not
necessary – taking a mutable reference has the same effect, but leads to
a much cleaner API.

This patch refactors the Admin and User structs – and all dependent code
– to use a mutable reference instead of a Device value.
</content>
</entry>
<entry>
<title>Require mutable reference if method changes device state</title>
<updated>2019-02-02T10:25:02Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T12:27:15Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=f49e61589e32217f97c94aa86d826f6b65170fba'/>
<id>urn:sha1:f49e61589e32217f97c94aa86d826f6b65170fba</id>
<content type='text'>
Previously, all methods that access a Nitrokey device took a reference
to the device as input.  This method changes methods that change the
device state to require a mutable reference instead.  In most case,
this is straightforward as the method writes data to the device (for
example write_config or change_user_pin).  But there are two edge cases:
- Authenticating with a PIN changes the device state as it may decrease
  the PIN retry counter if the authentication fails.
- Generating an HOTP code changes the device state as it increases the
  HOTP counter.
</content>
</entry>
<entry>
<title>Add set_encrypted_volume_mode method to Storage</title>
<updated>2019-01-31T11:10:38Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-31T11:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=ad76653b3be57c0cfd31c8056a8d68537034324e'/>
<id>urn:sha1:ad76653b3be57c0cfd31c8056a8d68537034324e</id>
<content type='text'>
Previously, we considered this command as unsupported as it only was
available with firmware version 0.49.  But as discussed in nitrocli
issue 80 [0], it will probably be re-enabled in future firmware
versions.  Therefore this patch adds the set_encrypted_volume_mode to
Storage.

[0] https://github.com/d-e-s-o/nitrocli/issues/80
</content>
</entry>
<entry>
<title>Add assert_any_ok macro to unit tests</title>
<updated>2019-01-28T19:48:33Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T19:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=d1262390573b758ac4aa610eff96a1b5dcb9f3d6'/>
<id>urn:sha1:d1262390573b758ac4aa610eff96a1b5dcb9f3d6</id>
<content type='text'>
Sometimes we cannot use assert_ok! as we can’t compare the Ok value (or
do not want to).  For these cases, this patch adds the new assert_any_ok
macro to use instead of assert!(x.is_ok()).  The advantage is that the
error information is not discarded but printed in a helpful error
message.
</content>
</entry>
<entry>
<title>Add unwrap_ok macro to replace unwrap in unit tests</title>
<updated>2019-01-28T19:40:49Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T19:40:49Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=52df93249f27ae803bada0451d7380bc3d596007'/>
<id>urn:sha1:52df93249f27ae803bada0451d7380bc3d596007</id>
<content type='text'>
The unwrap error message is not very useful.  This patch adds the
unwrap_ok macro that is basically the same as unwrap but prints a more
readable error message.
</content>
</entry>
<entry>
<title>Accept UTF-8 errors in password safe tests</title>
<updated>2019-01-28T19:21:41Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-27T22:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=5d7bb087707915a78149da7492cccd772db2657e'/>
<id>urn:sha1:5d7bb087707915a78149da7492cccd772db2657e</id>
<content type='text'>
After a factory reset or after building the AES key, the password safe
contains garbage data.  This will most likely not be valid UTF-8.
Therefore we change the tests to also accept an UTF-8 error in these
cases.
</content>
</entry>
<entry>
<title>Add get_firmware_version method</title>
<updated>2019-01-27T23:36:53Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-27T23:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=1d68e24db4078ad1a004afd7bec90a81e7d31ec8'/>
<id>urn:sha1:1d68e24db4078ad1a004afd7bec90a81e7d31ec8</id>
<content type='text'>
This patch combines the get_{major,minor}_firmware_version methods into
the new get_firmware_version method that returns a FirmwareVersion
struct.  Currently, this requires casting from i32 to u8.  But this will
be fixed with the next libnitrokey version as we change the return types
for the firmware getters.
</content>
</entry>
<entry>
<title>Always return a Result when communicating with a device</title>
<updated>2019-01-27T23:23:00Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-27T23:23:00Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=c30cbd35ba187cd6e5055d3beb8420b11fb030ec'/>
<id>urn:sha1:c30cbd35ba187cd6e5055d3beb8420b11fb030ec</id>
<content type='text'>
Previously, we sometimes returned a value without wrapping it in a
result if the API method did not indicate errors in the return value.
But we can detect errors using the NK_get_last_command_status function.
This patch changes the return types of these methods to Result&lt;_, Error&gt;
and adds error checks.
</content>
</entry>
<entry>
<title>Add tolerance for timing issues to the TOTP tests</title>
<updated>2019-01-25T19:22:28Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-25T19:19:36Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=6dfc1a2929313e24ea03e78b486b72f7b1c1e5ec'/>
<id>urn:sha1:6dfc1a2929313e24ea03e78b486b72f7b1c1e5ec</id>
<content type='text'>
The TOTP test with the timestamp 59 often fails as the Nitrokey’s clock
ticks between setting the time and generating the TOTP code.  This patch
also allows the TOTP code for timestamp 60 for this test case.
</content>
</entry>
<entry>
<title>Add license and copyright information</title>
<updated>2019-01-23T15:33:26Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-23T15:33:26Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=fdb7bac3063e62776bfc13f184cf786da19f42d1'/>
<id>urn:sha1:fdb7bac3063e62776bfc13f184cf786da19f42d1</id>
<content type='text'>
This patch adds license and copyright information to all files to make
nitrokey-rs compliant with the REUSE practices [0].

[0] https://reuse.software/practices/2.0/
</content>
</entry>
</feed>
