File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -832,6 +832,7 @@ mod test {
832
832
use crate :: pkey:: PKey ;
833
833
use crate :: rsa:: Rsa ;
834
834
use crate :: sign:: Verifier ;
835
+ use cfg_if:: cfg_if;
835
836
836
837
#[ test]
837
838
fn rsa ( ) {
@@ -958,6 +959,29 @@ mod test {
958
959
ctx. keygen ( ) . unwrap ( ) ;
959
960
}
960
961
962
+ #[ test]
963
+ #[ cfg( not( boringssl) ) ]
964
+ fn dsa_paramgen ( ) {
965
+ let mut ctx = PkeyCtx :: new_id ( Id :: DSA ) . unwrap ( ) ;
966
+ ctx. paramgen_init ( ) . unwrap ( ) ;
967
+ ctx. set_dsa_paramgen_bits ( 2048 ) . unwrap ( ) ;
968
+ let params = ctx. paramgen ( ) . unwrap ( ) ;
969
+
970
+ let size = {
971
+ cfg_if ! {
972
+ if #[ cfg( awslc) ] {
973
+ 72
974
+ } else if #[ cfg( any( libressl, all( ossl101, not( ossl102) ) ) ) ] {
975
+ // LibreSSL and OpenSSL 1.0.1 and earlier
976
+ 48
977
+ } else {
978
+ 64
979
+ }
980
+ }
981
+ } ;
982
+ assert_eq ! ( params. size( ) , size) ;
983
+ }
984
+
961
985
#[ test]
962
986
#[ cfg( any( ossl110, boringssl, libressl360, awslc) ) ]
963
987
fn hkdf ( ) {
You can’t perform that action at this time.
0 commit comments