mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-03-07 00:54:02 +01:00
Implement/stub:
- X509_REQ_print_fp - X509_print_fp - DHparams_dup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user