projects/libpws

changeset 11:96a507a110c8

Add support for format 0x030E
author Guido Berhoerster <guido+libpws@berhoerster.name>
date Fri Aug 02 14:47:43 2019 +0200 (2019-08-02)
parents 0feba0fea9d0
children 1926dfc9feb0
files include/pws.h pws-field.c pws3_file_create.3.xml
line diff
     1.1 --- a/include/pws.h	Wed Jul 31 11:21:50 2019 +0200
     1.2 +++ b/include/pws.h	Fri Aug 02 14:47:43 2019 +0200
     1.3 @@ -36,7 +36,7 @@
     1.4  #define	LIBPWS_VERSION_MINOR	0
     1.5  #define	LIBPWS_VERSION_MICRO	0
     1.6  
     1.7 -#define	PWS3_VERSION		0x030D
     1.8 +#define	PWS3_VERSION		0x030E
     1.9  
    1.10  #define	PWS3_MAX_FIELD_SIZE	(16 * 1024)
    1.11  #define	PWS3_MAX_PASSWORD_LEN	1023
    1.12 @@ -87,6 +87,7 @@
    1.13  	PWS3_HEADER_FIELD_NAMED_PASSWORD_POLICIES,	/* 0x10 */
    1.14  	PWS3_HEADER_FIELD_EMPTY_GROUPS,			/* 0x11 */
    1.15  	PWS3_HEADER_FIELD_YUBICO,			/* 0x12 */
    1.16 +	PWS3_HEADER_FIELD_PASSWORD_TIMESTAMP,		/* 0x13 */
    1.17  	PWS3_HEADER_FIELD_END = 0xff
    1.18  };
    1.19  
    1.20 @@ -116,6 +117,14 @@
    1.21  	PWS3_RECORD_FIELD_SHIFT_DOUBLE_CLICK_ACTION,	/* 0x17 */
    1.22  	PWS3_RECORD_FIELD_PASSWORD_POLICY_NAME,		/* 0x18 */
    1.23  	PWS3_RECORD_FIELD_KEYBOARD_SHORTCUT,		/* 0x19 */
    1.24 +	PWS3_RECORD_FIELD_RESERVED_2,			/* 0x1a */
    1.25 +	PWS3_RECORD_FIELD_TWO_FACTOR_KEY,		/* 0x1b */
    1.26 +	PWS3_RECORD_FIELD_CREDIT_CARD_NUMBER,		/* 0x1c */
    1.27 +	PWS3_RECORD_FIELD_CREDIT_CARD_EXPIRATION,	/* 0x1d */
    1.28 +	PWS3_RECORD_FIELD_CREDIT_CARD_VERIFICATION_VALUE, /* 0x1e */
    1.29 +	PWS3_RECORD_FIELD_CREDIT_CARD_PIN,		/* 0x1f */
    1.30 +	PWS3_RECORD_FIELD_QR_CODE,			/* 0x20 */
    1.31 +	PWS3_RECORD_FIELD_TESTING_1,			/* 0xdf */
    1.32  	PWS3_RECORD_FIELD_END = 0xff
    1.33  };
    1.34  
     2.1 --- a/pws-field.c	Wed Jul 31 11:21:50 2019 +0200
     2.2 +++ b/pws-field.c	Fri Aug 02 14:47:43 2019 +0200
     2.3 @@ -48,7 +48,8 @@
     2.4  	[PWS3_HEADER_FIELD_RECENTLY_USED_ENTRIES] = PWS_DATA_TYPE_TEXT,
     2.5  	[PWS3_HEADER_FIELD_NAMED_PASSWORD_POLICIES] = PWS_DATA_TYPE_TEXT,
     2.6  	[PWS3_HEADER_FIELD_EMPTY_GROUPS] = PWS_DATA_TYPE_TEXT,
     2.7 -	[PWS3_HEADER_FIELD_YUBICO] = PWS_DATA_TYPE_TEXT
     2.8 +	[PWS3_HEADER_FIELD_YUBICO] = PWS_DATA_TYPE_TEXT,
     2.9 +	[PWS3_HEADER_FIELD_PASSWORD_TIMESTAMP] = PWS_DATA_TYPE_TIME
    2.10  };
    2.11  
    2.12  static const enum pws_data_type	record_data_types[256] = {
    2.13 @@ -76,7 +77,15 @@
    2.14  	[PWS3_RECORD_FIELD_ALLOWED_PASSWORD_SYMBOLS] = PWS_DATA_TYPE_TEXT,
    2.15  	[PWS3_RECORD_FIELD_SHIFT_DOUBLE_CLICK_ACTION] = PWS_DATA_TYPE_BYTES,
    2.16  	[PWS3_RECORD_FIELD_PASSWORD_POLICY_NAME] = PWS_DATA_TYPE_TEXT,
    2.17 -	[PWS3_RECORD_FIELD_KEYBOARD_SHORTCUT] = PWS_DATA_TYPE_BYTES
    2.18 +	[PWS3_RECORD_FIELD_KEYBOARD_SHORTCUT] = PWS_DATA_TYPE_BYTES,
    2.19 +	[PWS3_RECORD_FIELD_RESERVED_2] = PWS_DATA_TYPE_UUID,
    2.20 +	[PWS3_RECORD_FIELD_TWO_FACTOR_KEY] = PWS_DATA_TYPE_BYTES,
    2.21 +	[PWS3_RECORD_FIELD_CREDIT_CARD_NUMBER] = PWS_DATA_TYPE_TEXT,
    2.22 +	[PWS3_RECORD_FIELD_CREDIT_CARD_EXPIRATION] = PWS_DATA_TYPE_TEXT,
    2.23 +	[PWS3_RECORD_FIELD_CREDIT_CARD_VERIFICATION_VALUE] = PWS_DATA_TYPE_TEXT,
    2.24 +	[PWS3_RECORD_FIELD_CREDIT_CARD_PIN] = PWS_DATA_TYPE_TEXT,
    2.25 +	[PWS3_RECORD_FIELD_QR_CODE] = PWS_DATA_TYPE_TEXT,
    2.26 +	[PWS3_RECORD_FIELD_TESTING_1] = PWS_DATA_TYPE_BYTES
    2.27  };
    2.28  
    2.29  struct pws3_field *
     3.1 --- a/pws3_file_create.3.xml	Wed Jul 31 11:21:50 2019 +0200
     3.2 +++ b/pws3_file_create.3.xml	Fri Aug 02 14:47:43 2019 +0200
     3.3 @@ -758,6 +758,12 @@
     3.4                <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
     3.5                <entry>reserved</entry>
     3.6              </row>
     3.7 +            <row>
     3.8 +              <entry><constant>PWS3_&#8203;HEADER_&#8203;FIELD_&#8203;PASSWORD_&#8203;TIMESTAMP</constant></entry>
     3.9 +              <entry><literal>0x13</literal></entry>
    3.10 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TIME</constant></entry>
    3.11 +              <entry>time the master password was last changed</entry>
    3.12 +            </row>
    3.13            </tbody>
    3.14          </tgroup>
    3.15        </table>
    3.16 @@ -970,6 +976,54 @@
    3.17                <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;BYTES</constant></entry>
    3.18                <entry>keyboard shortcut</entry>
    3.19              </row>
    3.20 +            <row>
    3.21 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;RESERVED_&#8203;2</constant></entry>
    3.22 +              <entry><literal>0x1a</literal></entry>
    3.23 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;UUID</constant></entry>
    3.24 +              <entry>reserved</entry>
    3.25 +            </row>
    3.26 +            <row>
    3.27 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;TWO_&#8203;FACTOR_&#8203;KEY</constant></entry>
    3.28 +              <entry><literal>0x1b</literal></entry>
    3.29 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;BYTES</constant></entry>
    3.30 +              <entry>two factor key</entry>
    3.31 +            </row>
    3.32 +            <row>
    3.33 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;NUMBER</constant></entry>
    3.34 +              <entry><literal>0x1c</literal></entry>
    3.35 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
    3.36 +              <entry>credit card number</entry>
    3.37 +            </row>
    3.38 +            <row>
    3.39 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;EXPIRATION</constant></entry>
    3.40 +              <entry><literal>0x1d</literal></entry>
    3.41 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
    3.42 +              <entry>credit card expiration</entry>
    3.43 +            </row>
    3.44 +            <row>
    3.45 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;VERIFICATION_&#8203;VALUE</constant></entry>
    3.46 +              <entry><literal>0x1e</literal></entry>
    3.47 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
    3.48 +              <entry>credit card verification value</entry>
    3.49 +            </row>
    3.50 +            <row>
    3.51 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;CREDIT_&#8203;CARD_&#8203;PIN</constant></entry>
    3.52 +              <entry><literal>0x1f</literal></entry>
    3.53 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
    3.54 +              <entry>credit card PIN</entry>
    3.55 +            </row>
    3.56 +            <row>
    3.57 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;QR_&#8203;CODE</constant></entry>
    3.58 +              <entry><literal>0x20</literal></entry>
    3.59 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;TEXT</constant></entry>
    3.60 +              <entry>QR code</entry>
    3.61 +            </row>
    3.62 +            <row>
    3.63 +              <entry><constant>PWS3_&#8203;RECORD_&#8203;FIELD_&#8203;TESTING_&#8203;1</constant></entry>
    3.64 +              <entry><literal>0xdf</literal></entry>
    3.65 +              <entry><constant>PWS_&#8203;DATA_&#8203;TYPE_&#8203;BYTES</constant></entry>
    3.66 +              <entry>testing</entry>
    3.67 +            </row>
    3.68            </tbody>
    3.69          </tgroup>
    3.70        </table>