diff options
-rw-r--r-- | cryptography/hazmat/backends/interfaces.py | 6 | ||||
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 18 | ||||
-rw-r--r-- | docs/hazmat/backends/interfaces.rst | 10 |
3 files changed, 1 insertions, 33 deletions
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py index 3192789c..66ee1e44 100644 --- a/cryptography/hazmat/backends/interfaces.py +++ b/cryptography/hazmat/backends/interfaces.py @@ -153,12 +153,6 @@ class DSABackend(object): """ @abc.abstractmethod - def dsa_signature_from_components(self, r, s): - """ - Convert a DSA signature pair r and s into a DER byte string. - """ - - @abc.abstractmethod def dsa_hash_supported(self, algorithm): """ Return True if the hash algorithm is supported by the backend for DSA. diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index bd1ce02b..b11fe9db 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -479,24 +479,6 @@ class Backend(object): return _DSAVerificationContext(self, public_key, signature, algorithm) - def dsa_signature_from_components(self, r, s): - dsa_sig = self._lib.DSA_SIG_new() - assert dsa_sig != self._ffi.NULL - dsa_sig = self._ffi.gc(dsa_sig, self._lib.DSA_SIG_free) - - dsa_sig.r = self._int_to_bn(r) - dsa_sig.s = self._int_to_bn(s) - - sig_len = self._lib.i2d_DSA_SIG(dsa_sig, self._ffi.NULL) - assert sig_len != 0 - - sig_buf = self._ffi.new("unsigned char []", sig_len) - sig_bufptr = self._ffi.new("unsigned char **", sig_buf) - - sig_len = self._lib.i2d_DSA_SIG(dsa_sig, sig_bufptr) - - return self._ffi.buffer(sig_buf)[:sig_len] - def _dsa_cdata_from_public_key(self, public_key): # Does not GC the DSA cdata. You *must* make sure it's freed # correctly yourself! diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index e0937f97..114b993d 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -360,16 +360,8 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext` - .. method:: dsa_signature_from_components(r, s) - - :param int r: The r value which is part of a DSA signature. - - :param int s: The s value which is part of a DSA signature. - - :returns: A DSA signature in DER format. - .. method:: dsa_hash_supported(algorithm): - + :param algorithm: An instance of a :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` provider. |