]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Added a getter for the library alias
authorMartin Willi <martin@revosec.ch>
Wed, 14 Jul 2010 10:32:40 +0000 (12:32 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Aug 2010 07:26:19 +0000 (09:26 +0200)
src/libstrongswan/plugins/pkcs11/pkcs11_library.c
src/libstrongswan/plugins/pkcs11/pkcs11_library.h

index 6701494e17813aad742ea2178b92408621be05b8..adafa17bba03f02d5b583fdee7d9d1526c88d4e0 100644 (file)
@@ -186,8 +186,19 @@ struct private_pkcs11_library_t {
         * dlopen() handle
         */
        void *handle;
+
+       /**
+        * Name as passed to the constructor
+        */
+       char *name;
 };
 
+METHOD(pkcs11_library_t, get_name, char*,
+       private_pkcs11_library_t *this)
+{
+       return this->name;
+}
+
 METHOD(pkcs11_library_t, destroy, void,
        private_pkcs11_library_t *this)
 {
@@ -334,8 +345,10 @@ pkcs11_library_t *pkcs11_library_create(char *name, char *file)
 
        INIT(this,
                .public = {
+                       .get_name = _get_name,
                        .destroy = _destroy,
                },
+               .name = name,
                .handle = dlopen(file, RTLD_LAZY),
        );
 
index 4ca9e05b5487f8d46d40988ded079e969b972bb1..c24929ae0ddc4040d63efb632b507f501c5fb0b1 100644 (file)
@@ -37,6 +37,13 @@ struct pkcs11_library_t {
         */
        CK_FUNCTION_LIST_PTR f;
 
+       /**
+        * Get the name this instance was created with.
+        *
+        * @return              name, as passed to constructor
+        */
+       char* (*get_name)(pkcs11_library_t *this);
+
        /**
         * Destroy a pkcs11_library_t.
         */