security/nss/lib/ckfw/nssmkey/mslot.c

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:bc97e03ed6ff
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #include "ckmk.h"
6
7 /*
8 * nssmkey/mslot.c
9 *
10 * This file implements the NSSCKMDSlot object for the
11 * "nssmkey" cryptoki module.
12 */
13
14 static NSSUTF8 *
15 ckmk_mdSlot_GetSlotDescription
16 (
17 NSSCKMDSlot *mdSlot,
18 NSSCKFWSlot *fwSlot,
19 NSSCKMDInstance *mdInstance,
20 NSSCKFWInstance *fwInstance,
21 CK_RV *pError
22 )
23 {
24 return (NSSUTF8 *)nss_ckmk_SlotDescription;
25 }
26
27 static NSSUTF8 *
28 ckmk_mdSlot_GetManufacturerID
29 (
30 NSSCKMDSlot *mdSlot,
31 NSSCKFWSlot *fwSlot,
32 NSSCKMDInstance *mdInstance,
33 NSSCKFWInstance *fwInstance,
34 CK_RV *pError
35 )
36 {
37 return (NSSUTF8 *)nss_ckmk_ManufacturerID;
38 }
39
40 static CK_VERSION
41 ckmk_mdSlot_GetHardwareVersion
42 (
43 NSSCKMDSlot *mdSlot,
44 NSSCKFWSlot *fwSlot,
45 NSSCKMDInstance *mdInstance,
46 NSSCKFWInstance *fwInstance
47 )
48 {
49 return nss_ckmk_HardwareVersion;
50 }
51
52 static CK_VERSION
53 ckmk_mdSlot_GetFirmwareVersion
54 (
55 NSSCKMDSlot *mdSlot,
56 NSSCKFWSlot *fwSlot,
57 NSSCKMDInstance *mdInstance,
58 NSSCKFWInstance *fwInstance
59 )
60 {
61 return nss_ckmk_FirmwareVersion;
62 }
63
64 static NSSCKMDToken *
65 ckmk_mdSlot_GetToken
66 (
67 NSSCKMDSlot *mdSlot,
68 NSSCKFWSlot *fwSlot,
69 NSSCKMDInstance *mdInstance,
70 NSSCKFWInstance *fwInstance,
71 CK_RV *pError
72 )
73 {
74 return (NSSCKMDToken *)&nss_ckmk_mdToken;
75 }
76
77 NSS_IMPLEMENT_DATA const NSSCKMDSlot
78 nss_ckmk_mdSlot = {
79 (void *)NULL, /* etc */
80 NULL, /* Initialize */
81 NULL, /* Destroy */
82 ckmk_mdSlot_GetSlotDescription,
83 ckmk_mdSlot_GetManufacturerID,
84 NULL, /* GetTokenPresent -- defaults to true */
85 NULL, /* GetRemovableDevice -- defaults to false */
86 NULL, /* GetHardwareSlot -- defaults to false */
87 ckmk_mdSlot_GetHardwareVersion,
88 ckmk_mdSlot_GetFirmwareVersion,
89 ckmk_mdSlot_GetToken,
90 (void *)NULL /* null terminator */
91 };

mercurial