andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #include "builtins.h" andre@0: andre@0: /* andre@0: * builtins/slot.c andre@0: * andre@0: * This file implements the NSSCKMDSlot object for the andre@0: * "builtin objects" cryptoki module. andre@0: */ andre@0: andre@0: static NSSUTF8 * andre@0: builtins_mdSlot_GetSlotDescription andre@0: ( andre@0: NSSCKMDSlot *mdSlot, andre@0: NSSCKFWSlot *fwSlot, andre@0: NSSCKMDInstance *mdInstance, andre@0: NSSCKFWInstance *fwInstance, andre@0: CK_RV *pError andre@0: ) andre@0: { andre@0: return (NSSUTF8 *)nss_builtins_SlotDescription; andre@0: } andre@0: andre@0: static NSSUTF8 * andre@0: builtins_mdSlot_GetManufacturerID andre@0: ( andre@0: NSSCKMDSlot *mdSlot, andre@0: NSSCKFWSlot *fwSlot, andre@0: NSSCKMDInstance *mdInstance, andre@0: NSSCKFWInstance *fwInstance, andre@0: CK_RV *pError andre@0: ) andre@0: { andre@0: return (NSSUTF8 *)nss_builtins_ManufacturerID; andre@0: } andre@0: andre@0: static CK_VERSION andre@0: builtins_mdSlot_GetHardwareVersion andre@0: ( andre@0: NSSCKMDSlot *mdSlot, andre@0: NSSCKFWSlot *fwSlot, andre@0: NSSCKMDInstance *mdInstance, andre@0: NSSCKFWInstance *fwInstance andre@0: ) andre@0: { andre@0: return nss_builtins_HardwareVersion; andre@0: } andre@0: andre@0: static CK_VERSION andre@0: builtins_mdSlot_GetFirmwareVersion andre@0: ( andre@0: NSSCKMDSlot *mdSlot, andre@0: NSSCKFWSlot *fwSlot, andre@0: NSSCKMDInstance *mdInstance, andre@0: NSSCKFWInstance *fwInstance andre@0: ) andre@0: { andre@0: return nss_builtins_FirmwareVersion; andre@0: } andre@0: andre@0: static NSSCKMDToken * andre@0: builtins_mdSlot_GetToken andre@0: ( andre@0: NSSCKMDSlot *mdSlot, andre@0: NSSCKFWSlot *fwSlot, andre@0: NSSCKMDInstance *mdInstance, andre@0: NSSCKFWInstance *fwInstance, andre@0: CK_RV *pError andre@0: ) andre@0: { andre@0: return (NSSCKMDToken *)&nss_builtins_mdToken; andre@0: } andre@0: andre@0: const NSSCKMDSlot andre@0: nss_builtins_mdSlot = { andre@0: (void *)NULL, /* etc */ andre@0: NULL, /* Initialize */ andre@0: NULL, /* Destroy */ andre@0: builtins_mdSlot_GetSlotDescription, andre@0: builtins_mdSlot_GetManufacturerID, andre@0: NULL, /* GetTokenPresent -- defaults to true */ andre@0: NULL, /* GetRemovableDevice -- defaults to false */ andre@0: NULL, /* GetHardwareSlot -- defaults to false */ andre@0: builtins_mdSlot_GetHardwareVersion, andre@0: builtins_mdSlot_GetFirmwareVersion, andre@0: builtins_mdSlot_GetToken, andre@0: (void *)NULL /* null terminator */ andre@0: };