michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "ckcapi.h" michael@0: michael@0: /* michael@0: * ckcapi/cslot.c michael@0: * michael@0: * This file implements the NSSCKMDSlot object for the michael@0: * "nss to capi" cryptoki module. michael@0: */ michael@0: michael@0: static NSSUTF8 * michael@0: ckcapi_mdSlot_GetSlotDescription michael@0: ( michael@0: NSSCKMDSlot *mdSlot, michael@0: NSSCKFWSlot *fwSlot, michael@0: NSSCKMDInstance *mdInstance, michael@0: NSSCKFWInstance *fwInstance, michael@0: CK_RV *pError michael@0: ) michael@0: { michael@0: return (NSSUTF8 *)nss_ckcapi_SlotDescription; michael@0: } michael@0: michael@0: static NSSUTF8 * michael@0: ckcapi_mdSlot_GetManufacturerID michael@0: ( michael@0: NSSCKMDSlot *mdSlot, michael@0: NSSCKFWSlot *fwSlot, michael@0: NSSCKMDInstance *mdInstance, michael@0: NSSCKFWInstance *fwInstance, michael@0: CK_RV *pError michael@0: ) michael@0: { michael@0: return (NSSUTF8 *)nss_ckcapi_ManufacturerID; michael@0: } michael@0: michael@0: static CK_VERSION michael@0: ckcapi_mdSlot_GetHardwareVersion michael@0: ( michael@0: NSSCKMDSlot *mdSlot, michael@0: NSSCKFWSlot *fwSlot, michael@0: NSSCKMDInstance *mdInstance, michael@0: NSSCKFWInstance *fwInstance michael@0: ) michael@0: { michael@0: return nss_ckcapi_HardwareVersion; michael@0: } michael@0: michael@0: static CK_VERSION michael@0: ckcapi_mdSlot_GetFirmwareVersion michael@0: ( michael@0: NSSCKMDSlot *mdSlot, michael@0: NSSCKFWSlot *fwSlot, michael@0: NSSCKMDInstance *mdInstance, michael@0: NSSCKFWInstance *fwInstance michael@0: ) michael@0: { michael@0: return nss_ckcapi_FirmwareVersion; michael@0: } michael@0: michael@0: static NSSCKMDToken * michael@0: ckcapi_mdSlot_GetToken michael@0: ( michael@0: NSSCKMDSlot *mdSlot, michael@0: NSSCKFWSlot *fwSlot, michael@0: NSSCKMDInstance *mdInstance, michael@0: NSSCKFWInstance *fwInstance, michael@0: CK_RV *pError michael@0: ) michael@0: { michael@0: return (NSSCKMDToken *)&nss_ckcapi_mdToken; michael@0: } michael@0: michael@0: NSS_IMPLEMENT_DATA const NSSCKMDSlot michael@0: nss_ckcapi_mdSlot = { michael@0: (void *)NULL, /* etc */ michael@0: NULL, /* Initialize */ michael@0: NULL, /* Destroy */ michael@0: ckcapi_mdSlot_GetSlotDescription, michael@0: ckcapi_mdSlot_GetManufacturerID, michael@0: NULL, /* GetTokenPresent -- defaults to true */ michael@0: NULL, /* GetRemovableDevice -- defaults to false */ michael@0: NULL, /* GetHardwareSlot -- defaults to false */ michael@0: ckcapi_mdSlot_GetHardwareVersion, michael@0: ckcapi_mdSlot_GetFirmwareVersion, michael@0: ckcapi_mdSlot_GetToken, michael@0: (void *)NULL /* null terminator */ michael@0: };