Add dhparam sanity check and update DH_check documentation
[openssl.git] / doc / crypto / DH_generate_parameters.pod
index 71fa4363d4a7b7312b3a1601be880978773f2a70..8970aae444f3057127f9c42da3090fd1aa8601af 100644 (file)
@@ -37,12 +37,41 @@ number is generated, and when a prime has been found, B<BN_GENCB_call(cb, 3, 0)>
 is called. See L<BN_generate_prime(3)> for information on
 the BN_GENCB_call() function.
 
 is called. See L<BN_generate_prime(3)> for information on
 the BN_GENCB_call() function.
 
-DH_check() validates Diffie-Hellman parameters. It checks that B<p> is
-a safe prime, and that B<g> is a suitable generator. In the case of an
-error, the bit flags DH_CHECK_P_NOT_SAFE_PRIME or
-DH_NOT_SUITABLE_GENERATOR are set in B<*codes>.
-DH_UNABLE_TO_CHECK_GENERATOR is set if the generator cannot be
-checked, i.e. it does not equal 2 or 5.
+DH_check() confirms that the Diffie-Hellman parameters B<dh> are valid. The
+value of B<*codes> is updated with any problems found. If B<*codes> is zero then
+no problems were found, otherwise the following bits may be set:
+
+=over 4
+
+=item DH_CHECK_P_NOT_PRIME
+
+The parameter B<p> is not prime.
+
+=item DH_CHECK_P_NOT_SAFE_PRIME
+
+The parameter B<p> is not a safe prime and no B<q> value is present.
+
+=item DH_UNABLE_TO_CHECK_GENERATOR
+
+The generator B<g> cannot be checked for suitability.
+
+=item DH_NOT_SUITABLE_GENERATOR
+
+The generator B<g> is not suitable.
+
+=item DH_CHECK_Q_NOT_PRIME
+
+The parameter B<q> is not prime.
+
+=item DH_CHECK_INVALID_Q_VALUE
+
+The parameter B<q> is invalid.
+
+=item DH_CHECK_INVALID_J_VALUE
+
+The parameter B<j> is invalid.
+
+=back
 
 =head1 RETURN VALUES
 
 
 =head1 RETURN VALUES
 
@@ -62,11 +91,6 @@ hours before finding a suitable prime.
 The parameters generated by DH_generate_parameters_ex() and DH_generate_parameters()
 are not to be used in signature schemes.
 
 The parameters generated by DH_generate_parameters_ex() and DH_generate_parameters()
 are not to be used in signature schemes.
 
-=head1 BUGS
-
-If B<generator> is not 2 or 5, B<dh-E<gt>g>=B<generator> is not
-a usable generator.
-
 =head1 SEE ALSO
 
 L<dh(3)>, L<ERR_get_error(3)>, L<rand(3)>,
 =head1 SEE ALSO
 
 L<dh(3)>, L<ERR_get_error(3)>, L<rand(3)>,