Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "ckcapi.h" |
michael@0 | 6 | |
michael@0 | 7 | /* |
michael@0 | 8 | * ckcapi/cslot.c |
michael@0 | 9 | * |
michael@0 | 10 | * This file implements the NSSCKMDSlot object for the |
michael@0 | 11 | * "nss to capi" cryptoki module. |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | static NSSUTF8 * |
michael@0 | 15 | ckcapi_mdSlot_GetSlotDescription |
michael@0 | 16 | ( |
michael@0 | 17 | NSSCKMDSlot *mdSlot, |
michael@0 | 18 | NSSCKFWSlot *fwSlot, |
michael@0 | 19 | NSSCKMDInstance *mdInstance, |
michael@0 | 20 | NSSCKFWInstance *fwInstance, |
michael@0 | 21 | CK_RV *pError |
michael@0 | 22 | ) |
michael@0 | 23 | { |
michael@0 | 24 | return (NSSUTF8 *)nss_ckcapi_SlotDescription; |
michael@0 | 25 | } |
michael@0 | 26 | |
michael@0 | 27 | static NSSUTF8 * |
michael@0 | 28 | ckcapi_mdSlot_GetManufacturerID |
michael@0 | 29 | ( |
michael@0 | 30 | NSSCKMDSlot *mdSlot, |
michael@0 | 31 | NSSCKFWSlot *fwSlot, |
michael@0 | 32 | NSSCKMDInstance *mdInstance, |
michael@0 | 33 | NSSCKFWInstance *fwInstance, |
michael@0 | 34 | CK_RV *pError |
michael@0 | 35 | ) |
michael@0 | 36 | { |
michael@0 | 37 | return (NSSUTF8 *)nss_ckcapi_ManufacturerID; |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | static CK_VERSION |
michael@0 | 41 | ckcapi_mdSlot_GetHardwareVersion |
michael@0 | 42 | ( |
michael@0 | 43 | NSSCKMDSlot *mdSlot, |
michael@0 | 44 | NSSCKFWSlot *fwSlot, |
michael@0 | 45 | NSSCKMDInstance *mdInstance, |
michael@0 | 46 | NSSCKFWInstance *fwInstance |
michael@0 | 47 | ) |
michael@0 | 48 | { |
michael@0 | 49 | return nss_ckcapi_HardwareVersion; |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | static CK_VERSION |
michael@0 | 53 | ckcapi_mdSlot_GetFirmwareVersion |
michael@0 | 54 | ( |
michael@0 | 55 | NSSCKMDSlot *mdSlot, |
michael@0 | 56 | NSSCKFWSlot *fwSlot, |
michael@0 | 57 | NSSCKMDInstance *mdInstance, |
michael@0 | 58 | NSSCKFWInstance *fwInstance |
michael@0 | 59 | ) |
michael@0 | 60 | { |
michael@0 | 61 | return nss_ckcapi_FirmwareVersion; |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | static NSSCKMDToken * |
michael@0 | 65 | ckcapi_mdSlot_GetToken |
michael@0 | 66 | ( |
michael@0 | 67 | NSSCKMDSlot *mdSlot, |
michael@0 | 68 | NSSCKFWSlot *fwSlot, |
michael@0 | 69 | NSSCKMDInstance *mdInstance, |
michael@0 | 70 | NSSCKFWInstance *fwInstance, |
michael@0 | 71 | CK_RV *pError |
michael@0 | 72 | ) |
michael@0 | 73 | { |
michael@0 | 74 | return (NSSCKMDToken *)&nss_ckcapi_mdToken; |
michael@0 | 75 | } |
michael@0 | 76 | |
michael@0 | 77 | NSS_IMPLEMENT_DATA const NSSCKMDSlot |
michael@0 | 78 | nss_ckcapi_mdSlot = { |
michael@0 | 79 | (void *)NULL, /* etc */ |
michael@0 | 80 | NULL, /* Initialize */ |
michael@0 | 81 | NULL, /* Destroy */ |
michael@0 | 82 | ckcapi_mdSlot_GetSlotDescription, |
michael@0 | 83 | ckcapi_mdSlot_GetManufacturerID, |
michael@0 | 84 | NULL, /* GetTokenPresent -- defaults to true */ |
michael@0 | 85 | NULL, /* GetRemovableDevice -- defaults to false */ |
michael@0 | 86 | NULL, /* GetHardwareSlot -- defaults to false */ |
michael@0 | 87 | ckcapi_mdSlot_GetHardwareVersion, |
michael@0 | 88 | ckcapi_mdSlot_GetFirmwareVersion, |
michael@0 | 89 | ckcapi_mdSlot_GetToken, |
michael@0 | 90 | (void *)NULL /* null terminator */ |
michael@0 | 91 | }; |