Skip to content
This repository has been archived by the owner on Dec 15, 2019. It is now read-only.

Support private keys with passwords #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

numberoverzero
Copy link

@numberoverzero numberoverzero commented Sep 27, 2016

This change allows users to sign with a private key that has a password.

The new test key is rsa_private_pass.pem with the password hunter2 and was generated from rsa_private.pem with the following command:

ssh-keygen -p -f rsa_private.pem -N hunter2

The new test test_password is identical to test_default except in setting up the HeaderSigner.


There's a bit of noise from doing a quick linting pass while I was reading the source. I can revert that if you prefer.

tox passed for py27, py33, py34, and I ran py35 since I use that primarily. I haven't set up py32, pypy, or pypy3. I don't think they'll matter for this change since it's just plumbing a value through. Let me know if you want me to set them up and test as well.

This change allows users to sign with a private key that has a
password.

The new test key rsa_private_pass.pem has the password "hunter2"
and was generated from rsa_private.pem with the following command:

    ssh-keygen -p -f rsa_private.pem -N hunter2

and the new test expects the same output as test_default.
@numberoverzero
Copy link
Author

numberoverzero commented Sep 27, 2016

The test failures don't seem related to this change.

The py32 failure I believe is failing on pip, which notes that 3.0-3.2 are no longer supported:

/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py:80: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.

Traceback (most recent call last):
  [snip]
  File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/progress/bar.py", line 48

    empty_fill = u'∙'

                      ^

SyntaxError: invalid syntax

The pypy3 tests are failing I think because cryptography.io considers this a < 2.6 version of pypy? I'm also not sure what to do with this. The same 3.0-3.2 warning from pip also appears.

/home/travis/build/hawkowl/httpsig_cffi/.tox/pypy3/site-packages/pkg_resources/__init__.py:81: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.

      warnings.warn(msg)

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-build-qc_7ob/cryptography/setup.py", line 53, in <module>

        "cryptography 1.0 is not compatible with PyPy < 2.6. Please "

    RuntimeError: cryptography 1.0 is not compatible with PyPy < 2.6. Please upgrade PyPy to use this library.

@numberoverzero
Copy link
Author

@hawkowl Anything I can do to help this along?

I'm pretty sure dropping py32 from .travis.yml would fix the failure above, but that's orthogonal to this change. If you'd prefer to keep testing on py32 (and whatever's wrong with pypy) I can look for solutions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant