comparison nss/lib/ckfw/builtins/btoken.c @ 0:1e5118fa0cb1

This is NSS with a Cmake Buildsyste To compile a static NSS library for Windows we've used the Chromium-NSS fork and added a Cmake buildsystem to compile it statically for Windows. See README.chromium for chromium changes and README.trustbridge for our modifications.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 28 Jul 2014 10:47:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e5118fa0cb1
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 "builtins.h"
6
7 /*
8 * builtins/token.c
9 *
10 * This file implements the NSSCKMDToken object for the
11 * "builtin objects" cryptoki module.
12 */
13
14 static NSSUTF8 *
15 builtins_mdToken_GetLabel
16 (
17 NSSCKMDToken *mdToken,
18 NSSCKFWToken *fwToken,
19 NSSCKMDInstance *mdInstance,
20 NSSCKFWInstance *fwInstance,
21 CK_RV *pError
22 )
23 {
24 return (NSSUTF8 *)nss_builtins_TokenLabel;
25 }
26
27 static NSSUTF8 *
28 builtins_mdToken_GetManufacturerID
29 (
30 NSSCKMDToken *mdToken,
31 NSSCKFWToken *fwToken,
32 NSSCKMDInstance *mdInstance,
33 NSSCKFWInstance *fwInstance,
34 CK_RV *pError
35 )
36 {
37 return (NSSUTF8 *)nss_builtins_ManufacturerID;
38 }
39
40 static NSSUTF8 *
41 builtins_mdToken_GetModel
42 (
43 NSSCKMDToken *mdToken,
44 NSSCKFWToken *fwToken,
45 NSSCKMDInstance *mdInstance,
46 NSSCKFWInstance *fwInstance,
47 CK_RV *pError
48 )
49 {
50 return (NSSUTF8 *)nss_builtins_TokenModel;
51 }
52
53 static NSSUTF8 *
54 builtins_mdToken_GetSerialNumber
55 (
56 NSSCKMDToken *mdToken,
57 NSSCKFWToken *fwToken,
58 NSSCKMDInstance *mdInstance,
59 NSSCKFWInstance *fwInstance,
60 CK_RV *pError
61 )
62 {
63 return (NSSUTF8 *)nss_builtins_TokenSerialNumber;
64 }
65
66 static CK_BBOOL
67 builtins_mdToken_GetIsWriteProtected
68 (
69 NSSCKMDToken *mdToken,
70 NSSCKFWToken *fwToken,
71 NSSCKMDInstance *mdInstance,
72 NSSCKFWInstance *fwInstance
73 )
74 {
75 return CK_TRUE;
76 }
77
78 static CK_VERSION
79 builtins_mdToken_GetHardwareVersion
80 (
81 NSSCKMDToken *mdToken,
82 NSSCKFWToken *fwToken,
83 NSSCKMDInstance *mdInstance,
84 NSSCKFWInstance *fwInstance
85 )
86 {
87 return nss_builtins_HardwareVersion;
88 }
89
90 static CK_VERSION
91 builtins_mdToken_GetFirmwareVersion
92 (
93 NSSCKMDToken *mdToken,
94 NSSCKFWToken *fwToken,
95 NSSCKMDInstance *mdInstance,
96 NSSCKFWInstance *fwInstance
97 )
98 {
99 return nss_builtins_FirmwareVersion;
100 }
101
102 static NSSCKMDSession *
103 builtins_mdToken_OpenSession
104 (
105 NSSCKMDToken *mdToken,
106 NSSCKFWToken *fwToken,
107 NSSCKMDInstance *mdInstance,
108 NSSCKFWInstance *fwInstance,
109 NSSCKFWSession *fwSession,
110 CK_BBOOL rw,
111 CK_RV *pError
112 )
113 {
114 return nss_builtins_CreateSession(fwSession, pError);
115 }
116
117 const NSSCKMDToken
118 nss_builtins_mdToken = {
119 (void *)NULL, /* etc */
120 NULL, /* Setup */
121 NULL, /* Invalidate */
122 NULL, /* InitToken -- default errs */
123 builtins_mdToken_GetLabel,
124 builtins_mdToken_GetManufacturerID,
125 builtins_mdToken_GetModel,
126 builtins_mdToken_GetSerialNumber,
127 NULL, /* GetHasRNG -- default is false */
128 builtins_mdToken_GetIsWriteProtected,
129 NULL, /* GetLoginRequired -- default is false */
130 NULL, /* GetUserPinInitialized -- default is false */
131 NULL, /* GetRestoreKeyNotNeeded -- irrelevant */
132 NULL, /* GetHasClockOnToken -- default is false */
133 NULL, /* GetHasProtectedAuthenticationPath -- default is false */
134 NULL, /* GetSupportsDualCryptoOperations -- default is false */
135 NULL, /* GetMaxSessionCount -- default is CK_UNAVAILABLE_INFORMATION */
136 NULL, /* GetMaxRwSessionCount -- default is CK_UNAVAILABLE_INFORMATION */
137 NULL, /* GetMaxPinLen -- irrelevant */
138 NULL, /* GetMinPinLen -- irrelevant */
139 NULL, /* GetTotalPublicMemory -- default is CK_UNAVAILABLE_INFORMATION */
140 NULL, /* GetFreePublicMemory -- default is CK_UNAVAILABLE_INFORMATION */
141 NULL, /* GetTotalPrivateMemory -- default is CK_UNAVAILABLE_INFORMATION */
142 NULL, /* GetFreePrivateMemory -- default is CK_UNAVAILABLE_INFORMATION */
143 builtins_mdToken_GetHardwareVersion,
144 builtins_mdToken_GetFirmwareVersion,
145 NULL, /* GetUTCTime -- no clock */
146 builtins_mdToken_OpenSession,
147 NULL, /* GetMechanismCount -- default is zero */
148 NULL, /* GetMechanismTypes -- irrelevant */
149 NULL, /* GetMechanism -- irrelevant */
150 (void *)NULL /* null terminator */
151 };
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)