Skip to content

Commit

Permalink
Add getCSTPCipher() and getDTLSCipher() methods to Java bindings
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Oct 27, 2014
1 parent 6459552 commit de759ad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions java/src/com/example/LibTest.java
Expand Up @@ -85,6 +85,7 @@ private void printChoices(FormOpt fo) {
public int onProcessAuthForm(LibOpenConnect.AuthForm authForm) {
boolean empty = true;

System.out.println("\nCSTP Cipher: " + getCSTPCipher());
System.out.println("\nAuthForm:");
System.out.println("+-banner: " + authForm.banner);
System.out.println("+-message: " + authForm.message);
Expand Down
2 changes: 2 additions & 0 deletions java/src/org/infradead/libopenconnect/LibOpenConnect.java
Expand Up @@ -141,6 +141,8 @@ public synchronized native void setMobileInfo(String mobilePlatformVersion,
public synchronized native String getCookie();
public synchronized native String getIFName();
public synchronized native IPInfo getIPInfo();
public synchronized native String getCSTPCipher();
public synchronized native String getDTLSCipher();

/* certificate info */

Expand Down
16 changes: 16 additions & 0 deletions jni.c
Expand Up @@ -1058,6 +1058,22 @@ JNIEXPORT jstring JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_getIF
RETURN_STRING_END
}

JNIEXPORT jstring JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_getDTLSCipher(
JNIEnv *jenv, jobject jobj)
{
RETURN_STRING_START
buf = openconnect_get_dtls_cipher(ctx->vpninfo);
RETURN_STRING_END
}

JNIEXPORT jstring JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_getCSTPCipher(
JNIEnv *jenv, jobject jobj)
{
RETURN_STRING_START
buf = openconnect_get_cstp_cipher(ctx->vpninfo);
RETURN_STRING_END
}

#define SET_STRING_START(ret) \
struct libctx *ctx = getctx(jenv, jobj); \
const char *arg = NULL; \
Expand Down

0 comments on commit de759ad

Please sign in to comment.