Skip to content

Commit

Permalink
Added openconnect_set_pfs() and its JNI counterpart
Browse files Browse the repository at this point in the history
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
  • Loading branch information
Nikos Mavrogiannopoulos authored and nmav committed Feb 3, 2014
1 parent e022089 commit da76a38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jni.c
Expand Up @@ -858,6 +858,16 @@ JNIEXPORT void JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_setCertE
openconnect_set_cert_expiry_warning(ctx->vpninfo, arg);
}

JNIEXPORT void JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_setPFS(
JNIEnv *jenv, jobject jobj, jint arg)
{
struct libctx *ctx = getctx(jenv, jobj);

if (!ctx)
return;
openconnect_set_pfs(ctx->vpninfo, arg);
}

JNIEXPORT jint JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_makeCSTPConnection(
JNIEnv *jenv, jobject jobj)
{
Expand Down
6 changes: 6 additions & 0 deletions library.c
Expand Up @@ -362,6 +362,12 @@ void openconnect_set_cert_expiry_warning(struct openconnect_info *vpninfo,
vpninfo->cert_expire_warning = seconds;
}

void openconnect_set_pfs(struct openconnect_info *vpninfo,
unsigned val)
{
vpninfo->pfs = val;
}

void openconnect_set_cancel_fd(struct openconnect_info *vpninfo, int fd)
{
vpninfo->cmd_fd = fd;
Expand Down
1 change: 1 addition & 0 deletions openconnect.h
Expand Up @@ -308,6 +308,7 @@ void openconnect_reset_ssl(struct openconnect_info *vpninfo);
int openconnect_parse_url(struct openconnect_info *vpninfo, char *url);
void openconnect_set_cert_expiry_warning(struct openconnect_info *vpninfo,
int seconds);
void openconnect_set_pfs(struct openconnect_info *vpninfo, unsigned val);

/* If this is set, then openconnect_obtain_cookie() will abort and return
failure if the file descriptor is readable. Typically a user may create
Expand Down

0 comments on commit da76a38

Please sign in to comment.