switch (bits) {
case 512:
+ if (ctx->dh_512 != NULL)
+ return -1;
ctx->dh_512 = dh;
break;
- case 1024:
- ctx->dh_1024 = dh;
- break;
default:
- ret = -1;
+ if (ctx->dh_default != NULL)
+ return -1;
+ ctx->dh_default = dh;
break;
}
return ret;
DH_free(ctx->dh_512);
ctx->dh_512 = NULL;
}
- if (ctx->dh_1024 != NULL) {
- DH_free(ctx->dh_1024);
- ctx->dh_1024 = NULL;
+ if (ctx->dh_default != NULL) {
+ DH_free(ctx->dh_default);
+ ctx->dh_default = NULL;
}
}