diff --git a/native/com_wolfssl_WolfSSL.c b/native/com_wolfssl_WolfSSL.c
index 235038b1..33c7dcf3 100644
--- a/native/com_wolfssl_WolfSSL.c
+++ b/native/com_wolfssl_WolfSSL.c
@@ -62,7 +62,8 @@ static int g_loggingCbMutexInit = 0;
/* Tracks one-time native registration of NativeLoggingCallback and its return
* value. We do not deregister during normal operation: wolfssl_log reads
* LogFunction without a lock, so clearing it while another thread logs would
- * crash. JNI_OnUnload deregisters it after JVM execution has ended.
+ * crash. JNI_OnUnload deregisters it when the class loader that loaded this
+ * library is garbage collected.
* Guarded by g_loggingCbMutex. */
static int g_loggingCbNativeReg = 0;
static int g_loggingCbNativeRet = 0;
diff --git a/native/com_wolfssl_WolfSSLContext.c b/native/com_wolfssl_WolfSSLContext.c
index f06912db..54d37634 100644
--- a/native/com_wolfssl_WolfSSLContext.c
+++ b/native/com_wolfssl_WolfSSLContext.c
@@ -1506,7 +1506,7 @@ int NativeIORecvCb(WOLFSSL *ssl, char *buf, int sz, void *ctx)
return WOLFSSL_CBIO_ERR_GENERAL;
}
- /* find WolfSSLContext.getAssociatedContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -1772,7 +1772,7 @@ int NativeIOSendCb(WOLFSSL *ssl, char *buf, int sz, void *ctx)
return WOLFSSL_CBIO_ERR_GENERAL;
}
- /* find WolfSSLContext.getAssociatedContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -2770,7 +2770,7 @@ int NativeMacEncryptCb(WOLFSSL* ssl, unsigned char* macOut,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr", "()Lcom/wolfssl/WolfSSLContext;");
if (!getCtxMethodId) {
@@ -3076,7 +3076,7 @@ int NativeDecryptVerifyCb(WOLFSSL* ssl, unsigned char* decOut,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr", "()Lcom/wolfssl/WolfSSLContext;");
if (!getCtxMethodId) {
@@ -3383,7 +3383,7 @@ int NativeVerifyDecryptCb(WOLFSSL* ssl, unsigned char* decOut,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr", "()Lcom/wolfssl/WolfSSLContext;");
if (!getCtxMethodId) {
@@ -3678,7 +3678,7 @@ int NativeEccSignCb(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -3998,7 +3998,7 @@ int NativeEccVerifyCb(WOLFSSL* ssl, const unsigned char* sig,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -4234,7 +4234,7 @@ static int GetWolfSSLContextFromSessionObj(JNIEnv* jenv, jobject* sessObj,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -4774,7 +4774,7 @@ int NativeRsaSignCb(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -5094,7 +5094,7 @@ int NativeRsaPssSignCb(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr", "()Lcom/wolfssl/WolfSSLContext;");
if (!getCtxMethodId) {
@@ -5420,7 +5420,7 @@ int NativeRsaVerifyCb(WOLFSSL* ssl, unsigned char* sig, unsigned int sigSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -5714,7 +5714,7 @@ int NativeRsaSignCheckCb(WOLFSSL* ssl, unsigned char* sig, unsigned int sigSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr", "()Lcom/wolfssl/WolfSSLContext;");
if (!getCtxMethodId) {
@@ -5951,7 +5951,7 @@ int NativeRsaPssSignCheckCb(WOLFSSL* ssl, unsigned char* sig,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr", "()Lcom/wolfssl/WolfSSLContext;");
if (!getCtxMethodId) {
@@ -6220,7 +6220,7 @@ int NativeRsaEncCb(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
@@ -6538,7 +6538,7 @@ int NativeRsaDecCb(WOLFSSL* ssl, unsigned char* in, unsigned int inSz,
return -1;
}
- /* find getContextPtr() method */
+ /* find WolfSSLSession.getAssociatedContextPtr() method */
getCtxMethodId = (*jenv)->GetMethodID(jenv, sessClass,
"getAssociatedContextPtr",
"()Lcom/wolfssl/WolfSSLContext;");
diff --git a/native/com_wolfssl_WolfSSLSession.c b/native/com_wolfssl_WolfSSLSession.c
index edea56d2..df427b81 100644
--- a/native/com_wolfssl_WolfSSLSession.c
+++ b/native/com_wolfssl_WolfSSLSession.c
@@ -7233,7 +7233,7 @@ int NativeSSLIOSendCb(WOLFSSL *ssl, char *buf, int sz, void *ctx)
}
if (sz >= 0) {
- /* create jbyteArray to hold received data */
+ /* create jbyteArray to hold data to send */
outData = (*jenv)->NewByteArray(jenv, sz);
if (!outData) {
throwWolfSSLJNIException(jenv,
diff --git a/src/java/com/wolfssl/WolfSSLCertificate.java b/src/java/com/wolfssl/WolfSSLCertificate.java
index d7d8db20..16338124 100644
--- a/src/java/com/wolfssl/WolfSSLCertificate.java
+++ b/src/java/com/wolfssl/WolfSSLCertificate.java
@@ -2428,7 +2428,8 @@ public int checkIpAddress(String ipAddress) throws IllegalStateException {
* A SAN entry whose value contains an embedded null byte is omitted,
* so it is never returned truncated at the null.
*
- * @return immutable Collection of subject alternative names, or null
+ * @return immutable Collection of subject alternative names, empty
+ * if the certificate has none
*
* @throws IllegalStateException if WolfSSLCertificate has been freed.
*/
diff --git a/src/java/com/wolfssl/WolfSSLContext.java b/src/java/com/wolfssl/WolfSSLContext.java
index 91d31a77..8190ccb0 100644
--- a/src/java/com/wolfssl/WolfSSLContext.java
+++ b/src/java/com/wolfssl/WolfSSLContext.java
@@ -561,9 +561,9 @@ WolfSSLDebug.INFO, getContextPtr(),
* parameter is a directory path which contains certificates of trusted
* root CAs. If the value of file is not NULL, path may be
* specified as null if not needed. If path is
- * specified, and NO_WOLFSSL_DIR is defined when building the
- * library, wolfSSL will load all CA certificates located in the given
- * directory.
+ * specified, and NO_WOLFSSL_DIR is not defined when
+ * building the library, wolfSSL will load all CA certificates located
+ * in the given directory.
*
* @param file path to the file containing PEM-formatted CA certificates
* @param path path to directory containing PEM-formatted CA certificates