Support decoding RFC 6979 signatures to (r, s)

This PR will add `pyasn1` as a hard dependency (and removes it from test deps). It adds the ability to encode `(r, s)` to RFC 6979 signatures as well as decoding back to `(r, s)`

Fixes #1285.
Before going any farther -- is that a good idea?

On Thu Nov 27 2014 at 3:20:22 PM Paul Kehrer <notifications@github.com>
wrote:

> In src/cryptography/hazmat/primitives/asymmetric/utils.py:
>
> > +
> > +from __future__ import absolute_import, division, print_function
> > +
> > +from pyasn1.codec.der import decoder, encoder
> > +from pyasn1.type import namedtype, univ
> > +
> > +
> > +class _DSSSigValue(univ.Sequence):
> > +    componentType = namedtype.NamedTypes(
> > +        namedtype.NamedType('r', univ.Integer()),
> > +        namedtype.NamedType('s', univ.Integer())
> > +    )
> > +
> > +
> > +def decode_rfc6979_signature(signature):
> > +    data = decoder.decode(signature, asn1Spec=_DSSSigValue())
>
> It looks like OpenSSL ignores signatures that include extra bytes after
> the valid ASN.1 sequence.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1502/files#r21010999>.
>