| 1 |
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
| 2 |
/* gkm-ssh-standalone.h - The SSH PKCS#11 code as a standalone module |
| 3 |
|
| 4 |
Copyright (C) 2008, Stef Walter |
| 5 |
|
| 6 |
The Gnome Keyring Library is free software; you can redistribute it and/or |
| 7 |
modify it under the terms of the GNU Library General Public License as |
| 8 |
published by the Free Software Foundation; either version 2 of the |
| 9 |
License, or (at your option) any later version. |
| 10 |
|
| 11 |
The Gnome Keyring Library is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
Library General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU Library General Public |
| 17 |
License along with the Gnome Library; see the file COPYING.LIB. If not, |
| 18 |
<http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
Author: Stef Walter <[email protected]> |
| 21 |
*/ |
| 22 |
|
| 23 |
#include "config.h" |
| 24 |
|
| 25 |
#include "gkm-ssh-store.h" |
| 26 |
|
| 27 |
#include "gkm/gkm-crypto.h" |
| 28 |
|
| 29 |
#include "egg/egg-secure-memory.h" |
| 30 |
|
| 31 |
#include "pkcs11/pkcs11.h" |
| 32 |
|
| 33 |
#include <glib-object.h> |
| 34 |
#include <gmodule.h> |
| 35 |
|
| 36 |
/* Module callbacks for secure memory */ |
| 37 |
EGG_SECURE_DEFINE_GLIB_GLOBALS (); |
| 38 |
|
| 39 |
const gchar* g_module_check_init (GModule *module); |
| 40 |
|
| 41 |
const gchar* |
| 42 |
g_module_check_init (GModule *module) |
| 43 |
{ |
| 44 |
/* |
| 45 |
* We can't handle being unloaded due to the gobject |
| 46 |
* types we register |
| 47 |
*/ |
| 48 |
|
| 49 |
g_module_make_resident (module); |
| 50 |
return NULL; |
| 51 |
} |
| 52 |
|
| 53 |
CK_RV |
| 54 |
C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) |
| 55 |
{ |
| 56 |
if (!list) |
| 57 |
return CKR_ARGUMENTS_BAD; |
| 58 |
|
| 59 |
#if !GLIB_CHECK_VERSION(2,35,0) |
| 60 |
g_type_init (); |
| 61 |
#endif |
| 62 |
|
| 63 |
*list = gkm_ssh_store_get_functions (); |
| 64 |
return CKR_OK; |
| 65 |
} |