aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-09-25 02:09:18 +0200
committerRobin Krahl <robin.krahl@ireas.org>2020-10-02 11:54:41 +0200
commitc7c5e94f1e3d90e6ce85a7c6adb7fdbc31a29645 (patch)
treece36f73957b1504bb63c25282958aa06571302c5
parentadbfa1c12257405112445497324938a011db8664 (diff)
downloadnitrocli-c7c5e94f1e3d90e6ce85a7c6adb7fdbc31a29645.tar.gz
nitrocli-c7c5e94f1e3d90e6ce85a7c6adb7fdbc31a29645.tar.bz2
Support Librem Key
This patch adds the librem device model for the Librem Key. Note that we cannot run any tests for the new model until nitrokey-test is updated.
-rw-r--r--CHANGELOG.md1
-rw-r--r--README.md5
-rw-r--r--doc/nitrocli.116
-rw-r--r--doc/nitrocli.1.pdfbin43324 -> 44182 bytes
-rw-r--r--src/args.rs4
-rw-r--r--src/tests/mod.rs1
6 files changed, 17 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9ff80a..63d300c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ Unreleased
Storage devices
- Bumped `structopt` dependency to `0.3.17`
- Bumped `nitrokey` dependency to `0.8.0`
+ - Added the `librem` device model
0.3.4
diff --git a/README.md b/README.md
index adcd128..27801f7 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,8 @@ nitrocli
- [Changelog](CHANGELOG.md)
**nitrocli** is a program that provides a command line interface for
-interaction with [Nitrokey Pro][nitrokey-pro] and [Nitrokey
-Storage][nitrokey-storage] devices.
+interaction with [Nitrokey Pro][nitrokey-pro], [Nitrokey
+Storage][nitrokey-storage], and [Librem Key][librem-key] devices.
The following commands are currently supported:
@@ -181,6 +181,7 @@ the full text of the license.
[nitrokey-gmbh]: https://www.nitrokey.com
[nitrokey-pro]: https://shop.nitrokey.com/shop/product/nitrokey-pro-2-3
[nitrokey-storage]: https://shop.nitrokey.com/shop/product/nitrokey-storage-2-56
+[librem-key]: https://puri.sm/products/librem-key/
[nitrocli-arch]: https://aur.archlinux.org/packages/nitrocli
[nitrocli-cratesio]: https://crates.io/crates/nitrocli
[nitrocli-debian]: https://packages.debian.org/stable/nitrocli
diff --git a/doc/nitrocli.1 b/doc/nitrocli.1
index 78e5759..12ced4b 100644
--- a/doc/nitrocli.1
+++ b/doc/nitrocli.1
@@ -1,4 +1,4 @@
-.TH NITROCLI 1 2020-09-19
+.TH NITROCLI 1 2020-09-29
.SH NAME
nitrocli \- access Nitrokey devices
.SH SYNOPSIS
@@ -7,7 +7,7 @@ nitrocli \- access Nitrokey devices
[\fIarguments\fR]
.SH DESCRIPTION
\fBnitrocli\fR provides access to Nitrokey devices.
-It supports the Nitrokey Pro and the Nitrokey Storage.
+It supports the Nitrokey Pro, the Nitrokey Storage, and the Librem Key.
It can be used to access the encrypted volume, the one-time password generator,
and the password safe.
.SS Device selection
@@ -21,7 +21,7 @@ Use the \fBlist\fR command to list all attached devices with their USB path,
model, and serial number (if available).
.SH OPTIONS
.TP
-\fB\-m\fR, \fB\-\-model pro\fR|\fBstorage\fR
+\fB\-m\fR, \fB\-\-model librem\fR|\fBpro\fR|\fBstorage\fR
Restrict connections to the given device model, see the Device selection
section.
.TP
@@ -153,9 +153,9 @@ Instead it checks whether a fill operation is currently running on the device
and shows its progress.
.SS One-time passwords
-The Nitrokey Pro and the Nitrokey Storage support the generation of one-time
-passwords using the HOTP algorithm according to RFC 4226 or the TOTP algorithm
-according to RFC 6238.
+The Nitrokey Pro, the Nitrokey Storage, and the Librem Key support the
+generation of one-time passwords using the HOTP algorithm according to RFC 4226
+or the TOTP algorithm according to RFC 6238.
The required data \(en a name and the secret \(en is stored in slots.
Currently, the Nitrokey devices provide three HOTP slots and 15 TOTP slots.
The slots are numbered per algorithm starting at zero.
@@ -245,8 +245,8 @@ If \fB\-\-no\-otp\-pin\fR is set, OTP generation can be performed without PIN.
These two options are mutually exclusive.
.SS Password safe
-The Nitrokey Pro and the Nitrokey Storage provide a password safe (PWS) with 20
-slots.
+The Nitrokey Pro, the Nitrokey Storage, and the Librem Key provide a password
+safe (PWS) with 20 slots.
In each of these slots you can store a name, a login, and a password.
The PWS is not encrypted, but it is protected with the user PIN by the firmware.
Once the PWS is unlocked by one of the commands listed below, it can be
diff --git a/doc/nitrocli.1.pdf b/doc/nitrocli.1.pdf
index 7f667f4..7089998 100644
--- a/doc/nitrocli.1.pdf
+++ b/doc/nitrocli.1.pdf
Binary files differ
diff --git a/src/args.rs b/src/args.rs
index e4bc77d..3bb1225 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -38,6 +38,7 @@ pub struct Args {
Enum! {
/// The available Nitrokey models.
DeviceModel, [
+ Librem => "librem",
Pro => "pro",
Storage => "storage",
]
@@ -46,6 +47,7 @@ Enum! {
impl DeviceModel {
pub fn as_user_facing_str(&self) -> &str {
match self {
+ DeviceModel::Librem => "Librem",
DeviceModel::Pro => "Pro",
DeviceModel::Storage => "Storage",
}
@@ -55,6 +57,7 @@ impl DeviceModel {
impl From<DeviceModel> for nitrokey::Model {
fn from(model: DeviceModel) -> nitrokey::Model {
match model {
+ DeviceModel::Librem => nitrokey::Model::Librem,
DeviceModel::Pro => nitrokey::Model::Pro,
DeviceModel::Storage => nitrokey::Model::Storage,
}
@@ -66,6 +69,7 @@ impl convert::TryFrom<nitrokey::Model> for DeviceModel {
fn try_from(model: nitrokey::Model) -> Result<DeviceModel, anyhow::Error> {
match model {
+ nitrokey::Model::Librem => Ok(DeviceModel::Librem),
nitrokey::Model::Pro => Ok(DeviceModel::Pro),
nitrokey::Model::Storage => Ok(DeviceModel::Storage),
_ => Err(anyhow::anyhow!("Unsupported device model: {}", model)),
diff --git a/src/tests/mod.rs b/src/tests/mod.rs
index 23eecc5..65983bb 100644
--- a/src/tests/mod.rs
+++ b/src/tests/mod.rs
@@ -76,6 +76,7 @@ impl Nitrocli {
fn model_to_arg(model: nitrokey::Model) -> &'static str {
match model {
+ nitrokey::Model::Librem => "--model=librem",
nitrokey::Model::Pro => "--model=pro",
nitrokey::Model::Storage => "--model=storage",
_ => panic!("Unexpected model in test suite: {}", model),