doctr icon indicating copy to clipboard operation
doctr copied to clipboard

cryptography.fernet.InvalidToken

Open asmeurer opened this issue 7 years ago • 2 comments

I am getting this even after re-running doctr configure and replacing the encrypted key in .travis.yml. This is after installing doctr from git. No idea what is going on here.

Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/cryptography-1.9-py3.6-linux-x86_64.egg/cryptography/fernet.py", line 101, in decrypt
    h.verify(data[-32:])
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/cryptography-1.9-py3.6-linux-x86_64.egg/cryptography/hazmat/primitives/hmac.py", line 69, in verify
    ctx.verify(signature)
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/cryptography-1.9-py3.6-linux-x86_64.egg/cryptography/hazmat/backends/openssl/hmac.py", line 74, in verify
    raise InvalidSignature("Signature did not match digest.")
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.1/bin/doctr", line 11, in <module>
    load_entry_point('doctr==1.5.3+22.g12996c5', 'console_scripts', 'doctr')()
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/doctr-1.5.3+22.g12996c5-py3.6.egg/doctr/__main__.py", line 414, in main
    return process_args(get_parser(config=config))
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/doctr-1.5.3+22.g12996c5-py3.6.egg/doctr/__main__.py", line 211, in process_args
    return args.func(args, parser)
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/doctr-1.5.3+22.g12996c5-py3.6.egg/doctr/__main__.py", line 255, in deploy
    branch_whitelist=branch_whitelist)
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/doctr-1.5.3+22.g12996c5-py3.6.egg/doctr/travis.py", line 209, in setup_GitHub_push
    setup_deploy_key(keypath=keypath, key_ext=key_ext)
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/doctr-1.5.3+22.g12996c5-py3.6.egg/doctr/travis.py", line 56, in setup_deploy_key
    decrypt_file(keypath + key_ext, key)
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/doctr-1.5.3+22.g12996c5-py3.6.egg/doctr/travis.py", line 34, in decrypt_file
    decrypted_file = fer.decrypt(f.read())
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/cryptography-1.9-py3.6-linux-x86_64.egg/cryptography/fernet.py", line 103, in decrypt
    raise InvalidToken
cryptography.fernet.InvalidToken

asmeurer avatar Jun 17 '17 22:06 asmeurer

Doesn't happen on the pip installed version. I have no idea what would have broken there. It's the same version of cryptography in both instances.

asmeurer avatar Jun 17 '17 22:06 asmeurer

If I install doctr from pip with pip install git+git://github.com/drdoctr/doctr.git it works, but if I clone the repo and use setup.py install it doesn't work. I also tried just installing cryptography from git, but that didn't make a difference.

asmeurer avatar Jun 17 '17 23:06 asmeurer