Commit 262d8fa9 authored by Jeremiah Foster's avatar Jeremiah Foster
Browse files

Merge branch 'pureos/byzantium' into 'pureos/byzantium'

Update libnitrokey to 3.5-3.3

See merge request !1
parents 9c84c933 db0577ee
......@@ -9,4 +9,3 @@ core
.idea/
CMakeFiles/
/.vs
.pc
i# build on PureOS byzantium
default: image: pureos/byzantium:latest
# Update packages
before_script:
- DEBIAN_FRONTEND=noninteractive apt -yqq update
- DEBIAN_FRONTEND=noninteractive apt -y install build-essential devscripts
build:
script: debuild -us -uc
tags:
- byzantium
......@@ -21,7 +21,7 @@ IF (UNIX)
ENDIF()
ENDIF()
project(libnitrokey LANGUAGES C CXX VERSION 3.5.9)
project(libnitrokey LANGUAGES C CXX VERSION 3.5.0)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
......@@ -129,14 +129,7 @@ execute_process(
ERROR_QUIET
)
ENDIF()
# the version.h generation logic is tricky in a number of ways:
# 1. git describe on a release tarball will always fail with
# a non-zero return code, usually 128
# 2. If git is not installed, PROJECT_VERSION_GIT_RETURN_CODE
# will contain the string 'No such file or directory'
# Hence fallback to PROJECT_VERSION when the return code is NOT 0.
IF((NOT ${ADD_GIT_INFO}) OR (NOT ${PROJECT_VERSION_GIT_RETURN_CODE} STREQUAL "0"))
MESSAGE(STATUS "Setting fallback Git library version")
IF((NOT ${ADD_GIT_INFO}) OR (${PROJECT_VERSION_GIT_RETURN_CODE}))
SET(PROJECT_VERSION_GIT "v${PROJECT_VERSION}")
ENDIF()
MESSAGE(STATUS "Setting Git library version to: " ${PROJECT_VERSION_GIT} )
......
......@@ -158,9 +158,6 @@ extern "C" {
case NK_STORAGE:
model_string = "S";
break;
case NK_LIBREM:
model_string = "L";
break;
case NK_DISCONNECTED:
default:
/* no such enum value -- return error code */
......@@ -239,8 +236,6 @@ extern "C" {
return NK_PRO;
case DeviceModel::STORAGE:
return NK_STORAGE;
case DeviceModel::LIBREM:
return NK_LIBREM;
default:
/* unknown or not connected device */
return NK_device_model::NK_DISCONNECTED;
......@@ -796,9 +791,6 @@ NK_C_API char* NK_get_SD_usage_data_as_string() {
case DeviceModel::STORAGE:
target->model = NK_STORAGE;
break;
case DeviceModel::LIBREM:
target->model = NK_LIBREM;
break;
default:
return false;
}
......
......@@ -67,9 +67,6 @@
* case NK_STORAGE:
* printf("a Nitrokey Storage");
* break;
* case NK_LIBREM:
* printf("a Librem Key");
* break;
* default:
* printf("an unsupported Nitrokey");
* break;
......@@ -114,11 +111,7 @@ extern "C" {
/**
* Nitrokey Storage.
*/
NK_STORAGE = 2,
/**
* Librem Key.
*/
NK_LIBREM = 3
NK_STORAGE = 2
};
/**
......@@ -334,7 +327,7 @@ extern "C" {
/**
* Connect to device of given model. Currently library can be connected only to one device at once.
* @param device_model NK_device_model: NK_PRO: Nitrokey Pro, NK_STORAGE: Nitrokey Storage, NK_LIBREM: Librem Key
* @param device_model NK_device_model: NK_PRO: Nitrokey Pro, NK_STORAGE: Nitrokey Storage
* @return 1 if connected, 0 if wrong model or cannot connect
*/
NK_C_API int NK_login_enum(enum NK_device_model device_model);
......
......@@ -217,12 +217,7 @@ using nitrokey::misc::strcpyT;
}
}
auto vendor_id = NITROKEY_VID;
auto info_ptr = hid_enumerate(vendor_id, 0);
if (!info_ptr) {
vendor_id = PURISM_VID;
info_ptr = hid_enumerate(vendor_id, 0);
}
auto info_ptr = hid_enumerate(NITROKEY_VID, 0);
auto first_info_ptr = info_ptr;
if (!info_ptr)
return false;
......@@ -230,7 +225,7 @@ using nitrokey::misc::strcpyT;
misc::Option<DeviceModel> model;
while (info_ptr && !model.has_value()) {
if (path == std::string(info_ptr->path)) {
model = product_id_to_model(vendor_id, info_ptr->product_id);
model = product_id_to_model(info_ptr->product_id);
}
info_ptr = info_ptr->next;
}
......@@ -259,8 +254,7 @@ using nitrokey::misc::strcpyT;
bool NitrokeyManager::connect() {
std::lock_guard<std::mutex> lock(mex_dev_com_manager);
vector< shared_ptr<Device> > devices = { make_shared<Stick10>(), make_shared<Stick20>(),
make_shared<LibremKey>() };
vector< shared_ptr<Device> > devices = { make_shared<Stick10>(), make_shared<Stick20>() };
bool connected = false;
for( auto & d : devices ){
if (d->connect()){
......@@ -296,9 +290,6 @@ using nitrokey::misc::strcpyT;
case 'S':
device = make_shared<Stick20>();
break;
case 'L':
device = make_shared<LibremKey>();
break;
default:
throw std::runtime_error("Unknown model");
}
......@@ -314,9 +305,6 @@ using nitrokey::misc::strcpyT;
case device::DeviceModel::STORAGE:
model_string = "S";
break;
case device::DeviceModel::LIBREM:
model_string = "L";
break;
default:
throw std::runtime_error("Unknown model");
}
......@@ -394,7 +382,6 @@ using nitrokey::misc::strcpyT;
string NitrokeyManager::get_serial_number() {
if (device == nullptr) { return ""; };
switch (device->get_device_model()) {
case DeviceModel::LIBREM:
case DeviceModel::PRO: {
auto response = GetStatus::CommandTransaction::run(device);
return nitrokey::misc::toHex(response.data().card_serial_u32);
......@@ -565,7 +552,6 @@ using nitrokey::misc::strcpyT;
strcpyT(payload.slot_name, slot_name);
strcpyT(payload.slot_token_id, token_ID);
switch (device->get_device_model() ){
case DeviceModel::LIBREM:
case DeviceModel::PRO: {
payload.slot_counter = hotp_counter;
break;
......@@ -727,7 +713,6 @@ using nitrokey::misc::strcpyT;
template <typename ProCommand, PasswordKind StoKind>
void NitrokeyManager::change_PIN_general(const char *current_PIN, const char *new_PIN) {
switch (device->get_device_model()){
case DeviceModel::LIBREM:
case DeviceModel::PRO:
{
auto p = get_payload<ProCommand>();
......@@ -849,7 +834,6 @@ using nitrokey::misc::strcpyT;
void NitrokeyManager::build_aes_key(const char *admin_password) {
switch (device->get_device_model()) {
case DeviceModel::LIBREM:
case DeviceModel::PRO: {
auto p = get_payload<BuildAESKey>();
strcpyT(p.admin_password, admin_password);
......@@ -874,7 +858,6 @@ using nitrokey::misc::strcpyT;
void NitrokeyManager::unlock_user_password(const char *admin_password, const char *new_user_password) {
switch (device->get_device_model()){
case DeviceModel::LIBREM:
case DeviceModel::PRO: {
auto p = get_payload<stick10::UnlockUserPassword>();
strcpyT(p.admin_password, admin_password);
......@@ -924,7 +907,6 @@ using nitrokey::misc::strcpyT;
//authorization command is supported for versions equal or below:
auto m = std::unordered_map<DeviceModel , int, EnumClassHash>({
{DeviceModel::PRO, 7},
{DeviceModel::LIBREM, 7},
{DeviceModel::STORAGE, 53},
});
return get_minor_firmware_version() <= m[device->get_device_model()];
......@@ -934,7 +916,6 @@ using nitrokey::misc::strcpyT;
// 320 bit OTP secret is supported by version bigger or equal to:
auto m = std::unordered_map<DeviceModel , int, EnumClassHash>({
{DeviceModel::PRO, 8},
{DeviceModel::LIBREM, 8},
{DeviceModel::STORAGE, 54},
});
return get_minor_firmware_version() >= m[device->get_device_model()];
......@@ -959,7 +940,6 @@ using nitrokey::misc::strcpyT;
uint8_t NitrokeyManager::get_minor_firmware_version(){
switch(device->get_device_model()){
case DeviceModel::LIBREM:
case DeviceModel::PRO:{
auto status_p = GetStatus::CommandTransaction::run(device);
return status_p.data().firmware_version_st.minor; //7 or 8
......@@ -976,7 +956,6 @@ using nitrokey::misc::strcpyT;
}
uint8_t NitrokeyManager::get_major_firmware_version(){
switch(device->get_device_model()){
case DeviceModel::LIBREM:
case DeviceModel::PRO:{
auto status_p = GetStatus::CommandTransaction::run(device);
return status_p.data().firmware_version_st.major; //0
......
# my librem key
SUBSYSTEM=="usb", ATTR{idVendor}=="316d", ATTR{idProduct}=="4c4b", ENV{ID_SMARTCARD_READER}="1", ENV{ID_SMARTCARD_READER_DRIVER}="gnupg"
libnitrokey (3.5-0pureos1) byzantium; urgency=medium
libnitrokey (3.5-3.3pureos1) byzantium; urgency=medium
* Updating with support for Purism's Librem Key.
[ Jeremiah C. Foster ]
* Bringing in version number into CMakeLists.txt from upstream.
* Updates for the Librem Key from Amit Aronovitch.
* Adding in changes specific to PureOS.
* Add in byzantium.
* Adding default to gbp.conf
* Toggle verbose in DH
* Creating a patch for the deb in PureOS.
* Adding in rules files and new install file.
* Adding in udev rules for the Librem key
* Get the location and path right for udev files in libnotify-common.install
* Adding in new symbols to debian/libnitrokey3.symbols file.
* Fixing lintian errors
* Fixing VCS field thanks to Lintian.
-- Jeremiah C. Foster <jeremiah.foster@puri.sm> Tue, 26 May 2020 16:54:26 -0400
[ Adrian Alves ]
* yaml for CI
[ Carsten Schoenert ]
* Revert "yaml for CI"
* CI: Adding the CI YAML control file inside debian/
* data/: Remove direct source modification of UDEV rules
* .gitignore: Remove extra added entry
* Revert the comits
Updates for the Librem Key from Amit Aronovitch and
Bringing in version number into CMakeLists.txt from upstream
Need to go into the patch queue.
* d/gbp.conf: Some more default settings
* rebuild patch queue from patch-queue branch
Rework the patch based on a patch queue branch. Using the topic pusrism
for the used patches within the pusrism packaging.
* d/libnitrokey-common.install: Adjust install sequence
-- Carsten Schoenert <c.schoenert@t-online.de> Tue, 09 Mar 2021 13:35:01 +0100
libnitrokey (3.5-3.3) unstable; urgency=high
* Non-maintainer upload.
* Source-only upload to make the fix into Bullseye. (Closes: 981672)
-- Patryk Cisek <patryk@debian.org> Wed, 03 Feb 2021 11:34:35 -0800
libnitrokey (3.5-3.2) unstable; urgency=medium
* Non-maintainer upload.
* Removed debian/libnitrokey3.symbols -- symbols would have to
be maintained separately for each architecture.
-- Patryk Cisek <patryk@debian.org> Sat, 30 Jan 2021 09:17:04 -0800
libnitrokey (3.5-3.1) unstable; urgency=medium
* Non-maintainer upload.
* Updated debian/libnitrokey3.symbols. (Closes: #966922)
-- Patryk Cisek <patryk@debian.org> Sat, 07 Nov 2020 13:37:07 -0800
libnitrokey (3.5-3) UNRELEASED; urgency=low
* Trim trailing whitespace.
* Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
Repository-Browse.
-- Debian Janitor <janitor@jelmer.uk> Fri, 26 Jun 2020 06:30:05 -0000
libnitrokey (3.5-2) unstable; urgency=medium
......@@ -21,6 +82,12 @@ libnitrokey (3.5-1) experimental; urgency=medium
-- Scott Kitterman <scott@kitterman.com> Sat, 28 Sep 2019 09:56:40 -0400
libnitrokey (3.5-0pureos1) byzantium; urgency=medium
* Updating with support for Purism's Librem Key.
-- Jeremiah C. Foster <jeremiah.foster@puri.sm> Tue, 26 May 2020 16:54:26 -0400
libnitrokey (3.4.1-4) unstable; urgency=medium
* Update debian/copyright
......@@ -58,7 +125,7 @@ libnitrokey (3.3-2) unstable; urgency=medium
[ Jan Luca Naumann ]
* Fix installation path of udev rule.
- install to /lib/udev/rules.d
- install to /lib/udev/rules.d
[ Scott Kitterman ]
* Upload to unstable
......
[DEFAULT]
# debian-branch=debian/master
debian-branch=pureos/byzantium
upstream-branch = upstream
[pq]
patch-numbers = False
usr/lib/udev/rules.d/41-nitrokey.rules
data/60-librem-key.rules usr/lib/udev/rules.d/60-librem-key.rules
lib/udev/rules.d/41-nitrokey.rules
data/60-librem-key.rules lib/udev/rules.d
This diff is collapsed.
From: Jan Luca Naumann <j.naumann@fu-berlin.de>
Date: Fri, 7 Dec 2018 01:17:01 -0500
Subject: 0001-fix-installation-paths
Description: Adjust installation paths in CMakeLists.txt
Adjust the installation paths in CMakeLists.txt to match the
paths used in Debian:
- The udev-rules should be installed into /lib/udev/rules.d.
Author: Jan Luca Naumann <j.naumann@fu-berlin.de>
Forwarded: not-needed
Last-Update: 2018-05-13
Last-Update: 2018-05-13
---
CMakeLists.txt | 2 --
1 file changed, 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32f75a3..dd19a11 100644
index 6d59430..ac0720c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -150,8 +150,6 @@ IF(NOT WIN32)
......
Description: udev rules for the Librem Key
udev rules for the Librem Key
.
libnitrokey (3.5-0pureos1) byzantium; urgency=medium
.
* Updating with support for Purism's Librem Key.
Author: Jeremiah C. Foster <jeremiah.foster@puri.sm>
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Last-Update: 2020-05-27
--- /dev/null
+++ libnitrokey-3.5/data/60-librem-key.rules
@@ -0,0 +1,3 @@
+# my librem key
+SUBSYSTEM=="usb", ATTR{idVendor}=="316d", ATTR{idProduct}=="4c4b", ENV{ID_SMARTCARD_READER}="1", ENV{ID_SMARTCARD_READER_DRIVER}="gnupg"
+
From: "Jeremiah C. Foster" <jeremiah.foster@puri.sm>
Date: Tue, 9 Mar 2021 07:44:14 +0100
Subject: Adding udev rule for the Librem Key
Additional udev rule to support the Librem key.
---
data/60-librem-key.rules | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 data/60-librem-key.rules
diff --git a/data/60-librem-key.rules b/data/60-librem-key.rules
new file mode 100644
index 0000000..0e4278c
--- /dev/null
+++ b/data/60-librem-key.rules
@@ -0,0 +1,3 @@
+# my librem key
+SUBSYSTEM=="usb", ATTR{idVendor}=="316d", ATTR{idProduct}=="4c4b", ENV{ID_SMARTCARD_READER}="1", ENV{ID_SMARTCARD_READER_DRIVER}="gnupg"
+
Description: updates for the Librem Key
From: Amit Aronovitch <amit@satellogic.com>
Date: Tue, 26 May 2020 16:53:23 -0400
Subject: Identify Librem Key, behaving like Nitrokey Pro device
The Purism Librem Key is based on the Nitrokey Pro and can work with
Nitrokey's software. These patches bring in need source code to help
Nitrokey's software to recognize and function with the Librem Key.
.
libnitrokey (3.5-0pureos1) byzantium; urgency=medium
.
* Updating with support for Purism's Librem Key.
Author: Jeremiah C. Foster <jeremiah.foster@puri.sm>
The Purism Librem Key is based on the Nitrokey Pro and can work with
Nitrokey's software. These patches bring in need source code to help
Nitrokey's software to recognize and function with the Librem Key.
https://github.com/AmitAronovitch/libnitrokey/commit/4200af146a17398dc7050c92e1f861f2066debec
---
NK_C_API.cc | 8 ++++++
NK_C_API.h | 11 ++++++--
NitrokeyManager.cc | 27 ++++++++++++++++---
device.cc | 75 ++++++++++++++++++++++++++++++++++++++--------------
libnitrokey/device.h | 19 +++++++++++--
5 files changed, 113 insertions(+), 27 deletions(-)
Last-Update: 2020-05-27
--- libnitrokey-3.5.orig/CMakeLists.txt
+++ libnitrokey-3.5/CMakeLists.txt
@@ -21,7 +21,7 @@ IF (UNIX)
ENDIF()
ENDIF()
-project(libnitrokey LANGUAGES C CXX VERSION 3.5.0)
+project(libnitrokey LANGUAGES C CXX VERSION 3.5.9)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -129,7 +129,14 @@ execute_process(
ERROR_QUIET
)
ENDIF()
-IF((NOT ${ADD_GIT_INFO}) OR (${PROJECT_VERSION_GIT_RETURN_CODE}))
+# the version.h generation logic is tricky in a number of ways:
+# 1. git describe on a release tarball will always fail with
+# a non-zero return code, usually 128
+# 2. If git is not installed, PROJECT_VERSION_GIT_RETURN_CODE
+# will contain the string 'No such file or directory'
+# Hence fallback to PROJECT_VERSION when the return code is NOT 0.
+IF((NOT ${ADD_GIT_INFO}) OR (NOT ${PROJECT_VERSION_GIT_RETURN_CODE} STREQUAL "0"))
+ MESSAGE(STATUS "Setting fallback Git library version")
SET(PROJECT_VERSION_GIT "v${PROJECT_VERSION}")
ENDIF()
MESSAGE(STATUS "Setting Git library version to: " ${PROJECT_VERSION_GIT} )
@@ -150,6 +157,8 @@ IF(NOT WIN32)
ELSE()
set(CMAKE_INSTALL_UDEVRULESDIR "${CMAKE_INSTALL_UDEVRULESDIR}/rules.d")
ENDIF()
+ string(REGEX REPLACE "^/" "" CMAKE_INSTALL_UDEVRULESDIR "${CMAKE_INSTALL_UDEVRULESDIR}")
+ string(REGEX REPLACE "^usr/" "" CMAKE_INSTALL_UDEVRULESDIR "${CMAKE_INSTALL_UDEVRULESDIR}") # usual prefix is usr/local
message(STATUS "Setting udev rules dir to ${CMAKE_INSTALL_UDEVRULESDIR}")
ENDIF()
--- libnitrokey-3.5.orig/NK_C_API.cc
+++ libnitrokey-3.5/NK_C_API.cc
diff --git a/NK_C_API.cc b/NK_C_API.cc
index 1d3fa3a..75c8b97 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -158,6 +158,9 @@ extern "C" {
case NK_STORAGE:
model_string = "S";
......@@ -70,7 +38,7 @@ Last-Update: 2020-05-27
default:
/* unknown or not connected device */
return NK_device_model::NK_DISCONNECTED;
@@ -791,6 +796,9 @@ NK_C_API char* NK_get_SD_usage_data_as_s
@@ -791,6 +796,9 @@ NK_C_API char* NK_get_SD_usage_data_as_string() {
case DeviceModel::STORAGE:
target->model = NK_STORAGE;
break;
......@@ -80,8 +48,10 @@ Last-Update: 2020-05-27
default:
return false;
}
--- libnitrokey-3.5.orig/NK_C_API.h
+++ libnitrokey-3.5/NK_C_API.h
diff --git a/NK_C_API.h b/NK_C_API.h
index d5c54a3..5b93f08 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -67,6 +67,9 @@
* case NK_STORAGE:
* printf("a Nitrokey Storage");
......@@ -114,8 +84,10 @@ Last-Update: 2020-05-27
* @return 1 if connected, 0 if wrong model or cannot connect
*/
NK_C_API int NK_login_enum(enum NK_device_model device_model);
--- libnitrokey-3.5.orig/NitrokeyManager.cc
+++ libnitrokey-3.5/NitrokeyManager.cc
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 6c26a43..d874dca 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -217,7 +217,12 @@ using nitrokey::misc::strcpyT;
}
}
......@@ -241,9 +213,11 @@ Last-Update: 2020-05-27
case DeviceModel::PRO:{
auto status_p = GetStatus::CommandTransaction::run(device);
return status_p.data().firmware_version_st.major; //0
--- libnitrokey-3.5.orig/device.cc
+++ libnitrokey-3.5/device.cc
@@ -45,14 +45,29 @@ const uint16_t nitrokey::device::NITROKE
diff --git a/device.cc b/device.cc
index bc42965..5f89f2c 100644
--- a/device.cc
+++ b/device.cc
@@ -45,14 +45,29 @@ const uint16_t nitrokey::device::NITROKEY_VID = 0x20a0;
const uint16_t nitrokey::device::NITROKEY_PRO_PID = 0x4108;
const uint16_t nitrokey::device::NITROKEY_STORAGE_PID = 0x4109;
......@@ -275,7 +249,7 @@ Last-Update: 2020-05-27
}
}
@@ -67,6 +82,9 @@ std::ostream& nitrokey::device::operator
@@ -67,6 +82,9 @@ std::ostream& nitrokey::device::operator<<(std::ostream& stream, DeviceModel mod
case DeviceModel::STORAGE:
stream << "Storage";
break;
......@@ -347,7 +321,7 @@ Last-Update: 2020-05-27
return res;
}
@@ -234,6 +260,8 @@ std::shared_ptr<Device> Device::create(D
@@ -234,6 +260,8 @@ std::shared_ptr<Device> Device::create(DeviceModel model) {
return std::make_shared<Stick10>();
case DeviceModel::STORAGE:
return std::make_shared<Stick20>();
......@@ -356,22 +330,24 @@ Last-Update: 2020-05-27
default:
return {};
}
@@ -304,6 +332,13 @@ Stick20::Stick20():
{
@@ -305,6 +333,13 @@ Stick20::Stick20():
setDefaultDelay();
}
+
+
+LibremKey::LibremKey():
+ Device(PURISM_VID, LIBREM_KEY_PID, DeviceModel::LIBREM, 100ms, 5, 100ms)
+ {
+ setDefaultDelay();
+ }
+
#include <sstream>
#define p(x) ss << #x << " " << x << ", ";
--- libnitrokey-3.5.orig/libnitrokey/device.h
+++ libnitrokey-3.5/libnitrokey/device.h
std::string Device::ErrorCounters::get_as_string() {
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{
......
0001-fix-installation-paths.patch
Librem-Key-updates
Librem-key-udev-rules
purism/Adding-udev-rule-for-the-Librem-Key.patch
purism/Identify-Librem-Key-behaving-like-Nitrokey-Pro-device.patch
include:
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml'
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-byzantium-jobs.yml'
stages:
- package
- test-package
......@@ -2,7 +2,7 @@
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
......
---
Bug-Database: https://github.com/nitrokey/libnitrokey/issues
Bug-Submit: https://github.com/nitrokey/libnitrokey/issues/new
Repository: https://github.com/nitrokey/libnitrokey.git
Repository-Browse: https://github.com/nitrokey/libnitrokey
......@@ -45,29 +45,14 @@ const uint16_t nitrokey::device::NITROKEY_VID = 0x20a0;
const uint16_t nitrokey::device::NITROKEY_PRO_PID = 0x4108;
const uint16_t nitrokey::device::NITROKEY_STORAGE_PID = 0x4109;
const uint16_t nitrokey::device::PURISM_VID = 0x316d;
const uint16_t nitrokey::device::LIBREM_KEY_PID = 0x4c4b;
Option<DeviceModel> nitrokey::device::product_id_to_model(uint16_t vendor_id, uint16_t product_id) {
switch (vendor_id) {
case NITROKEY_VID:
switch (product_id) {
Option<DeviceModel> nitrokey::device::product_id_to_model(uint16_t product_id) {
switch (product_id) {
case NITROKEY_PRO_PID:
return DeviceModel::PRO;
case NITROKEY_STORAGE_PID:
return DeviceModel::STORAGE;
default:
return {};
}
case PURISM_VID:
switch (product_id) {