From 4200af146a17398dc7050c92e1f861f2066debec Mon Sep 17 00:00:00 2001 From: Amit Aronovitch Date: Wed, 2 Oct 2019 00:01:48 +0300 Subject: Identify Librem Key, behaving like Nitrokey Pro device --- libnitrokey/device.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'libnitrokey') diff --git a/libnitrokey/device.h b/libnitrokey/device.h index d50080d..d39310a 100644 --- a/libnitrokey/device.h +++ b/libnitrokey/device.h @@ -50,7 +50,8 @@ namespace device { enum class DeviceModel{ PRO, - STORAGE + STORAGE, + LIBREM }; std::ostream& operator<<(std::ostream& stream, DeviceModel model); @@ -67,12 +68,20 @@ extern const uint16_t NITROKEY_PRO_PID; * The USB product ID for the Nitrokey Storage. */ extern const uint16_t NITROKEY_STORAGE_PID; +/** + * The USB vendor ID for Purism devices. + */ +extern const uint16_t PURISM_VID; +/** + * The USB product ID for the Librem Key. + */ +extern const uint16_t LIBREM_KEY_PID; /** * Convert the given USB product ID to a Nitrokey model. If there is no model * with that ID, return an absent value. */ -misc::Option product_id_to_model(uint16_t product_id); +misc::Option product_id_to_model(uint16_t vendor_id, uint16_t product_id); /** * Information about a connected device. @@ -219,6 +228,12 @@ class Stick20 : public Device { public: Stick20(); }; + +class LibremKey : public Device { + public: + LibremKey(); +}; + } } #endif -- cgit v1.2.1 From 444a6cb764fbcea3c91ae936b1c76a190f935b10 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 13 Jun 2020 12:21:44 +0200 Subject: Revert API change Remove the change to keep binary compatibility. Use the vendor_id field from the dev description. --- libnitrokey/device.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libnitrokey') diff --git a/libnitrokey/device.h b/libnitrokey/device.h index d39310a..917e0d0 100644 --- a/libnitrokey/device.h +++ b/libnitrokey/device.h @@ -81,6 +81,7 @@ extern const uint16_t LIBREM_KEY_PID; * Convert the given USB product ID to a Nitrokey model. If there is no model * with that ID, return an absent value. */ +misc::Option product_id_to_model(uint16_t product_id); misc::Option product_id_to_model(uint16_t vendor_id, uint16_t product_id); /** -- cgit v1.2.1