81-test_cmp_cli.t: Do connections to 127.0.0.1 (e.g., Mock server) without proxy
[oweals/openssl.git] / test / recipes / 15-test_gendh.t
index 87ddac96f7cff82637303c7eb3f8d097a88b1598..e4e5fb837d47d05b9da8719a153fece035f95d9e 100644 (file)
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ setup("test_gendh");
 
 plan skip_all => "This test is unsupported in a no-dh build" if disabled("dh");
 
-plan tests => 9;
+plan tests => 13;
 
 ok(run(app([ 'openssl', 'genpkey', '-genparam',
              '-algorithm', 'DH',
@@ -80,4 +80,19 @@ ok(run(app([ 'openssl', 'genpkey',
  ok(!run(app([ 'openssl', 'genpkey',
               '-algorithm', 'DH'])),
    "genpkey DH with no params should fail");
-   
\ No newline at end of file
+
+ ok(!run(app([ 'openssl', 'genpkey', '-algorithm', 'DH', '-pkeyopt',
+               'group:ffdhe3072', '-pkeyopt', 'priv_len:255', '-text'])),
+    'genpkey DH with a small private len should fail');
+
+ ok(!run(app([ 'openssl', 'genpkey', '-algorithm', 'DH', '-pkeyopt',
+               'group:ffdhe3072', '-pkeyopt', 'priv_len:3072', '-text'])),
+    'genpkey DH with a large private len should fail');
+
+ ok(run(app([ 'openssl', 'genpkey', '-algorithm', 'DH', '-pkeyopt',
+              'group:ffdhe3072', '-pkeyopt', 'priv_len:256', '-text'])),
+    'genpkey DH with a minimum strength private len');
+
+ ok(run(app([ 'openssl', 'genpkey', '-algorithm', 'DH', '-pkeyopt',
+              'group:ffdhe2048', '-pkeyopt', 'priv_len:224', '-text'])),
+    'genpkey 2048 DH with a minimum strength private len');