/*
- * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* https://www.openssl.org/source/license.html
*/
+/*
+ * DH low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/bn.h>
*pval = NULL;
return 2;
} else if (operation == ASN1_OP_D2I_POST) {
- ((DH *)*pval)->dirty_cnt++;
+ DH *dh = (DH *)*pval;
+
+ DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
+ DH_set_flags(dh, DH_FLAG_TYPE_DH);
+ dh->dirty_cnt++;
}
return 1;
}
params = &dh->params;
DH_set0_pqg(dh, dhx->p, dhx->q, dhx->g);
- ffc_params_set0_j(params, dhx->j);
+ ossl_ffc_params_set0_j(params, dhx->j);
if (dhx->vparams != NULL) {
/* The counter has a maximum value of 4 * numbits(p) - 1 */
size_t counter = (size_t)BN_get_word(dhx->vparams->counter);
- ffc_params_set_validate_params(params, dhx->vparams->seed->data,
- dhx->vparams->seed->length, counter);
+ ossl_ffc_params_set_validate_params(params, dhx->vparams->seed->data,
+ dhx->vparams->seed->length,
+ counter);
ASN1_BIT_STRING_free(dhx->vparams->seed);
BN_free(dhx->vparams->counter);
OPENSSL_free(dhx->vparams);
}
OPENSSL_free(dhx);
+ DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
+ DH_set_flags(dh, DH_FLAG_TYPE_DHX);
return dh;
}
const FFC_PARAMS *params = &dh->params;
int counter;
- ffc_params_get0_pqg(params, (const BIGNUM **)&dhx.p,
- (const BIGNUM **)&dhx.q, (const BIGNUM **)&dhx.g);
+ ossl_ffc_params_get0_pqg(params, (const BIGNUM **)&dhx.p,
+ (const BIGNUM **)&dhx.q, (const BIGNUM **)&dhx.g);
dhx.j = params->j;
- ffc_params_get_validate_params(params, &seed.data, &seedlen, &counter);
+ ossl_ffc_params_get_validate_params(params, &seed.data, &seedlen, &counter);
seed.length = (int)seedlen;
if (counter != -1 && seed.data != NULL && seed.length > 0) {