diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-05-02 08:51:58 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-05-02 08:51:58 -0500 |
commit | 865db9d21a91cb02a5f77e1b24b5dc5a90424903 (patch) | |
tree | c480b3648f80ee99f1493cde3c3b86d2e6ce1e36 | |
parent | d80ff2d3a6a443e5aea217d6bc3d356dab2b99b4 (diff) | |
parent | a66f96cd34fe33864066b632f696f025a4fe4b90 (diff) | |
download | cryptography-865db9d21a91cb02a5f77e1b24b5dc5a90424903.tar.gz cryptography-865db9d21a91cb02a5f77e1b24b5dc5a90424903.tar.bz2 cryptography-865db9d21a91cb02a5f77e1b24b5dc5a90424903.zip |
Merge pull request #997 from public/dsa-sign-buflen
Make sure the DSA signature is truncated properly
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index 729f1471..e00be92f 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -1419,8 +1419,9 @@ class _DSASignatureContext(object): 0, data_to_sign, len(data_to_sign), sig_buf, buflen, self._dsa_cdata) assert res == 1 + assert buflen[0] - return self._backend._ffi.buffer(sig_buf)[:] + return self._backend._ffi.buffer(sig_buf)[:buflen[0]] @utils.register_interface(interfaces.CMACContext) |