no priv or pub in dhKey struct in FIPS

This commit is contained in:
kaleb-himes
2020-06-01 17:36:27 -06:00
parent bc02f2c74e
commit 0604e7d208

View File

@ -4411,7 +4411,10 @@ int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz)
return ASN_PARSE_E;
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
#if !defined(HAVE_FIPS) || \
( defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2) )
temp = *inOutIdx;
#endif /* !HAVE_FIPS || HAVE_FIPS_VERSION > 2 */
#endif
/* Assume input started after 1.2.840.113549.1.3.1 dhKeyAgreement */
@ -4421,6 +4424,8 @@ int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz)
}
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
#if !defined(HAVE_FIPS) || \
( defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2) )
/* If ASN_DH_KEY_E: Check if input started at beginning of key */
if (ret == ASN_DH_KEY_E) {
/* rewind back to after the first sequence */
@ -4465,6 +4470,7 @@ int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz)
ret = 0;
}
}
#endif /* !HAVE_FIPS || HAVE_FIPS_VERSION > 2 */
#endif /* WOLFSSL_QT || OPENSSL_ALL */
WOLFSSL_MSG("wc_DhKeyDecode Success");