fix build with DH disabled

pull/44/head
Chris Conlon 2020-05-19 10:18:22 -06:00
parent 9b17f65c06
commit ab82cacdc4
2 changed files with 23 additions and 1 deletions

3
README
View File

@ -37,6 +37,9 @@ Release X.X.X has bug fixes and new features including:
- Consistently use wolfCrypt XMALLOC/XFREE for native memory allocation
- Use javah in build.xml for older ant/Java versions without nativeheaderdir
- Add JSSE debug logging for native wolfSSL with wolfssl.debug system parameter
- Add internal implementation of SSLParameters, WolfSSLParameters
- Add client-side SNI support
- Fix warnings when DH is disabled (--disable-dh)
The wolfSSL JNI Manual is available at:
http://www.wolfssl.com/documentation/wolfSSL-JNI-Manual.pdf. For build

View File

@ -1229,6 +1229,7 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_setTmpDH
(JNIEnv* jenv, jobject jcl, jlong ssl, jbyteArray p, jint pSz, jbyteArray g,
jint gSz)
{
#ifndef NO_DH
unsigned char pBuf[pSz];
unsigned char gBuf[gSz];
jclass excClass;
@ -1267,12 +1268,22 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_setTmpDH
}
return wolfSSL_SetTmpDH((WOLFSSL*)(uintptr_t)ssl, pBuf, pSz, gBuf, gSz);
#else
(void)jenv;
(void)jcl;
(void)ssl;
(void)p;
(void)pSz;
(void)g;
(void)gSz;
return NOT_COMPILED_IN;
#endif
}
JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_setTmpDHFile
(JNIEnv* jenv, jobject jcl, jlong ssl, jstring file, jint format)
{
#ifndef NO_DH
int ret;
const char* fname;
jclass excClass;
@ -1302,6 +1313,14 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_setTmpDHFile
(*jenv)->ReleaseStringUTFChars(jenv, file, fname);
return ret;
#else
(void)jenv;
(void)jcl;
(void)ssl;
(void)file;
(void)format;
return NOT_COMPILED_IN;
#endif
}
JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_useCertificateBuffer