summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-01-24 18:08:26 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2019-01-24 18:08:26 +0100
commit55a71238ac5186187282f002b5eed7ec279f1ec1 (patch)
treefc83b9f2a747e6f03f6382e770b1fb1cd5efc850
parentdee882fd21cd932c2642d170620862e783284d3b (diff)
parent3b0e017c7c87cb93d48e4384d3ef312ba93d9875 (diff)
downloadlibnitrokey-55a71238ac5186187282f002b5eed7ec279f1ec1.tar.gz
libnitrokey-55a71238ac5186187282f002b5eed7ec279f1ec1.tar.bz2
Merge branch 'pr_152'
Export PWS slot count in C API Fixes #152
-rw-r--r--NK_C_API.cc2
-rw-r--r--NK_C_API.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index 794673a..9a8ac3c 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -27,6 +27,7 @@
#include "libnitrokey/LibraryException.h"
#include "libnitrokey/cxx_semantics.h"
#include "libnitrokey/stick20_commands.h"
+#include "libnitrokey/device_proto.h"
#include "version.h"
#ifdef _MSC_VER
@@ -44,6 +45,7 @@ char * strndup(const char* str, size_t maxlen) {
using namespace nitrokey;
+const uint8_t NK_PWS_SLOT_COUNT = PWS_SLOT_COUNT;
static uint8_t NK_last_command_status = 0;
static const int max_string_field_length = 100;
diff --git a/NK_C_API.h b/NK_C_API.h
index 3effbfe..0ff317c 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -37,6 +37,11 @@
extern "C" {
#endif
+ /**
+ * The number of slots in the password safe.
+ */
+ extern const uint8_t NK_PWS_SLOT_COUNT;
+
static const int MAXIMUM_STR_REPLY_LENGTH = 8192;
/**