Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import binary attachment #63

Closed
zioalex opened this issue Dec 19, 2018 · 7 comments · Fixed by #84
Closed

Import binary attachment #63

zioalex opened this issue Dec 19, 2018 · 7 comments · Fixed by #84

Comments

@zioalex
Copy link
Contributor

zioalex commented Dec 19, 2018

Hi,
I am trying to convert a keepass file in pass.
I exported the file in xml with the expectation that the binary attachment would be there but no way.

I do not see it. Is pass-import in any case capable to import them. I do not see any option for it.
Cheers

@roddhjav
Copy link
Owner

Hi, pass-import currently does not support the import of binary attachment. However, this could be a nice feature to add.

It is a nice proposal because pass support binary file. However, I don't know if a lot of other password manager do support binary files. Like it does not seems keepass support them.

@zioalex
Copy link
Contributor Author

zioalex commented Dec 20, 2018

Actually Keepass support binary attachment. The problem was that the XML export didn't contain them.
However with pschmitt/pykeepass/issues/109 I'd been able to extract the attachment. Now which is the best way to proceed to import them?

@roddhjav
Copy link
Owner

ACK, after check keep indeed, support binary files.

pschmitt/pykeepass seems nice, I will most likely use it in pass-import to support binary file import once the feature will be implemented.

As a temporary solution, supposing you ran the code you provided in https://github.com/pschmitt/pykeepass/issues/109#issuecomment-449024682, it means you have all the files in a tmp directory. So you can import them to pass with something like:

for file in tmp/*; do
    pass insert -m tests/$file < $file
done

@zioalex
Copy link
Contributor Author

zioalex commented Dec 20, 2018

If possible I would try to import pykeepass and add a function in pass-import to have them in the correct place.

@zioalex
Copy link
Contributor Author

zioalex commented Dec 21, 2018

I am trying to understand your code to find out the place where to catch the Binary Element.
I think it should be in the Keepass(KeepassX) class but still not clear how to do it.

@roddhjav
Copy link
Owner

Ok, then will soon create a branch with this early feature.

You would need to put override the parse function which is the main function called for very manager and that read the import file.

class Keepass(KeepassX):

    ...

    def parse(self, file):
        super(Keepass, self).parse(file)
        # your code here

@zioalex
Copy link
Contributor Author

zioalex commented Dec 28, 2018

Created pull request #68

@roddhjav roddhjav mentioned this issue Jun 7, 2019
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants