X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdh%2Fdh_ameth.c;h=78aea36093263ee2d58d18393f4d402d5cb737df;hp=b7b37177c160174b06a390330e215ec4bc4383d0;hb=1d54ef340864507c1b6e86238183ab4cbc7423aa;hpb=eeb21772effdd385e44eed547d717f171487987e diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index b7b37177c1..78aea36093 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -280,7 +280,8 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, int ptype) else pub_key = NULL; - if (priv_key == NULL && pub_key == NULL) { + if (x->p == NULL || (ptype == 2 && priv_key == NULL) + || (ptype > 0 && pub_key == NULL)) { reason = ERR_R_PASSED_NULL_PARAMETER; goto err; }