Implement/stub:

- X509_REQ_print_fp
- X509_print_fp
- DHparams_dup
This commit is contained in:
Juliusz Sosinowicz
2020-07-10 21:03:00 +02:00
parent 728f4ce892
commit 85b1196b08
5 changed files with 103 additions and 3 deletions

View File

@@ -2081,16 +2081,43 @@ int wc_DhAgree(DhKey* key, byte* agree, word32* agreeSz, const byte* priv,
#ifdef WOLFSSL_DH_EXTRA
WOLFSSL_LOCAL int wc_DhKeyCopy(DhKey* src, DhKey* dst)
{
int ret;
if (!src || !dst || src == dst) {
WOLFSSL_MSG("Parameters not provided or are the same");
return BAD_FUNC_ARG;
}
if (mp_copy(, mpi) != MP_OKAY) {
if ((ret = mp_copy(&src->p, &dst->p)) != MP_OKAY) {
WOLFSSL_MSG("mp_copy error");
return WOLFSSL_FATAL_ERROR;
return ret;
}
if ((ret = mp_copy(&src->g, &dst->g)) != MP_OKAY) {
WOLFSSL_MSG("mp_copy error");
return ret;
}
if ((ret = mp_copy(&src->q, &dst->q)) != MP_OKAY) {
WOLFSSL_MSG("mp_copy error");
return ret;
}
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(WOLFSSL_OPENSSH)
if ((ret = mp_copy(&src->pub, &dst->pub)) != MP_OKAY) {
WOLFSSL_MSG("mp_copy error");
return ret;
}
if ((ret = mp_copy(&src->priv, &dst->priv)) != MP_OKAY) {
WOLFSSL_MSG("mp_copy error");
return ret;
}
#endif
dst->heap = src->heap;
return MP_OKAY;
}
/* Sets private and public key in DhKey if both are available, otherwise sets