File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed
Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -229,29 +229,10 @@ impl Dsa<Params> {
229229impl Dsa < Private > {
230230 /// Generate a DSA key pair.
231231 ///
232- /// Calls [`DSA_generate_parameters_ex`] to populate the `p`, `g`, and `q` values.
233- /// These values are used to generate the key pair with [`DSA_generate_key`].
234- ///
235232 /// The `bits` parameter corresponds to the length of the prime `p`.
236- ///
237- /// [`DSA_generate_parameters_ex`]: https://www.openssl.org/docs/manmaster/crypto/DSA_generate_parameters_ex.html
238- /// [`DSA_generate_key`]: https://www.openssl.org/docs/manmaster/crypto/DSA_generate_key.html
239233 pub fn generate ( bits : u32 ) -> Result < Dsa < Private > , ErrorStack > {
240- ffi:: init ( ) ;
241- unsafe {
242- let dsa = Dsa :: from_ptr ( cvt_p ( ffi:: DSA_new ( ) ) ?) ;
243- cvt ( ffi:: DSA_generate_parameters_ex (
244- dsa. 0 ,
245- bits as BitType ,
246- ptr:: null ( ) ,
247- 0 ,
248- ptr:: null_mut ( ) ,
249- ptr:: null_mut ( ) ,
250- ptr:: null_mut ( ) ,
251- ) ) ?;
252- cvt ( ffi:: DSA_generate_key ( dsa. 0 ) ) ?;
253- Ok ( dsa)
254- }
234+ let params = Dsa :: generate_params ( bits) ?;
235+ params. generate_key ( )
255236 }
256237
257238 /// Create a DSA key pair with the given parameters
You can’t perform that action at this time.
0 commit comments