mirror of https://github.com/openssl/openssl.git
dh_to_text: Print the dh->length if set
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/18793)
This commit is contained in:
parent
8ed6ddcaa5
commit
c9bdbc12ac
|
|
@ -220,6 +220,7 @@ static int dh_to_text(BIO *out, const void *key, int selection)
|
||||||
const BIGNUM *priv_key = NULL, *pub_key = NULL;
|
const BIGNUM *priv_key = NULL, *pub_key = NULL;
|
||||||
const FFC_PARAMS *params = NULL;
|
const FFC_PARAMS *params = NULL;
|
||||||
const BIGNUM *p = NULL;
|
const BIGNUM *p = NULL;
|
||||||
|
long length;
|
||||||
|
|
||||||
if (out == NULL || dh == NULL) {
|
if (out == NULL || dh == NULL) {
|
||||||
ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
|
ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
|
||||||
|
|
@ -272,6 +273,11 @@ static int dh_to_text(BIO *out, const void *key, int selection)
|
||||||
if (params != NULL
|
if (params != NULL
|
||||||
&& !ffc_params_to_text(out, params))
|
&& !ffc_params_to_text(out, params))
|
||||||
return 0;
|
return 0;
|
||||||
|
length = DH_get_length(dh);
|
||||||
|
if (length > 0
|
||||||
|
&& BIO_printf(out, "recommended-private-length: %ld bits\n",
|
||||||
|
length) <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,3 +22,4 @@ public-key:
|
||||||
a8:ee:72:13:45:65:15:42:17:aa:d8:ab:cf:33:42:
|
a8:ee:72:13:45:65:15:42:17:aa:d8:ab:cf:33:42:
|
||||||
83:42
|
83:42
|
||||||
GROUP: ffdhe2048
|
GROUP: ffdhe2048
|
||||||
|
recommended-private-length: 224 bits
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@ public-key:
|
||||||
a8:ee:72:13:45:65:15:42:17:aa:d8:ab:cf:33:42:
|
a8:ee:72:13:45:65:15:42:17:aa:d8:ab:cf:33:42:
|
||||||
83:42
|
83:42
|
||||||
GROUP: ffdhe2048
|
GROUP: ffdhe2048
|
||||||
|
recommended-private-length: 224 bits
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue