Skip to content

Commit

Permalink
Merge pull request #1720 from reaperhulk/gcc-old-openssl-match-made-i…
Browse files Browse the repository at this point in the history
…n-hell

Revert "simplify our DSA parameter copying"
  • Loading branch information
alex committed Mar 4, 2015
2 parents 7144556 + d39c560 commit c21c4af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/cryptography/hazmat/backends/openssl/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,12 @@ def generate_dsa_parameters(self, key_size):
return _DSAParameters(self, ctx)

def generate_dsa_private_key(self, parameters):
ctx = self._lib.DSAparams_dup(parameters._dsa_cdata)
ctx = self._lib.DSA_new()
assert ctx != self._ffi.NULL
ctx = self._ffi.gc(ctx, self._lib.DSA_free)
ctx.p = self._lib.BN_dup(parameters._dsa_cdata.p)
ctx.q = self._lib.BN_dup(parameters._dsa_cdata.q)
ctx.g = self._lib.BN_dup(parameters._dsa_cdata.g)

self._lib.DSA_generate_key(ctx)

Expand Down
2 changes: 0 additions & 2 deletions src/cryptography/hazmat/bindings/openssl/dsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
MACROS = """
int DSA_generate_parameters_ex(DSA *, int, unsigned char *, int,
int *, unsigned long *, BN_GENCB *);
// This is a macro in OpenSSL < 1.0.0
DSA *DSAparams_dup(DSA *);
"""

CUSTOMIZATIONS = """
Expand Down

0 comments on commit c21c4af

Please sign in to comment.