changeset 11:96a507a110c8

Add support for format 0x030E
author Guido Berhoerster <guido+libpws@berhoerster.name>
date Fri, 02 Aug 2019 14:47:43 +0200
parents 0feba0fea9d0
children 1926dfc9feb0
files include/pws.h pws-field.c pws3_file_create.3.xml
diffstat 3 files changed, 75 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/include/pws.h	Wed Jul 31 11:21:50 2019 +0200
+++ b/include/pws.h	Fri Aug 02 14:47:43 2019 +0200
@@ -36,7 +36,7 @@
 #define	LIBPWS_VERSION_MINOR	0
 #define	LIBPWS_VERSION_MICRO	0
 
-#define	PWS3_VERSION		0x030D
+#define	PWS3_VERSION		0x030E
 
 #define	PWS3_MAX_FIELD_SIZE	(16 * 1024)
 #define	PWS3_MAX_PASSWORD_LEN	1023
@@ -87,6 +87,7 @@
 	PWS3_HEADER_FIELD_NAMED_PASSWORD_POLICIES,	/* 0x10 */
 	PWS3_HEADER_FIELD_EMPTY_GROUPS,			/* 0x11 */
 	PWS3_HEADER_FIELD_YUBICO,			/* 0x12 */
+	PWS3_HEADER_FIELD_PASSWORD_TIMESTAMP,		/* 0x13 */
 	PWS3_HEADER_FIELD_END = 0xff
 };
 
@@ -116,6 +117,14 @@
 	PWS3_RECORD_FIELD_SHIFT_DOUBLE_CLICK_ACTION,	/* 0x17 */
 	PWS3_RECORD_FIELD_PASSWORD_POLICY_NAME,		/* 0x18 */
 	PWS3_RECORD_FIELD_KEYBOARD_SHORTCUT,		/* 0x19 */
+	PWS3_RECORD_FIELD_RESERVED_2,			/* 0x1a */
+	PWS3_RECORD_FIELD_TWO_FACTOR_KEY,		/* 0x1b */
+	PWS3_RECORD_FIELD_CREDIT_CARD_NUMBER,		/* 0x1c */
+	PWS3_RECORD_FIELD_CREDIT_CARD_EXPIRATION,	/* 0x1d */
+	PWS3_RECORD_FIELD_CREDIT_CARD_VERIFICATION_VALUE, /* 0x1e */
+	PWS3_RECORD_FIELD_CREDIT_CARD_PIN,		/* 0x1f */
+	PWS3_RECORD_FIELD_QR_CODE,			/* 0x20 */
+	PWS3_RECORD_FIELD_TESTING_1,			/* 0xdf */
 	PWS3_RECORD_FIELD_END = 0xff
 };
 
--- a/pws-field.c	Wed Jul 31 11:21:50 2019 +0200
+++ b/pws-field.c	Fri Aug 02 14:47:43 2019 +0200
@@ -48,7 +48,8 @@
 	[PWS3_HEADER_FIELD_RECENTLY_USED_ENTRIES] = PWS_DATA_TYPE_TEXT,
 	[PWS3_HEADER_FIELD_NAMED_PASSWORD_POLICIES] = PWS_DATA_TYPE_TEXT,
 	[PWS3_HEADER_FIELD_EMPTY_GROUPS] = PWS_DATA_TYPE_TEXT,
-	[PWS3_HEADER_FIELD_YUBICO] = PWS_DATA_TYPE_TEXT
+	[PWS3_HEADER_FIELD_YUBICO] = PWS_DATA_TYPE_TEXT,
+	[PWS3_HEADER_FIELD_PASSWORD_TIMESTAMP] = PWS_DATA_TYPE_TIME
 };
 
 static const enum pws_data_type	record_data_types[256] = {
@@ -76,7 +77,15 @@
 	[PWS3_RECORD_FIELD_ALLOWED_PASSWORD_SYMBOLS] = PWS_DATA_TYPE_TEXT,
 	[PWS3_RECORD_FIELD_SHIFT_DOUBLE_CLICK_ACTION] = PWS_DATA_TYPE_BYTES,
 	[PWS3_RECORD_FIELD_PASSWORD_POLICY_NAME] = PWS_DATA_TYPE_TEXT,
-	[PWS3_RECORD_FIELD_KEYBOARD_SHORTCUT] = PWS_DATA_TYPE_BYTES
+	[PWS3_RECORD_FIELD_KEYBOARD_SHORTCUT] = PWS_DATA_TYPE_BYTES,
+	[PWS3_RECORD_FIELD_RESERVED_2] = PWS_DATA_TYPE_UUID,
+	[PWS3_RECORD_FIELD_TWO_FACTOR_KEY] = PWS_DATA_TYPE_BYTES,
+	[PWS3_RECORD_FIELD_CREDIT_CARD_NUMBER] = PWS_DATA_TYPE_TEXT,
+	[PWS3_RECORD_FIELD_CREDIT_CARD_EXPIRATION] = PWS_DATA_TYPE_TEXT,
+	[PWS3_RECORD_FIELD_CREDIT_CARD_VERIFICATION_VALUE] = PWS_DATA_TYPE_TEXT,
+	[PWS3_RECORD_FIELD_CREDIT_CARD_PIN] = PWS_DATA_TYPE_TEXT,
+	[PWS3_RECORD_FIELD_QR_CODE] = PWS_DATA_TYPE_TEXT,
+	[PWS3_RECORD_FIELD_TESTING_1] = PWS_DATA_TYPE_BYTES
 };
 
 struct pws3_field *
--- a/pws3_file_create.3.xml	Wed Jul 31 11:21:50 2019 +0200
+++ b/pws3_file_create.3.xml	Fri Aug 02 14:47:43 2019 +0200
@@ -758,6 +758,12 @@
               <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
               <entry>reserved</entry>
             </row>
+            <row>
+              <entry><constant>PWS3_&#8203;HEADER_&#8203;FIELD_&#8203;PASSWORD_&#8203;TIMESTAMP</constant></entry>
+              <entry><literal>0x13</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TIME</constant></entry>
+              <entry>time the master password was last changed</entry>
+            </row>
           </tbody>
         </tgroup>
       </table>
@@ -970,6 +976,54 @@
               <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;BYTES</constant></entry>
               <entry>keyboard shortcut</entry>
             </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;RESERVED_&#8203;2</constant></entry>
+              <entry><literal>0x1a</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;UUID</constant></entry>
+              <entry>reserved</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;TWO_&#8203;FACTOR_&#8203;KEY</constant></entry>
+              <entry><literal>0x1b</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;BYTES</constant></entry>
+              <entry>two factor key</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;NUMBER</constant></entry>
+              <entry><literal>0x1c</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
+              <entry>credit card number</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;EXPIRATION</constant></entry>
+              <entry><literal>0x1d</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
+              <entry>credit card expiration</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;VERIFICATION_&#8203;VALUE</constant></entry>
+              <entry><literal>0x1e</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
+              <entry>credit card verification value</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;PIN</constant></entry>
+              <entry><literal>0x1f</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
+              <entry>credit card PIN</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;QR_&#8203;CODE</constant></entry>
+              <entry><literal>0x20</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
+              <entry>QR code</entry>
+            </row>
+            <row>
+              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;TESTING_&#8203;1</constant></entry>
+              <entry><literal>0xdf</literal></entry>
+              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;BYTES</constant></entry>
+              <entry>testing</entry>
+            </row>
           </tbody>
         </tgroup>
       </table>