System.out.println("OpenConnect version: " + lib.getVersion());
System.out.println(" PKCS=" + lib.hasPKCS11Support() +
", TSS=" + lib.hasTSSBlobSupport() +
+ ", TSS2=" + lib.hasTSS2BlobSupport() +
", STOKEN=" + lib.hasStokenSupport() +
", OATH=" + lib.hasOATHSupport() +
", YUBIOATH=" + lib.hasYubiOATHSupport());
public static native String getVersion();
public static native boolean hasPKCS11Support();
public static native boolean hasTSSBlobSupport();
+ public static native boolean hasTSS2BlobSupport();
public static native boolean hasStokenSupport();
public static native boolean hasOATHSupport();
public static native boolean hasYubiOATHSupport();
return openconnect_has_tss_blob_support();
}
+JNIEXPORT jboolean JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_hasTSS2BlobSupport(
+ JNIEnv *jenv, jclass jcls)
+{
+ return openconnect_has_tss2_blob_support();
+}
+
JNIEXPORT jboolean JNICALL Java_org_infradead_libopenconnect_LibOpenConnect_hasStokenSupport(
JNIEnv *jenv, jclass jcls)
{
openconnect_get_protocol;
openconnect_get_supported_protocols;
openconnect_free_supported_protocols;
+ openconnect_has_tss2_blob_support;
} OPENCONNECT_5_4;
OPENCONNECT_PRIVATE {
return 0;
}
+int openconnect_has_tss2_blob_support(void)
+{
+#if defined(OPENCONNECT_OPENSSL) && defined(HAVE_ENGINE)
+ ENGINE *e;
+
+ ENGINE_load_builtin_engines();
+
+ e = ENGINE_by_id("tpm2");
+ if (e) {
+ ENGINE_free(e);
+ return 1;
+ }
+#elif defined(OPENCONNECT_GNUTLS) && defined(HAVE_TSS2)
+ return 1;
+#endif
+ return 0;
+}
+
int openconnect_has_stoken_support(void)
{
#ifdef HAVE_LIBSTOKEN
printf("%sTPM", sep);
sep = comma;
}
+ if (openconnect_has_tss2_blob_support()) {
+ printf("%sTPMv2", sep);
+ sep = comma;
+ }
#if defined(OPENCONNECT_OPENSSL) && defined(HAVE_ENGINE)
else {
printf("%sTPM (%s)", sep, _("OpenSSL ENGINE not present"));
/*
* API version 5.5:
+ * - Add openconnect_has_tss2_blob_support()
* - Add openconnect_get_supported_protocols()
* - Add openconnect_free_supported_protocols()
* - Add openconnect_get_protocol()
int openconnect_has_pkcs11_support(void);
/* The OpenSSL TPM ENGINE stores keys in a PEM file labelled with the string
- -----BEGIN TSS KEY BLOB-----. GnuTLS may learn to support this format too,
- in the near future. */
+ -----BEGIN TSS KEY BLOB-----. */
int openconnect_has_tss_blob_support(void);
+int openconnect_has_tss2_blob_support(void);
/* Software token capabilities. */
int openconnect_has_stoken_support(void);