From: Martin Willi Date: Fri, 6 Aug 2010 15:02:01 +0000 (+0200) Subject: Export scheme_to_mechanism conversion function X-Git-Tag: 4.5.0~562 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=babed73257925703b7818875d176cbda5bf28f00;p=thirdparty%2Fstrongswan.git Export scheme_to_mechanism conversion function --- diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c b/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c index 1909988a88..80c0f00d4f 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c @@ -87,9 +87,9 @@ METHOD(private_key_t, get_keysize, size_t, } /** - * Get the Cryptoki mechanism for a signature scheme + * See header. */ -static CK_MECHANISM_PTR scheme_to_mechanism(signature_scheme_t scheme) +CK_MECHANISM_PTR pkcs11_scheme_to_mechanism(signature_scheme_t scheme) { static struct { signature_scheme_t scheme; @@ -159,7 +159,7 @@ METHOD(private_key_t, sign, bool, CK_ULONG len; CK_RV rv; - mechanism = scheme_to_mechanism(scheme); + mechanism = pkcs11_scheme_to_mechanism(scheme); if (!mechanism) { DBG1(DBG_LIB, "signature scheme %N not supported", diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.h b/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.h index 86b04b70a9..921a027320 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.h +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.h @@ -26,6 +26,8 @@ typedef struct pkcs11_private_key_t pkcs11_private_key_t; #include #include +#include "pkcs11.h" + /** * Private Key implementation on top of PKCS#11. */ @@ -48,4 +50,9 @@ struct pkcs11_private_key_t { */ pkcs11_private_key_t *pkcs11_private_key_connect(key_type_t type, va_list args); +/** + * Get the Cryptoki mechanism for a signature scheme. + */ +CK_MECHANISM_PTR pkcs11_scheme_to_mechanism(signature_scheme_t scheme); + #endif /** PKCS11_PRIVATE_KEY_H_ @}*/