security/nss/lib/ckfw/nssmkey/mslot.c

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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 "ckmk.h"
michael@0 6
michael@0 7 /*
michael@0 8 * nssmkey/mslot.c
michael@0 9 *
michael@0 10 * This file implements the NSSCKMDSlot object for the
michael@0 11 * "nssmkey" cryptoki module.
michael@0 12 */
michael@0 13
michael@0 14 static NSSUTF8 *
michael@0 15 ckmk_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_ckmk_SlotDescription;
michael@0 25 }
michael@0 26
michael@0 27 static NSSUTF8 *
michael@0 28 ckmk_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_ckmk_ManufacturerID;
michael@0 38 }
michael@0 39
michael@0 40 static CK_VERSION
michael@0 41 ckmk_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_ckmk_HardwareVersion;
michael@0 50 }
michael@0 51
michael@0 52 static CK_VERSION
michael@0 53 ckmk_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_ckmk_FirmwareVersion;
michael@0 62 }
michael@0 63
michael@0 64 static NSSCKMDToken *
michael@0 65 ckmk_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_ckmk_mdToken;
michael@0 75 }
michael@0 76
michael@0 77 NSS_IMPLEMENT_DATA const NSSCKMDSlot
michael@0 78 nss_ckmk_mdSlot = {
michael@0 79 (void *)NULL, /* etc */
michael@0 80 NULL, /* Initialize */
michael@0 81 NULL, /* Destroy */
michael@0 82 ckmk_mdSlot_GetSlotDescription,
michael@0 83 ckmk_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 ckmk_mdSlot_GetHardwareVersion,
michael@0 88 ckmk_mdSlot_GetFirmwareVersion,
michael@0 89 ckmk_mdSlot_GetToken,
michael@0 90 (void *)NULL /* null terminator */
michael@0 91 };

mercurial