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

Changing passphrase fails: AttributeError: 'PassphraseKey' object has no attribute 'change_passphrase' #189

Open
RoelN opened this issue Jan 31, 2015 · 2 comments

Comments

@RoelN
Copy link

RoelN commented Jan 31, 2015

I'm on Debian Jessie, installed Attic (v0.13) through aptitude. Everything works, but when I try to change my repository's passphrase I get an error:

root@server:~#  attic change-passphrase -v /mnt/backups/my-backup.attic
Enter passphrase for /mnt/backups/my-backup.attic:
Traceback (most recent call last):
  File "/usr/bin/attic", line 3, in <module>
    main()
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 715, in main
    exit_code = archiver.run(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 705, in run
    return args.func(args)
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 92, in do_change_passphrase
    key.change_passphrase()
AttributeError: 'PassphraseKey' object has no attribute 'change_passphrase'
root@server:~#

This happens when entering the correct password.

@ThomasWaldmann
Copy link
Contributor

change-passphrase is not possible for repos created with -e passphrase, only for -e keyfile.

The reason is that for "keyfile", you have the 3 keys that are (in the end) used for encryption, hmac, and id computation stored in that keyfile. The keyfile itself is encrypted using your passphrase. So you can decrypt it with old passphrase and encrypt it again (storing the same 3 keys into it) using the new passphrase.

For "passphrase", the data for these 3 keys is directly derived from your passphrase (each time you type in your passphrase). And thus, if you would type in another passphrase, the keys would change also and you would not be able to decrypt your repo files any more (attic notices that and then just asks again, for the correct passphrase).

That said, you shouldn't see a traceback for that of course.

@ThomasWaldmann
Copy link
Contributor

See PR #222.

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

No branches or pull requests

2 participants