<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nitrokey-rs/src, 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:37Z</updated>
<entry>
<title>Store mutable reference to Device in PasswordSafe</title>
<updated>2019-02-02T10:25:37Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-30T18:40:11Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=13006c00dcbd570cf8347d89557834e320427377'/>
<id>urn:sha1:13006c00dcbd570cf8347d89557834e320427377</id>
<content type='text'>
The current implementation of PasswordSafe stored a normal reference to
the Device.  This patch changes the PasswordSafe struct to use a mutable
reference instead.  This allows the borrow checker to make sure that
there is only one PasswordSafe instance at a time.  While this is
currently not needed, it will become important once we can lock the PWS
on the Nitrokey when dropping the PasswordSafe instance.
</content>
</entry>
<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 device_mut method to DeviceWrapper</title>
<updated>2019-02-02T10:21:25Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-30T16:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=eef2118717878f3543248ebf2d099aebbedceacf'/>
<id>urn:sha1:eef2118717878f3543248ebf2d099aebbedceacf</id>
<content type='text'>
To prepare the mutability refactoring, we add a device_mut method to
DeviceWrapper that can be used to obtain a mutable reference to the
wrapped device.
</content>
</entry>
<entry>
<title>Implement DerefMut for User and Admin</title>
<updated>2019-02-02T10:21:25Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T12:05:42Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=e97ccf213eec4e2d056c2f72079e4eeb7ac66f3f'/>
<id>urn:sha1:e97ccf213eec4e2d056c2f72079e4eeb7ac66f3f</id>
<content type='text'>
As we want to change some methods to take a mutable reference to a
Device, we implement DerefMut for User&lt;T&gt; and Admin&lt;T&gt; so that users can
obtain a mutable reference to the wrapped device.
</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>Prefer eprintln over println for error messages</title>
<updated>2019-01-28T20:02:57Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T20:02:18Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=12b6a4d6c56cba4c2a87027d7c5f26ebe42d3315'/>
<id>urn:sha1:12b6a4d6c56cba4c2a87027d7c5f26ebe42d3315</id>
<content type='text'>
</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>Use if instead of match for boolean expression</title>
<updated>2019-01-27T14:04:24Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-27T14:04:24Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=41a2303ad06f409cb932cf570ff6cc04dd6692fe'/>
<id>urn:sha1:41a2303ad06f409cb932cf570ff6cc04dd6692fe</id>
<content type='text'>
</content>
</entry>
</feed>
