def gen_dh_params(bits): dh = _lib.DH_new() # pylint: disable=no-member _lib.DH_generate_parameters_ex(dh, bits, 2, _ffi.NULL) # pylint: disable=no-member bio = _new_mem_buf() _lib.PEM_write_bio_DHparams(bio, dh) # pylint: disable=no-member return _bio_to_string(bio)
def gen_dh_params(bits): dh = _lib.DH_new() _lib.DH_generate_parameters_ex(dh, bits, 2L, _ffi.NULL) bio = _new_mem_buf() _lib.PEM_write_bio_DHparams(bio, dh) return _bio_to_string(bio)