aboutsummaryrefslogtreecommitdiff
path: root/include/stick10_commands.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 10:09:02 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 10:13:05 +0200
commit79b616830381d0ea5f89e920b55f154d2e7e06ce (patch)
treefac321ec6e578f0ac1e2abffc2c8497e85c41b5a /include/stick10_commands.h
parent59ae52487d142fb2b13407419351255c667faa14 (diff)
downloadlibnitrokey-79b616830381d0ea5f89e920b55f154d2e7e06ce.tar.gz
libnitrokey-79b616830381d0ea5f89e920b55f154d2e7e06ce.tar.bz2
Assume slot_names are volatile data
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/stick10_commands.h')
-rw-r--r--include/stick10_commands.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index af8d2bd..b38ea06 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -39,9 +39,9 @@ class GetSlotName : public Command<CommandID::READ_SLOT_NAME> {
bool isValid() const { return true; }
std::string dissect() const {
- std::stringstream ss;
- ss << "slot_name:\t" << slot_name << std::endl;
- return ss.str();
+ std::stringstream ss;
+ print_to_ss_volatile(slot_name);
+ return ss.str();
}
} __packed;
@@ -118,7 +118,7 @@ class WriteToHOTPSlot : Command<CommandID::WRITE_TO_SLOT> {
std::string dissect() const {
std::stringstream ss;
ss << "slot_number:\t" << (int)(slot_number) << std::endl;
- ss << "slot_name:\t" << slot_name << std::endl;
+ print_to_ss_volatile(slot_name);
print_to_ss_volatile(slot_secret);
ss << "slot_config:\t" << std::bitset<8>((int)_slot_config) << std::endl;
ss << "\tuse_8_digits(0):\t" << use_8_digits << std::endl;
@@ -169,7 +169,7 @@ class WriteToTOTPSlot : Command<CommandID::WRITE_TO_SLOT> {
std::string dissect() const {
std::stringstream ss;
ss << "slot_number:\t" << (int)(slot_number) << std::endl;
- ss << "slot_name:\t" << slot_name << std::endl;
+ print_to_ss_volatile(slot_name);
print_to_ss_volatile(slot_secret);
ss << "slot_config:\t" << std::bitset<8>((int)_slot_config) << std::endl;
ss << "slot_token_id:\t";
@@ -323,7 +323,7 @@ class ReadSlot : Command<CommandID::READ_SLOT> {
std::string dissect() const {
std::stringstream ss;
- ss << "slot_name:\t" << slot_name << std::endl;
+ print_to_ss_volatile(slot_name);
ss << "slot_config:\t" << std::bitset<8>((int)_slot_config) << std::endl;
ss << "\tuse_8_digits(0):\t" << use_8_digits << std::endl;
ss << "\tuse_enter(1):\t" << use_enter << std::endl;
@@ -475,7 +475,7 @@ class GetPasswordSafeSlotName : Command<CommandID::GET_PW_SAFE_SLOT_NAME> {
bool isValid() const { return true; }
std::string dissect() const {
std::stringstream ss;
- ss << " slot_name\t" << (const char*) slot_name << std::endl;
+ print_to_ss_volatile(slot_name);
return ss.str();
}
} __packed;
@@ -553,7 +553,7 @@ class SetPasswordSafeSlotData : Command<CommandID::SET_PW_SAFE_SLOT_DATA_1> {
std::string dissect() const {
std::stringstream ss;
ss << " slot_number\t" << (int)slot_number << std::endl;
- ss << " slot_name\t" << (const char*) slot_name << std::endl;
+ print_to_ss_volatile(slot_name);
print_to_ss_volatile(slot_password);
return ss.str();
}