We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b196c1d commit f45487cCopy full SHA for f45487c
src/node_crypto.cc
@@ -805,10 +805,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
805
return;
806
807
const int keylen = BN_num_bits(dh->p);
808
- if (keylen < 1024)
+ if (keylen < 1024) {
809
+ DH_free(dh);
810
return env->ThrowError("DH parameter is less than 1024 bits");
- else if (keylen < 2048)
811
+ } else if (keylen < 2048) {
812
fprintf(stderr, "WARNING: DH parameter is less than 2048 bits\n");
813
+ }
814
815
SSL_CTX_set_options(sc->ctx_, SSL_OP_SINGLE_DH_USE);
816
int r = SSL_CTX_set_tmp_dh(sc->ctx_, dh);
0 commit comments