Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Commit

Permalink
Store secure notes in the "launch" field as it's 256 vs 64 char
Browse files Browse the repository at this point in the history
And secure notes are likely to be longer. Since whole file is encrypted
anyway, doesn't matter which field you use to store things in. Saves
patching PWman to make the password field accept more chars.

Add note to README regarding this known limitation.
  • Loading branch information
atomicules committed Feb 3, 2013
1 parent e591129 commit 77ff436
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ Developed and tested in SBCL. Use as follows
sbcl --script /path/to/this/script <gpg id used with pwman> </path/to/lastpass/export> sbcl --script /path/to/this/script <gpg id used with pwman> </path/to/lastpass/export>


The path to the Lastpass export is optional. If not supplied assumes file is called "lastpass.csv" and is in current directory. The script works by first exporting a plain text file called "pwman.txt" to current directory, however, this is then immediately encrypted via GPG and replaces the `.pwman.db` file. Both plain text files (the Lastpass export and `pwman.txt`) are then deleted - unless an error occurs with the encryption, in which case the script notifies the user and leaves the files. The path to the Lastpass export is optional. If not supplied assumes file is called "lastpass.csv" and is in current directory. The script works by first exporting a plain text file called "pwman.txt" to current directory, however, this is then immediately encrypted via GPG and replaces the `.pwman.db` file. Both plain text files (the Lastpass export and `pwman.txt`) are then deleted - unless an error occurs with the encryption, in which case the script notifies the user and leaves the files.

## Known issues

PWman has a maximum password length of 64 characters therefore secure notes are stored in the launch field of PWman. Since the whole file is encrypted it doesn't really matter which field is used. The launch field allows up to 256 characters. If your secure notes are longer than this, then PWman will truncate them when saving. Also, note that although PWman will store 256 characters correctly it won't necessarily display them all correctly (the field was intended for displaying a single line of text), but the data will be in the file.
9 changes: 6 additions & 3 deletions lastpass2pwman.lisp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@
;Then loop through each entry in group ;Then loop through each entry in group
(loop for entry in groupentries (loop for entry in groupentries
do (format stream do (format stream
"<PwItem><name>~a</name><host>~a</host><user>~a</user><passwd>~a</passwd><launch></launch></PwItem>" "<PwItem><name>~a</name><host>~a</host><user>~a</user><passwd>~a</passwd><launch>~a</launch></PwItem>"
(xmls:toxml (fifth entry)) (xmls:toxml (fifth entry))
(xmls:toxml (first entry)) (xmls:toxml (first entry))
(xmls:toxml (second entry)) (xmls:toxml (second entry))
(if (null (third entry)) ;Secure Notes have no password (if (null (third entry)) ;Secure Notes have no password
(xmls:toxml (fourth entry)) ;Use extra field if Secure Note "" ;put nothing in pwman password field if Secure Note
(xmls:toxml (third entry))))) (xmls:toxml (third entry)))
(if (null (third entry))
(xmls:toxml (fourth entry)) ;Use launch field for Secure Notes as it is longer
"")))
(format stream "</PwList>")) (format stream "</PwList>"))
(return))))) (return)))))
(format stream "</PwList></PWMan_PasswordList>")) (format stream "</PwList></PWMan_PasswordList>"))
Expand Down

0 comments on commit 77ff436

Please sign in to comment.