renamed med_db plugin to medsrv, as we will introduce an additional medcli client plugin

This commit is contained in:
Martin Willi
2008-05-08 12:11:30 +00:00
parent 25b12c696b
commit 5b7ec6d4e0
14 changed files with 117 additions and 117 deletions
+5 -5
View File
@@ -304,10 +304,10 @@ AC_ARG_ENABLE(
) )
AC_ARG_ENABLE( AC_ARG_ENABLE(
[med-db], [medsrv],
AS_HELP_STRING([--enable-med-db],[enable MySQL mediation database plugin (default is NO).]), AS_HELP_STRING([--enable-medsrv],[enable mediation server configuration database plugin (default is NO).]),
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
med_db=true medsrv=true
fi] fi]
) )
@@ -665,7 +665,7 @@ AM_CONDITIONAL(USE_XCBC, test x$xcbc = xtrue)
AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue) AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue) AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue) AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
AM_CONDITIONAL(USE_MED_DB, test x$med_db = xtrue) AM_CONDITIONAL(USE_MEDSRV, test x$medsrv = xtrue)
AM_CONDITIONAL(USE_SMP, test x$smp = xtrue) AM_CONDITIONAL(USE_SMP, test x$smp = xtrue)
AM_CONDITIONAL(USE_SQL, test x$sql = xtrue) AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)
AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue) AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
@@ -739,7 +739,7 @@ AC_OUTPUT(
src/charon/plugins/eap_sim/Makefile src/charon/plugins/eap_sim/Makefile
src/charon/plugins/smp/Makefile src/charon/plugins/smp/Makefile
src/charon/plugins/sql/Makefile src/charon/plugins/sql/Makefile
src/charon/plugins/med_db/Makefile src/charon/plugins/medsrv/Makefile
src/charon/plugins/stroke/Makefile src/charon/plugins/stroke/Makefile
src/charon/plugins/unit_tester/Makefile src/charon/plugins/unit_tester/Makefile
src/stroke/Makefile src/stroke/Makefile
+2 -2
View File
@@ -162,7 +162,7 @@ if USE_EAP_AKA
SUBDIRS += plugins/eap_aka SUBDIRS += plugins/eap_aka
endif endif
if USE_MED_DB if USE_MEDSRV
SUBDIRS += plugins/med_db SUBDIRS += plugins/medsrv
endif endif
-12
View File
@@ -1,12 +0,0 @@
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-med-db.la
libcharon_med_db_la_SOURCES = med_db_plugin.h med_db_plugin.c \
med_db_creds.h med_db_creds.c \
med_db_config.h med_db_config.c \
med_db_pubkey.h med_db_pubkey.c
libcharon_med_db_la_LDFLAGS = -module
+12
View File
@@ -0,0 +1,12 @@
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-medsrv.la
libcharon_medsrv_la_SOURCES = medsrv_plugin.h medsrv_plugin.c \
medsrv_creds.h medsrv_creds.c \
medsrv_config.h medsrv_config.c \
medsrv_pubkey.h medsrv_pubkey.c
libcharon_medsrv_la_LDFLAGS = -module
@@ -17,21 +17,21 @@
#include <string.h> #include <string.h>
#include "med_db_config.h" #include "medsrv_config.h"
#include <daemon.h> #include <daemon.h>
typedef struct private_med_db_config_t private_med_db_config_t; typedef struct private_medsrv_config_t private_medsrv_config_t;
/** /**
* Private data of an med_db_config_t object * Private data of an medsrv_config_t object
*/ */
struct private_med_db_config_t { struct private_medsrv_config_t {
/** /**
* Public part * Public part
*/ */
med_db_config_t public; medsrv_config_t public;
/** /**
* database connection * database connection
@@ -57,7 +57,7 @@ struct private_med_db_config_t {
/** /**
* implements backend_t.get_peer_cfg_by_name. * implements backend_t.get_peer_cfg_by_name.
*/ */
static peer_cfg_t *get_peer_cfg_by_name(private_med_db_config_t *this, char *name) static peer_cfg_t *get_peer_cfg_by_name(private_medsrv_config_t *this, char *name)
{ {
return NULL; return NULL;
} }
@@ -65,7 +65,7 @@ static peer_cfg_t *get_peer_cfg_by_name(private_med_db_config_t *this, char *nam
/** /**
* Implementation of backend_t.create_ike_cfg_enumerator. * Implementation of backend_t.create_ike_cfg_enumerator.
*/ */
static enumerator_t* create_ike_cfg_enumerator(private_med_db_config_t *this, static enumerator_t* create_ike_cfg_enumerator(private_medsrv_config_t *this,
host_t *me, host_t *other) host_t *me, host_t *other)
{ {
return enumerator_create_single(this->ike, NULL); return enumerator_create_single(this->ike, NULL);
@@ -74,7 +74,7 @@ static enumerator_t* create_ike_cfg_enumerator(private_med_db_config_t *this,
/** /**
* Implementation of backend_t.create_peer_cfg_enumerator. * Implementation of backend_t.create_peer_cfg_enumerator.
*/ */
static enumerator_t* create_peer_cfg_enumerator(private_med_db_config_t *this, static enumerator_t* create_peer_cfg_enumerator(private_medsrv_config_t *this,
identification_t *me, identification_t *me,
identification_t *other) identification_t *other)
{ {
@@ -115,9 +115,9 @@ static enumerator_t* create_peer_cfg_enumerator(private_med_db_config_t *this,
} }
/** /**
* Implementation of med_db_config_t.destroy. * Implementation of medsrv_config_t.destroy.
*/ */
static void destroy(private_med_db_config_t *this) static void destroy(private_medsrv_config_t *this)
{ {
this->ike->destroy(this->ike); this->ike->destroy(this->ike);
free(this); free(this);
@@ -126,14 +126,14 @@ static void destroy(private_med_db_config_t *this)
/** /**
* Described in header. * Described in header.
*/ */
med_db_config_t *med_db_config_create(database_t *db) medsrv_config_t *medsrv_config_create(database_t *db)
{ {
private_med_db_config_t *this = malloc_thing(private_med_db_config_t); private_medsrv_config_t *this = malloc_thing(private_medsrv_config_t);
this->public.backend.create_peer_cfg_enumerator = (enumerator_t*(*)(backend_t*, identification_t *me, identification_t *other))create_peer_cfg_enumerator; this->public.backend.create_peer_cfg_enumerator = (enumerator_t*(*)(backend_t*, identification_t *me, identification_t *other))create_peer_cfg_enumerator;
this->public.backend.create_ike_cfg_enumerator = (enumerator_t*(*)(backend_t*, host_t *me, host_t *other))create_ike_cfg_enumerator; this->public.backend.create_ike_cfg_enumerator = (enumerator_t*(*)(backend_t*, host_t *me, host_t *other))create_ike_cfg_enumerator;
this->public.backend.get_peer_cfg_by_name = (peer_cfg_t* (*)(backend_t*,char*))get_peer_cfg_by_name; this->public.backend.get_peer_cfg_by_name = (peer_cfg_t* (*)(backend_t*,char*))get_peer_cfg_by_name;
this->public.destroy = (void(*)(med_db_config_t*))destroy; this->public.destroy = (void(*)(medsrv_config_t*))destroy;
this->db = db; this->db = db;
this->rekey = lib->settings->get_int(lib->settings, this->rekey = lib->settings->get_int(lib->settings,
@@ -16,22 +16,22 @@
*/ */
/** /**
* @defgroup med_db_config_i med_db_config * @defgroup medsrv_config_i medsrv_config
* @{ @ingroup med_db * @{ @ingroup medsrv
*/ */
#ifndef MED_DB_CONFIG_H_ #ifndef MEDSRV_CONFIG_H_
#define MED_DB_CONFIG_H_ #define MEDSRV_CONFIG_H_
#include <config/backend.h> #include <config/backend.h>
#include <database/database.h> #include <database/database.h>
typedef struct med_db_config_t med_db_config_t; typedef struct medsrv_config_t medsrv_config_t;
/** /**
* Mediation server configuration backend. * Mediation server configuration backend.
*/ */
struct med_db_config_t { struct medsrv_config_t {
/** /**
* Implements backend_t interface * Implements backend_t interface
@@ -41,15 +41,15 @@ struct med_db_config_t {
/** /**
* Destroy the backend. * Destroy the backend.
*/ */
void (*destroy)(med_db_config_t *this); void (*destroy)(medsrv_config_t *this);
}; };
/** /**
* Create a med_db_config backend instance. * Create a medsrv_config backend instance.
* *
* @param db underlying database * @param db underlying database
* @return backend instance * @return backend instance
*/ */
med_db_config_t *med_db_config_create(database_t *db); medsrv_config_t *medsrv_config_create(database_t *db);
#endif /* MED_DB_CONFIG_H_ @}*/ #endif /* MEDSRV_CONFIG_H_ @}*/
@@ -15,24 +15,24 @@
* $Id$ * $Id$
*/ */
#include "med_db_creds.h" #include "medsrv_creds.h"
#include "med_db_pubkey.h" #include "medsrv_pubkey.h"
#include <daemon.h> #include <daemon.h>
#include <library.h> #include <library.h>
#include <utils/enumerator.h> #include <utils/enumerator.h>
typedef struct private_med_db_creds_t private_med_db_creds_t; typedef struct private_medsrv_creds_t private_medsrv_creds_t;
/** /**
* Private data of an med_db_creds_t object * Private data of an medsrv_creds_t object
*/ */
struct private_med_db_creds_t { struct private_medsrv_creds_t {
/** /**
* Public part * Public part
*/ */
med_db_creds_t public; medsrv_creds_t public;
/** /**
* underlying database handle * underlying database handle
@@ -73,7 +73,7 @@ static bool cert_enumerator_enumerate(cert_enumerator_t *this,
{ {
if (this->type == KEY_ANY || this->type == public->get_type(public)) if (this->type == KEY_ANY || this->type == public->get_type(public))
{ {
*cert = this->current = (certificate_t*)med_db_pubkey_create(public); *cert = this->current = (certificate_t*)medsrv_pubkey_create(public);
return TRUE; return TRUE;
} }
public->destroy(public); public->destroy(public);
@@ -96,7 +96,7 @@ static void cert_enumerator_destroy(cert_enumerator_t *this)
/** /**
* Implementation of credential_set_t.create_cert_enumerator. * Implementation of credential_set_t.create_cert_enumerator.
*/ */
static enumerator_t* create_cert_enumerator(private_med_db_creds_t *this, static enumerator_t* create_cert_enumerator(private_medsrv_creds_t *this,
certificate_type_t cert, key_type_t key, certificate_type_t cert, key_type_t key,
identification_t *id, bool trusted) identification_t *id, bool trusted)
{ {
@@ -128,7 +128,7 @@ static enumerator_t* create_cert_enumerator(private_med_db_creds_t *this,
/** /**
* Implementation of backend_t.destroy. * Implementation of backend_t.destroy.
*/ */
static void destroy(private_med_db_creds_t *this) static void destroy(private_medsrv_creds_t *this)
{ {
free(this); free(this);
} }
@@ -136,9 +136,9 @@ static void destroy(private_med_db_creds_t *this)
/** /**
* Described in header. * Described in header.
*/ */
med_db_creds_t *med_db_creds_create(database_t *db) medsrv_creds_t *medsrv_creds_create(database_t *db)
{ {
private_med_db_creds_t *this = malloc_thing(private_med_db_creds_t); private_medsrv_creds_t *this = malloc_thing(private_medsrv_creds_t);
this->public.set.create_private_enumerator = (void*)return_null; this->public.set.create_private_enumerator = (void*)return_null;
this->public.set.create_cert_enumerator = (void*)create_cert_enumerator; this->public.set.create_cert_enumerator = (void*)create_cert_enumerator;
@@ -146,7 +146,7 @@ med_db_creds_t *med_db_creds_create(database_t *db)
this->public.set.create_cdp_enumerator = (void*)return_null; this->public.set.create_cdp_enumerator = (void*)return_null;
this->public.set.cache_cert = (void*)nop; this->public.set.cache_cert = (void*)nop;
this->public.destroy = (void (*)(med_db_creds_t*))destroy; this->public.destroy = (void (*)(medsrv_creds_t*))destroy;
this->db = db; this->db = db;
@@ -16,22 +16,22 @@
*/ */
/** /**
* @defgroup med_db_creds_i med_db_creds * @defgroup medsrv_creds_i medsrv_creds
* @{ @ingroup med_db * @{ @ingroup medsrv
*/ */
#ifndef MED_DB_CREDS_H_ #ifndef MEDSRV_CREDS_H_
#define MED_DB_CREDS_H_ #define MEDSRV_CREDS_H_
#include <credentials/credential_set.h> #include <credentials/credential_set.h>
#include <database/database.h> #include <database/database.h>
typedef struct med_db_creds_t med_db_creds_t; typedef struct medsrv_creds_t medsrv_creds_t;
/** /**
* Mediation credentials database. * Mediation credentials database.
*/ */
struct med_db_creds_t { struct medsrv_creds_t {
/** /**
* Implements credential_set_t interface * Implements credential_set_t interface
@@ -41,15 +41,15 @@ struct med_db_creds_t {
/** /**
* Destroy the credentials databse. * Destroy the credentials databse.
*/ */
void (*destroy)(med_db_creds_t *this); void (*destroy)(medsrv_creds_t *this);
}; };
/** /**
* Create the med_db credentials db. * Create the medsrv credentials db.
* *
* @param database underlying database * @param database underlying database
* @return credential set implementation on that database * @return credential set implementation on that database
*/ */
med_db_creds_t *med_db_creds_create(database_t *database); medsrv_creds_t *medsrv_creds_create(database_t *database);
#endif /* MED_DB_CREDS_H_ @}*/ #endif /* MEDSRV_CREDS_H_ @}*/
@@ -15,24 +15,24 @@
* $Id$ * $Id$
*/ */
#include "med_db_plugin.h" #include "medsrv_plugin.h"
#include "med_db_creds.h" #include "medsrv_creds.h"
#include "med_db_config.h" #include "medsrv_config.h"
#include <daemon.h> #include <daemon.h>
typedef struct private_med_db_plugin_t private_med_db_plugin_t; typedef struct private_medsrv_plugin_t private_medsrv_plugin_t;
/** /**
* private data of med_db plugin * private data of medsrv plugin
*/ */
struct private_med_db_plugin_t { struct private_medsrv_plugin_t {
/** /**
* implements plugin interface * implements plugin interface
*/ */
med_db_plugin_t public; medsrv_plugin_t public;
/** /**
* database connection instance * database connection instance
@@ -40,20 +40,20 @@ struct private_med_db_plugin_t {
database_t *db; database_t *db;
/** /**
* med_db credential set instance * medsrv credential set instance
*/ */
med_db_creds_t *creds; medsrv_creds_t *creds;
/** /**
* med_db config database * medsrv config database
*/ */
med_db_config_t *config; medsrv_config_t *config;
}; };
/** /**
* Implementation of plugin_t.destroy * Implementation of plugin_t.destroy
*/ */
static void destroy(private_med_db_plugin_t *this) static void destroy(private_medsrv_plugin_t *this)
{ {
charon->backends->remove_backend(charon->backends, &this->config->backend); charon->backends->remove_backend(charon->backends, &this->config->backend);
charon->credentials->remove_set(charon->credentials, &this->creds->set); charon->credentials->remove_set(charon->credentials, &this->creds->set);
@@ -69,7 +69,7 @@ static void destroy(private_med_db_plugin_t *this)
plugin_t *plugin_create() plugin_t *plugin_create()
{ {
char *uri; char *uri;
private_med_db_plugin_t *this = malloc_thing(private_med_db_plugin_t); private_medsrv_plugin_t *this = malloc_thing(private_medsrv_plugin_t);
this->public.plugin.destroy = (void(*)(plugin_t*))destroy; this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
@@ -90,8 +90,8 @@ plugin_t *plugin_create()
return NULL; return NULL;
} }
this->creds = med_db_creds_create(this->db); this->creds = medsrv_creds_create(this->db);
this->config = med_db_config_create(this->db); this->config = medsrv_config_create(this->db);
charon->credentials->add_set(charon->credentials, &this->creds->set); charon->credentials->add_set(charon->credentials, &this->creds->set);
charon->backends->add_backend(charon->backends, &this->config->backend); charon->backends->add_backend(charon->backends, &this->config->backend);
@@ -16,24 +16,24 @@
*/ */
/** /**
* @defgroup med_db med_db * @defgroup medsrv medsrv
* @ingroup cplugins * @ingroup cplugins
* *
* @defgroup med_db_plugin med_db_plugin * @defgroup medsrv_plugin medsrv_plugin
* @{ @ingroup med_db * @{ @ingroup medsrv
*/ */
#ifndef MED_DB_PLUGIN_H_ #ifndef MEDSRV_PLUGIN_H_
#define MED_DB_PLUGIN_H_ #define MEDSRV_PLUGIN_H_
#include <plugins/plugin.h> #include <plugins/plugin.h>
typedef struct med_db_plugin_t med_db_plugin_t; typedef struct medsrv_plugin_t medsrv_plugin_t;
/** /**
* Mediation server database plugin. * Mediation server database plugin.
*/ */
struct med_db_plugin_t { struct medsrv_plugin_t {
/** /**
* implements plugin interface * implements plugin interface
@@ -42,8 +42,8 @@ struct med_db_plugin_t {
}; };
/** /**
* Create a med_db_plugin instance. * Create a medsrv_plugin instance.
*/ */
plugin_t *plugin_create(); plugin_t *plugin_create();
#endif /* MED_DB_PLUGIN_H_ @}*/ #endif /* MEDSRV_PLUGIN_H_ @}*/
@@ -15,19 +15,19 @@
* $Id$ * $Id$
*/ */
#include "med_db_pubkey.h" #include "medsrv_pubkey.h"
typedef struct private_med_db_pubkey_t private_med_db_pubkey_t; typedef struct private_medsrv_pubkey_t private_medsrv_pubkey_t;
/** /**
* private data of med_db_pubkey * private data of medsrv_pubkey
*/ */
struct private_med_db_pubkey_t { struct private_medsrv_pubkey_t {
/** /**
* public functions * public functions
*/ */
med_db_pubkey_t public; medsrv_pubkey_t public;
/** /**
* wrapped public key * wrapped public key
@@ -48,7 +48,7 @@ struct private_med_db_pubkey_t {
/** /**
* Implementation of certificate_t.get_type * Implementation of certificate_t.get_type
*/ */
static certificate_type_t get_type(private_med_db_pubkey_t *this) static certificate_type_t get_type(private_medsrv_pubkey_t *this)
{ {
return CERT_TRUSTED_PUBKEY; return CERT_TRUSTED_PUBKEY;
} }
@@ -56,7 +56,7 @@ static certificate_type_t get_type(private_med_db_pubkey_t *this)
/** /**
* Implementation of certificate_t.get_subject * Implementation of certificate_t.get_subject
*/ */
static identification_t* get_subject(private_med_db_pubkey_t *this) static identification_t* get_subject(private_medsrv_pubkey_t *this)
{ {
return this->key->get_id(this->key, ID_PUBKEY_SHA1); return this->key->get_id(this->key, ID_PUBKEY_SHA1);
} }
@@ -64,7 +64,7 @@ static identification_t* get_subject(private_med_db_pubkey_t *this)
/** /**
* Implementation of certificate_t.get_issuer * Implementation of certificate_t.get_issuer
*/ */
static identification_t* get_issuer(private_med_db_pubkey_t *this) static identification_t* get_issuer(private_medsrv_pubkey_t *this)
{ {
return this->issuer; return this->issuer;
} }
@@ -72,7 +72,7 @@ static identification_t* get_issuer(private_med_db_pubkey_t *this)
/** /**
* Implementation of certificate_t.has_subject. * Implementation of certificate_t.has_subject.
*/ */
static id_match_t has_subject(private_med_db_pubkey_t *this, static id_match_t has_subject(private_medsrv_pubkey_t *this,
identification_t *subject) identification_t *subject)
{ {
identification_t *id; identification_t *id;
@@ -88,7 +88,7 @@ static id_match_t has_subject(private_med_db_pubkey_t *this,
/** /**
* Implementation of certificate_t.has_subject. * Implementation of certificate_t.has_subject.
*/ */
static id_match_t has_issuer(private_med_db_pubkey_t *this, static id_match_t has_issuer(private_medsrv_pubkey_t *this,
identification_t *issuer) identification_t *issuer)
{ {
return ID_MATCH_NONE; return ID_MATCH_NONE;
@@ -97,9 +97,9 @@ static id_match_t has_issuer(private_med_db_pubkey_t *this,
/** /**
* Implementation of certificate_t.equals. * Implementation of certificate_t.equals.
*/ */
static bool equals(private_med_db_pubkey_t *this, certificate_t *other) static bool equals(private_medsrv_pubkey_t *this, certificate_t *other)
{ {
if (this == (private_med_db_pubkey_t*)other) if (this == (private_medsrv_pubkey_t*)other)
{ {
return TRUE; return TRUE;
} }
@@ -113,7 +113,7 @@ static bool equals(private_med_db_pubkey_t *this, certificate_t *other)
/** /**
* Implementation of certificate_t.issued_by * Implementation of certificate_t.issued_by
*/ */
static bool issued_by(private_med_db_pubkey_t *this, certificate_t *issuer) static bool issued_by(private_medsrv_pubkey_t *this, certificate_t *issuer)
{ {
return equals(this, issuer); return equals(this, issuer);
} }
@@ -121,7 +121,7 @@ static bool issued_by(private_med_db_pubkey_t *this, certificate_t *issuer)
/** /**
* Implementation of certificate_t.get_public_key * Implementation of certificate_t.get_public_key
*/ */
static public_key_t* get_public_key(private_med_db_pubkey_t *this) static public_key_t* get_public_key(private_medsrv_pubkey_t *this)
{ {
this->key->get_ref(this->key); this->key->get_ref(this->key);
return this->key; return this->key;
@@ -129,7 +129,7 @@ static public_key_t* get_public_key(private_med_db_pubkey_t *this)
/** /**
* Implementation of certificate_t.get_validity. * Implementation of certificate_t.get_validity.
*/ */
static bool get_validity(private_med_db_pubkey_t *this, time_t *when, static bool get_validity(private_medsrv_pubkey_t *this, time_t *when,
time_t *not_before, time_t *not_after) time_t *not_before, time_t *not_after)
{ {
if (not_before) if (not_before)
@@ -154,7 +154,7 @@ static bool is_newer(certificate_t *this, certificate_t *that)
/** /**
* Implementation of certificate_t.get_encoding. * Implementation of certificate_t.get_encoding.
*/ */
static chunk_t get_encoding(private_med_db_pubkey_t *this) static chunk_t get_encoding(private_medsrv_pubkey_t *this)
{ {
return this->key->get_encoding(this->key); return this->key->get_encoding(this->key);
} }
@@ -162,16 +162,16 @@ static chunk_t get_encoding(private_med_db_pubkey_t *this)
/** /**
* Implementation of certificate_t.get_ref * Implementation of certificate_t.get_ref
*/ */
static private_med_db_pubkey_t* get_ref(private_med_db_pubkey_t *this) static private_medsrv_pubkey_t* get_ref(private_medsrv_pubkey_t *this)
{ {
ref_get(&this->ref); ref_get(&this->ref);
return this; return this;
} }
/** /**
* Implementation of med_db_pubkey_t.destroy * Implementation of medsrv_pubkey_t.destroy
*/ */
static void destroy(private_med_db_pubkey_t *this) static void destroy(private_medsrv_pubkey_t *this)
{ {
if (ref_put(&this->ref)) if (ref_put(&this->ref))
{ {
@@ -184,9 +184,9 @@ static void destroy(private_med_db_pubkey_t *this)
/* /*
* see header file * see header file
*/ */
med_db_pubkey_t *med_db_pubkey_create(public_key_t *key) medsrv_pubkey_t *medsrv_pubkey_create(public_key_t *key)
{ {
private_med_db_pubkey_t *this = malloc_thing(private_med_db_pubkey_t); private_medsrv_pubkey_t *this = malloc_thing(private_medsrv_pubkey_t);
this->public.interface.get_type = (certificate_type_t (*)(certificate_t *this))get_type; this->public.interface.get_type = (certificate_type_t (*)(certificate_t *this))get_type;
this->public.interface.get_subject = (identification_t* (*)(certificate_t *this))get_subject; this->public.interface.get_subject = (identification_t* (*)(certificate_t *this))get_subject;
@@ -16,22 +16,22 @@
*/ */
/** /**
* @defgroup med_db_pubkey med_db_pubkey * @defgroup medsrv_pubkey medsrv_pubkey
* @{ @ingroup med_db * @{ @ingroup medsrv
*/ */
#ifndef MED_DB_PUBKEY_H_ #ifndef MEDSRV_PUBKEY_H_
#define MED_DB_PUBKEY_H_ #define MEDSRV_PUBKEY_H_
#include <credentials/keys/public_key.h> #include <credentials/keys/public_key.h>
#include <credentials/certificates/certificate.h> #include <credentials/certificates/certificate.h>
typedef struct med_db_pubkey_t med_db_pubkey_t; typedef struct medsrv_pubkey_t medsrv_pubkey_t;
/** /**
* A trusted public key wrapped into certificate of type CERT_TRUSTED_PUBKEY. * A trusted public key wrapped into certificate of type CERT_TRUSTED_PUBKEY.
*/ */
struct med_db_pubkey_t { struct medsrv_pubkey_t {
/** /**
* Implements certificate_t. * Implements certificate_t.
@@ -47,6 +47,6 @@ struct med_db_pubkey_t {
* @param key public key to wrap * @param key public key to wrap
* @return public key implementing certificate interface * @return public key implementing certificate interface
*/ */
med_db_pubkey_t *med_db_pubkey_create(public_key_t *key); medsrv_pubkey_t *medsrv_pubkey_create(public_key_t *key);
#endif /* MED_DB_PUBKEY_H_ @}*/ #endif /* MEDSRV_PUBKEY_H_ @}*/