summaryrefslogtreecommitdiffstats
path: root/src/filecontent.h
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>2019-09-28 00:50:14 +0200
committerMaciej S. Szmigiero <mail@maciej.szmigiero.name>2019-09-28 00:53:55 +0200
commit0498dd6862447633e9c7731955be5474cc81d911 (patch)
tree1fbb1e6a6bcf451e1738708f6efa151c345a4305 /src/filecontent.h
parent3c97670a8847f56518095dde1f7b0a2b68cc8421 (diff)
Don't show a TOTP secret when selecting a password entry in the main window
Knowing the TOTP secret for a password entry allows somebody to recreate the whole OTP sequence so it definitely shouldn't be displayed in the clear. In fact, it shouldn't be displayed at all in the main window since the proper way to utilize a TOTP entry is to click the "OTP" button to generate a new OTP (rather than to copy the secret to the clipboard like it was a password). The password edit dialog isn't affected by this change and will still show the whole entry, including its TOTP secret if present.
Diffstat (limited to 'src/filecontent.h')
-rw-r--r--src/filecontent.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/filecontent.h b/src/filecontent.h
index 94e48aa0..845648f7 100644
--- a/src/filecontent.h
+++ b/src/filecontent.h
@@ -28,8 +28,8 @@ public:
* @brief parse parses the given fileContent in a FileContent object.
* The password is accessible through getPassword.
* The named value pairs (name: value) are parsed and depeding on the
- * templateFields and allFields parameters accessible through getNamedValues
- * or getRemainingData.
+ * templateFields and allFields parameters accessible through getNamedValues,
+ * getRemainingData or getRemainingDataForDisplay.
*
* @param fileContent the file content to parse.
*
@@ -61,13 +61,19 @@ public:
*/
QString getRemainingData() const;
+ /**
+ * @like getRemainingData but without data that should not be displayed
+ * (like a TOTP secret).
+ */
+ QString getRemainingDataForDisplay() const;
+
private:
FileContent(const QString &password, const NamedValues &namedValues,
- const QString &remainingData);
+ const QString &remainingData, const QString &remainingDataDisplay);
QString password;
NamedValues namedValues;
- QString remainingData;
+ QString remainingData, remainingDataDisplay;
};
#endif // FILECONTENT_H