From 43dc2767b8f71bce0c8c249a224ea194380c9180 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 30 Apr 2014 16:24:39 -0500 Subject: remove dsa_signature_from_components since it's no longer needed --- cryptography/hazmat/backends/interfaces.py | 6 ------ cryptography/hazmat/backends/openssl/backend.py | 18 ------------------ docs/hazmat/backends/interfaces.rst | 10 +--------- 3 files changed, 1 insertion(+), 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 @@ -152,12 +152,6 @@ class DSABackend(object): interface. """ - @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): """ 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. -- cgit v1.2.3