Added PKCS#11 token plugin stub

This commit is contained in:
Martin Willi
2010-08-04 09:26:18 +02:00
parent f8bb082f1f
commit 6e862e2152
5 changed files with 121 additions and 0 deletions
+7
View File
@@ -314,6 +314,13 @@ if MONOLITHIC
endif
endif
if USE_PKCS11
SUBDIRS += plugins/pkcs11
if MONOLITHIC
libstrongswan_la_LIBADD += plugins/pkcs11/libstrongswan-pkcs11.la
endif
endif
if USE_TEST_VECTORS
SUBDIRS += plugins/test_vectors
if MONOLITHIC
@@ -0,0 +1,15 @@
INCLUDES = -I$(top_srcdir)/src/libstrongswan
AM_CFLAGS = -rdynamic
if MONOLITHIC
noinst_LTLIBRARIES = libstrongswan-pkcs11.la
else
plugin_LTLIBRARIES = libstrongswan-pkcs11.la
endif
libstrongswan_pkcs11_la_SOURCES = \
pkcs11_plugin.h pkcs11_plugin.c
libstrongswan_pkcs11_la_LDFLAGS = -module -avoid-version
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2010 Martin Willi
* Copyright (C) 2010 revosec AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "pkcs11_plugin.h"
#include <library.h>
typedef struct private_pkcs11_plugin_t private_pkcs11_plugin_t;
/**
* private data of pkcs11_plugin
*/
struct private_pkcs11_plugin_t {
/**
* public functions
*/
pkcs11_plugin_t public;
};
METHOD(plugin_t, destroy, void,
private_pkcs11_plugin_t *this)
{
free(this);
}
/*
* see header file
*/
plugin_t *pkcs11_plugin_create()
{
private_pkcs11_plugin_t *this;
INIT(this,
.public.plugin.destroy = _destroy,
);
return &this->public.plugin;
}
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2010 Martin Willi
* Copyright (C) 2010 revosec AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/**
* @defgroup pkcs11 pkcs11
* @ingroup plugins
*
* @defgroup pkcs11_plugin pkcs11_plugin
* @{ @ingroup pkcs11
*/
#ifndef PKCS11_PLUGIN_H_
#define PKCS11_PLUGIN_H_
#include <plugins/plugin.h>
typedef struct pkcs11_plugin_t pkcs11_plugin_t;
/**
* Plugin providing PKCS#11 token support.
*/
struct pkcs11_plugin_t {
/**
* Implements plugin interface,
*/
plugin_t plugin;
};
#endif /** PKCS11_PLUGIN_H_ @}*/