bslot.c (2095B)
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/slot.c 9 * 10 * This file implements the NSSCKMDSlot object for the 11 * "builtin objects" cryptoki module. 12 */ 13 14 static NSSUTF8 * 15 builtins_mdSlot_GetSlotDescription( 16 NSSCKMDSlot *mdSlot, 17 NSSCKFWSlot *fwSlot, 18 NSSCKMDInstance *mdInstance, 19 NSSCKFWInstance *fwInstance, 20 CK_RV *pError) 21 { 22 return (NSSUTF8 *)nss_builtins_SlotDescription; 23 } 24 25 static NSSUTF8 * 26 builtins_mdSlot_GetManufacturerID( 27 NSSCKMDSlot *mdSlot, 28 NSSCKFWSlot *fwSlot, 29 NSSCKMDInstance *mdInstance, 30 NSSCKFWInstance *fwInstance, 31 CK_RV *pError) 32 { 33 return (NSSUTF8 *)nss_builtins_ManufacturerID; 34 } 35 36 static CK_VERSION 37 builtins_mdSlot_GetHardwareVersion( 38 NSSCKMDSlot *mdSlot, 39 NSSCKFWSlot *fwSlot, 40 NSSCKMDInstance *mdInstance, 41 NSSCKFWInstance *fwInstance) 42 { 43 return nss_builtins_HardwareVersion; 44 } 45 46 static CK_VERSION 47 builtins_mdSlot_GetFirmwareVersion( 48 NSSCKMDSlot *mdSlot, 49 NSSCKFWSlot *fwSlot, 50 NSSCKMDInstance *mdInstance, 51 NSSCKFWInstance *fwInstance) 52 { 53 return nss_builtins_FirmwareVersion; 54 } 55 56 static NSSCKMDToken * 57 builtins_mdSlot_GetToken( 58 NSSCKMDSlot *mdSlot, 59 NSSCKFWSlot *fwSlot, 60 NSSCKMDInstance *mdInstance, 61 NSSCKFWInstance *fwInstance, 62 CK_RV *pError) 63 { 64 return (NSSCKMDToken *)&nss_builtins_mdToken; 65 } 66 67 const NSSCKMDSlot 68 nss_builtins_mdSlot = { 69 (void *)NULL, /* etc */ 70 NULL, /* Initialize */ 71 NULL, /* Destroy */ 72 builtins_mdSlot_GetSlotDescription, 73 builtins_mdSlot_GetManufacturerID, 74 NULL, /* GetTokenPresent -- defaults to true */ 75 NULL, /* GetRemovableDevice -- defaults to false */ 76 NULL, /* GetHardwareSlot -- defaults to false */ 77 builtins_mdSlot_GetHardwareVersion, 78 builtins_mdSlot_GetFirmwareVersion, 79 builtins_mdSlot_GetToken, 80 (void *)NULL /* null terminator */ 81 };