summaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-09 13:06:52 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-09 18:34:00 +0200
commit344213284962aab6c21bc12331f5306f4a2c79ab (patch)
treeb37e5371223be29bda286339421fb4cc051c0e06 /NitrokeyManager.cc
parent6ab42afc6924a329d17ee9a2e3dcf01aca63a02e (diff)
downloadlibnitrokey-344213284962aab6c21bc12331f5306f4a2c79ab.tar.gz
libnitrokey-344213284962aab6c21bc12331f5306f4a2c79ab.tar.bz2
Remove surplus string length assertions (it is done during copying anyway)
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc8
1 files changed, 0 insertions, 8 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 83412b1..6d0a24c 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -153,8 +153,6 @@ namespace nitrokey{
bool use_8_digits, bool use_enter, bool use_tokenID, const char *token_ID,
const char *temporary_password) {
assert(is_valid_hotp_slot_number(slot_number));
- assert(strlen(secret)==20); //160 bits
- assert(strlen(slot_name)<=15);
slot_number = get_internal_slot_number_for_hotp(slot_number);
auto payload = get_payload<WriteToHOTPSlot>();
@@ -178,8 +176,6 @@ namespace nitrokey{
const char *temporary_password) {
auto payload = get_payload<WriteToTOTPSlot>();
assert(is_valid_totp_slot_number(slot_number));
- assert(strlen(secret) == sizeof payload.slot_secret); //160 bits
- assert(strlen(slot_name) <= sizeof payload.slot_name);
slot_number = get_internal_slot_number_for_totp(slot_number);
payload.slot_number = slot_number;
@@ -217,10 +213,6 @@ namespace nitrokey{
bool NitrokeyManager::first_authenticate(const char *pin, const char *temporary_password) {
auto authreq = get_payload<FirstAuthenticate>();
-
- assert(strlen(pin) < sizeof authreq.card_password);
- assert(strlen(temporary_password) < sizeof authreq.temporary_password);
-
strcpyT(authreq.card_password, pin);
strcpyT(authreq.temporary_password, temporary_password);
FirstAuthenticate::CommandTransaction::run(*device, authreq);