Skip to content

Commit

Permalink
Add openconnect_has_pkcs11_support()
Browse files Browse the repository at this point in the history
Theoretically, the OpenSSL side can (and should) gain PKCS#11 support at
some point. There *is* a PKCS#11 engine, although it seems somewhat unloved.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 11, 2012
1 parent 455c90b commit 1a394bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions libopenconnect.map.in
Expand Up @@ -26,6 +26,7 @@ OPENCONNECT_2.0 {
openconnect_get_cert_details;
openconnect_get_cert_DER;
openconnect_init_ssl;
openconnect_has_pkcs11_support;
};

OPENCONNECT_PRIVATE {
Expand Down
9 changes: 9 additions & 0 deletions library.c
Expand Up @@ -226,3 +226,12 @@ const char *openconnect_get_version (void)
{
return openconnect_version_str;
}

int openconnect_has_pkcs11_support(void)
{
#if defined (OPENCONNECT_GNUTLS) && defined (HAVE_P11KIT)
return 1;
#else
return 0;
#endif
}
5 changes: 5 additions & 0 deletions openconnect.h
Expand Up @@ -36,6 +36,7 @@
/*
* API version 2.0:
* - OPENCONNECT_X509 is now an opaque type.
* - Add openconnect_has_pkcs11_support()
* - Rename openconnect_init_openssl() -> openconnect_init_ssl()
* - Rename openconnect_vpninfo_new_with_cbdata() -> openconnect_vpninfo_new()
* and kill the old openconnect_vpninfo_new() and its callback types.
Expand Down Expand Up @@ -232,4 +233,8 @@ struct openconnect_info *openconnect_vpninfo_new (char *useragent,
void *privdata);
void openconnect_vpninfo_free (struct openconnect_info *vpninfo);

/* SSL certificate capabilities. openconnect_has_pkcs11_support() means that we
can accept PKCS#11 URLs in place of filenames, for the certificate and key. */
int openconnect_has_pkcs11_support(void);

#endif /* __OPENCONNECT_H__ */

0 comments on commit 1a394bc

Please sign in to comment.