diff --git a/src/importers/codebookCsvImporter.ts b/src/importers/codebookCsvImporter.ts index 59ebdd4a8f..7ee56c205b 100644 --- a/src/importers/codebookCsvImporter.ts +++ b/src/importers/codebookCsvImporter.ts @@ -32,6 +32,7 @@ export class CodebookCsvImporter extends BaseImporter implements Importer { this.processKvp(cipher, 'Account', value.Account); this.processKvp(cipher, 'Date', value.Date); + this.convertToNoteIfNeeded(cipher); this.cleanupCipher(cipher); result.ciphers.push(cipher); }); diff --git a/src/importers/keepass2XmlImporter.ts b/src/importers/keepass2XmlImporter.ts index a959baeadd..1ad213e238 100644 --- a/src/importers/keepass2XmlImporter.ts +++ b/src/importers/keepass2XmlImporter.ts @@ -74,8 +74,9 @@ export class KeePass2XmlImporter extends BaseImporter implements Importer { cipher.notes += (value + '\n'); } else { let type = FieldType.Text; - if (valueEl.attributes.length > 0 && valueEl.attributes['ProtectInMemory'] != null && - valueEl.attributes['ProtectInMemory'].value === 'True') { + const attrs = (valueEl.attributes as any); + if (attrs.length > 0 && attrs.ProtectInMemory != null && + attrs.ProtectInMemory.value === 'True') { type = FieldType.Hidden; } this.processKvp(cipher, key, value, type); diff --git a/src/importers/onepassword1PifImporter.ts b/src/importers/onepassword1PifImporter.ts index 56a7a76652..b3df8f9d54 100644 --- a/src/importers/onepassword1PifImporter.ts +++ b/src/importers/onepassword1PifImporter.ts @@ -54,6 +54,9 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer { } if (item.details != null) { + if (item.details.passwordHistory != null) { + this.parsePasswordHistory(item.details.passwordHistory, cipher); + } if (!this.isNullOrWhitespace(item.details.ccnum) || !this.isNullOrWhitespace(item.details.cvv)) { cipher.type = CipherType.Card; cipher.card = new CardView(); @@ -78,9 +81,6 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer { } }); } - if (item.details.passwordHistory != null) { - this.parsePasswordHistory(item.details.passwordHistory, cipher); - } } } @@ -103,6 +103,9 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer { } if (item.secureContents != null) { + if (item.secureContents.passwordHistory != null) { + this.parsePasswordHistory(item.secureContents.passwordHistory, cipher); + } if (!this.isNullOrWhitespace(item.secureContents.notesPlain)) { cipher.notes = item.secureContents.notesPlain.split(this.newLineRegex).join('\n') + '\n'; } @@ -132,9 +135,6 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer { } }); } - if (item.secureContents.passwordHistory != null) { - this.parsePasswordHistory(item.secureContents.passwordHistory, cipher); - } } } @@ -232,8 +232,13 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer { } } - const fieldType = field.k === 'concealed' ? FieldType.Hidden : FieldType.Text; const fieldName = this.isNullOrWhitespace(field[nameKey]) ? 'no_name' : field[nameKey]; + if (fieldName === 'password' && cipher.passwordHistory != null && + cipher.passwordHistory.some((h) => h.password === fieldValue)) { + return; + } + + const fieldType = field.k === 'concealed' ? FieldType.Hidden : FieldType.Text; this.processKvp(cipher, fieldName, fieldValue, fieldType); }); }