~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/manager/ssl/src/nsPKCS11Slot.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the Mozilla Public
 
3
 * License Version 1.1 (the "License"); you may not use this file
 
4
 * except in compliance with the License. You may obtain a copy of
 
5
 * the License at http://www.mozilla.org/MPL/
 
6
 * 
 
7
 * Software distributed under the License is distributed on an "AS
 
8
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
 * implied. See the License for the specific language governing
 
10
 * rights and limitations under the License.
 
11
 * 
 
12
 * The Original Code is the Netscape security libraries.
 
13
 * 
 
14
 * The Initial Developer of the Original Code is Netscape
 
15
 * Communications Corporation.  Portions created by Netscape are 
 
16
 * Copyright (C) 2000 Netscape Communications Corporation.  All
 
17
 * Rights Reserved.
 
18
 * 
 
19
 * Contributor(s):
 
20
 *  Ian McGreer <mcgreer@netscape.com>
 
21
 * 
 
22
 * Alternatively, the contents of this file may be used under the
 
23
 * terms of the GNU General Public License Version 2 or later (the
 
24
 * "GPL"), in which case the provisions of the GPL are applicable 
 
25
 * instead of those above.  If you wish to allow use of your 
 
26
 * version of this file only under the terms of the GPL and not to
 
27
 * allow others to use your version of this file under the MPL,
 
28
 * indicate your decision by deleting the provisions above and
 
29
 * replace them with the notice and other provisions required by
 
30
 * the GPL.  If you do not delete the provisions above, a recipient
 
31
 * may use your version of this file under either the MPL or the
 
32
 * GPL.
 
33
 *
 
34
 */
 
35
 
 
36
#include "nsPKCS11Slot.h"
 
37
#include "nsPK11TokenDB.h"
 
38
 
 
39
#include "nsCOMPtr.h"
 
40
#include "nsISupportsArray.h"
 
41
#include "nsString.h"
 
42
#include "nsReadableUtils.h"
 
43
#include "nsCRT.h"
 
44
 
 
45
#include "secmod.h"
 
46
 
 
47
#ifdef PR_LOGGING
 
48
extern PRLogModuleInfo* gPIPNSSLog;
 
49
#endif
 
50
 
 
51
NS_IMPL_ISUPPORTS1(nsPKCS11Slot, nsIPKCS11Slot)
 
52
 
 
53
nsPKCS11Slot::nsPKCS11Slot(PK11SlotInfo *slot)
 
54
{
 
55
  nsNSSShutDownPreventionLock locker;
 
56
  if (isAlreadyShutDown())
 
57
    return;
 
58
 
 
59
  PK11_ReferenceSlot(slot);
 
60
  mSlot = slot;
 
61
 
 
62
  CK_SLOT_INFO slot_info;
 
63
  if (PK11_GetSlotInfo(mSlot, &slot_info) == SECSuccess) {
 
64
    // Set the Description field
 
65
    const char *ccDesc = (const char*)slot_info.slotDescription;
 
66
    const nsACString &cDesc = Substring(
 
67
      ccDesc, 
 
68
      ccDesc+PL_strnlen(ccDesc, sizeof(slot_info.slotDescription)));
 
69
    mSlotDesc = NS_ConvertUTF8toUCS2(cDesc);
 
70
    mSlotDesc.Trim(" ", PR_FALSE, PR_TRUE);
 
71
    // Set the Manufacturer field
 
72
    const char *ccManID = (const char*)slot_info.manufacturerID;
 
73
    const nsACString &cManID = Substring(
 
74
      ccManID, 
 
75
      ccManID+PL_strnlen(ccManID, sizeof(slot_info.manufacturerID)));
 
76
    mSlotManID = NS_ConvertUTF8toUCS2(cManID);
 
77
    mSlotManID.Trim(" ", PR_FALSE, PR_TRUE);
 
78
    // Set the Hardware Version field
 
79
    mSlotHWVersion.AppendInt(slot_info.hardwareVersion.major);
 
80
    mSlotHWVersion.Append(NS_LITERAL_STRING("."));
 
81
    mSlotHWVersion.AppendInt(slot_info.hardwareVersion.minor);
 
82
    // Set the Firmware Version field
 
83
    mSlotFWVersion.AppendInt(slot_info.firmwareVersion.major);
 
84
    mSlotFWVersion.Append(NS_LITERAL_STRING("."));
 
85
    mSlotFWVersion.AppendInt(slot_info.firmwareVersion.minor);
 
86
  }
 
87
 
 
88
}
 
89
 
 
90
nsPKCS11Slot::~nsPKCS11Slot()
 
91
{
 
92
  nsNSSShutDownPreventionLock locker;
 
93
  if (isAlreadyShutDown())
 
94
    return;
 
95
 
 
96
  destructorSafeDestroyNSSReference();
 
97
  shutdown(calledFromObject);
 
98
}
 
99
 
 
100
void nsPKCS11Slot::virtualDestroyNSSReference()
 
101
{
 
102
  destructorSafeDestroyNSSReference();
 
103
}
 
104
 
 
105
void nsPKCS11Slot::destructorSafeDestroyNSSReference()
 
106
{
 
107
  if (isAlreadyShutDown())
 
108
    return;
 
109
 
 
110
  if (mSlot) {
 
111
    PK11_FreeSlot(mSlot);
 
112
    mSlot = nsnull;
 
113
  }
 
114
}
 
115
 
 
116
/* readonly attribute wstring name; */
 
117
NS_IMETHODIMP 
 
118
nsPKCS11Slot::GetName(PRUnichar **aName)
 
119
{
 
120
  nsNSSShutDownPreventionLock locker;
 
121
  if (isAlreadyShutDown())
 
122
    return NS_ERROR_NOT_AVAILABLE;
 
123
 
 
124
  char *csn = PK11_GetSlotName(mSlot);
 
125
  if (*csn) {
 
126
    *aName = ToNewUnicode(NS_ConvertUTF8toUCS2(csn));
 
127
  } else if (PK11_HasRootCerts(mSlot)) {
 
128
    // This is a workaround to an NSS bug - the root certs module has
 
129
    // no slot name.  Not bothering to localize, because this is a workaround
 
130
    // and for now all the slot names returned by NSS are char * anyway.
 
131
    *aName = ToNewUnicode(NS_LITERAL_STRING("Root Certificates"));
 
132
  } else {
 
133
    // same as above, this is a catch-all
 
134
    *aName = ToNewUnicode(NS_LITERAL_STRING("Unnamed Slot"));
 
135
  }
 
136
  if (!*aName) return NS_ERROR_OUT_OF_MEMORY;
 
137
  return NS_OK;
 
138
}
 
139
 
 
140
/* readonly attribute wstring desc; */
 
141
NS_IMETHODIMP 
 
142
nsPKCS11Slot::GetDesc(PRUnichar **aDesc)
 
143
{
 
144
  nsNSSShutDownPreventionLock locker;
 
145
  if (isAlreadyShutDown())
 
146
    return NS_ERROR_NOT_AVAILABLE;
 
147
 
 
148
  *aDesc = ToNewUnicode(mSlotDesc);
 
149
  if (!*aDesc) return NS_ERROR_OUT_OF_MEMORY;
 
150
  return NS_OK;
 
151
}
 
152
 
 
153
/* readonly attribute wstring manID; */
 
154
NS_IMETHODIMP 
 
155
nsPKCS11Slot::GetManID(PRUnichar **aManID)
 
156
{
 
157
  *aManID = ToNewUnicode(mSlotManID);
 
158
  if (!*aManID) return NS_ERROR_OUT_OF_MEMORY;
 
159
  return NS_OK;
 
160
}
 
161
 
 
162
/* readonly attribute wstring HWVersion; */
 
163
NS_IMETHODIMP 
 
164
nsPKCS11Slot::GetHWVersion(PRUnichar **aHWVersion)
 
165
{
 
166
  *aHWVersion = ToNewUnicode(mSlotHWVersion);
 
167
  if (!*aHWVersion) return NS_ERROR_OUT_OF_MEMORY;
 
168
  return NS_OK;
 
169
}
 
170
 
 
171
/* readonly attribute wstring FWVersion; */
 
172
NS_IMETHODIMP 
 
173
nsPKCS11Slot::GetFWVersion(PRUnichar **aFWVersion)
 
174
{
 
175
  *aFWVersion = ToNewUnicode(mSlotFWVersion);
 
176
  if (!*aFWVersion) return NS_ERROR_OUT_OF_MEMORY;
 
177
  return NS_OK;
 
178
}
 
179
 
 
180
/* nsIPK11Token getToken (); */
 
181
NS_IMETHODIMP 
 
182
nsPKCS11Slot::GetToken(nsIPK11Token **_retval)
 
183
{
 
184
  nsNSSShutDownPreventionLock locker;
 
185
  if (isAlreadyShutDown())
 
186
    return NS_ERROR_NOT_AVAILABLE;
 
187
 
 
188
  nsCOMPtr<nsIPK11Token> token = new nsPK11Token(mSlot);
 
189
  if (!token)
 
190
    return NS_ERROR_OUT_OF_MEMORY;
 
191
  *_retval = token;
 
192
  NS_ADDREF(*_retval);
 
193
  return NS_OK;
 
194
}
 
195
 
 
196
/* readonly attribute wstring tokenName; */
 
197
NS_IMETHODIMP 
 
198
nsPKCS11Slot::GetTokenName(PRUnichar **aName)
 
199
{
 
200
  nsNSSShutDownPreventionLock locker;
 
201
  if (isAlreadyShutDown())
 
202
    return NS_ERROR_NOT_AVAILABLE;
 
203
 
 
204
  *aName = ToNewUnicode(NS_ConvertUTF8toUCS2(PK11_GetTokenName(mSlot)));
 
205
  if (!*aName) return NS_ERROR_OUT_OF_MEMORY;
 
206
  return NS_OK;
 
207
}
 
208
 
 
209
NS_IMETHODIMP
 
210
nsPKCS11Slot::GetStatus(PRUint32 *_retval)
 
211
{
 
212
  nsNSSShutDownPreventionLock locker;
 
213
  if (isAlreadyShutDown())
 
214
    return NS_ERROR_NOT_AVAILABLE;
 
215
 
 
216
  if (PK11_IsDisabled(mSlot))
 
217
    *_retval = SLOT_DISABLED;
 
218
  else if (!PK11_IsPresent(mSlot))
 
219
    *_retval = SLOT_NOT_PRESENT;
 
220
  else if (PK11_NeedLogin(mSlot) && PK11_NeedUserInit(mSlot))
 
221
    *_retval = SLOT_UNINITIALIZED;
 
222
  else if (PK11_NeedLogin(mSlot) && !PK11_IsLoggedIn(mSlot, NULL))
 
223
    *_retval = SLOT_NOT_LOGGED_IN;
 
224
  else if (PK11_NeedLogin(mSlot))
 
225
    *_retval = SLOT_LOGGED_IN;
 
226
  else
 
227
    *_retval = SLOT_READY;
 
228
  return NS_OK;
 
229
}
 
230
 
 
231
NS_IMPL_ISUPPORTS1(nsPKCS11Module, nsIPKCS11Module)
 
232
 
 
233
nsPKCS11Module::nsPKCS11Module(SECMODModule *module)
 
234
{
 
235
  nsNSSShutDownPreventionLock locker;
 
236
  if (isAlreadyShutDown())
 
237
    return;
 
238
 
 
239
  SECMOD_ReferenceModule(module);
 
240
  mModule = module;
 
241
}
 
242
 
 
243
nsPKCS11Module::~nsPKCS11Module()
 
244
{
 
245
  nsNSSShutDownPreventionLock locker;
 
246
  if (isAlreadyShutDown())
 
247
    return;
 
248
 
 
249
  destructorSafeDestroyNSSReference();
 
250
  shutdown(calledFromObject);
 
251
}
 
252
 
 
253
void nsPKCS11Module::virtualDestroyNSSReference()
 
254
{
 
255
  destructorSafeDestroyNSSReference();
 
256
}
 
257
 
 
258
void nsPKCS11Module::destructorSafeDestroyNSSReference()
 
259
{
 
260
  if (isAlreadyShutDown())
 
261
    return;
 
262
 
 
263
  if (mModule) {
 
264
    SECMOD_DestroyModule(mModule);
 
265
    mModule = nsnull;
 
266
  }
 
267
}
 
268
 
 
269
/* readonly attribute wstring name; */
 
270
NS_IMETHODIMP 
 
271
nsPKCS11Module::GetName(PRUnichar **aName)
 
272
{
 
273
  nsNSSShutDownPreventionLock locker;
 
274
  if (isAlreadyShutDown())
 
275
    return NS_ERROR_NOT_AVAILABLE;
 
276
 
 
277
  *aName = ToNewUnicode(NS_ConvertUTF8toUCS2(mModule->commonName));
 
278
  return NS_OK;
 
279
}
 
280
 
 
281
/* readonly attribute wstring libName; */
 
282
NS_IMETHODIMP 
 
283
nsPKCS11Module::GetLibName(PRUnichar **aName)
 
284
{
 
285
  nsNSSShutDownPreventionLock locker;
 
286
  if (isAlreadyShutDown())
 
287
    return NS_ERROR_NOT_AVAILABLE;
 
288
 
 
289
  if ( mModule->dllName ) {
 
290
    *aName = ToNewUnicode(NS_ConvertUTF8toUCS2(mModule->dllName));
 
291
  } else {
 
292
    *aName = NULL;
 
293
  }
 
294
  return NS_OK;
 
295
}
 
296
 
 
297
/*  nsIPKCS11Slot findSlotByName(in wstring name); */
 
298
NS_IMETHODIMP 
 
299
nsPKCS11Module::FindSlotByName(const PRUnichar *aName,
 
300
                               nsIPKCS11Slot **_retval)
 
301
{
 
302
  nsNSSShutDownPreventionLock locker;
 
303
  if (isAlreadyShutDown())
 
304
    return NS_ERROR_NOT_AVAILABLE;
 
305
 
 
306
  char *asciiname = NULL;
 
307
  asciiname = ToNewUTF8String(nsDependentString(aName));
 
308
  PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting \"%s\"\n", asciiname));
 
309
  PK11SlotInfo *slotinfo = SECMOD_FindSlot(mModule, asciiname);
 
310
  if (!slotinfo) {
 
311
    // XXX *sigh*  if token is present, SECMOD_FindSlot goes by token
 
312
    // name (huh?)  reimplement it here for the fun of it.
 
313
    for (int i=0; i<mModule->slotCount; i++) {
 
314
      if (nsCRT::strcmp(asciiname, PK11_GetSlotName(mModule->slots[i])) == 0) {
 
315
        slotinfo = PK11_ReferenceSlot(mModule->slots[i]);
 
316
        break;
 
317
      }
 
318
    }
 
319
    if (!slotinfo) {
 
320
      // XXX another workaround - the builtin module has no name
 
321
      if (nsCRT::strcmp(asciiname, "Root Certificates") == 0) {
 
322
        slotinfo = PK11_ReferenceSlot(mModule->slots[0]);
 
323
      } else {
 
324
        // give up
 
325
        nsMemory::Free(asciiname);
 
326
        return NS_ERROR_FAILURE;
 
327
      }
 
328
    }
 
329
  }
 
330
  nsMemory::Free(asciiname);
 
331
  nsCOMPtr<nsIPKCS11Slot> slot = new nsPKCS11Slot(slotinfo);
 
332
  PK11_FreeSlot(slotinfo);
 
333
  if (!slot)
 
334
    return NS_ERROR_OUT_OF_MEMORY;
 
335
  *_retval = slot;
 
336
  NS_ADDREF(*_retval);
 
337
  return NS_OK;
 
338
}
 
339
 
 
340
/* nsIEnumerator listSlots (); */
 
341
NS_IMETHODIMP 
 
342
nsPKCS11Module::ListSlots(nsIEnumerator **_retval)
 
343
{
 
344
  nsNSSShutDownPreventionLock locker;
 
345
  if (isAlreadyShutDown())
 
346
    return NS_ERROR_NOT_AVAILABLE;
 
347
 
 
348
  nsresult rv = NS_OK;
 
349
  int i;
 
350
  /* get isupports array */
 
351
  nsCOMPtr<nsISupportsArray> array;
 
352
  rv = NS_NewISupportsArray(getter_AddRefs(array));
 
353
  if (NS_FAILED(rv)) return rv;
 
354
  for (i=0; i<mModule->slotCount; i++) {
 
355
    if (mModule->slots[i]) {
 
356
      nsCOMPtr<nsIPKCS11Slot> slot = new nsPKCS11Slot(mModule->slots[i]);
 
357
      array->AppendElement(slot);
 
358
    }
 
359
  }
 
360
  rv = array->Enumerate(_retval);
 
361
  return rv;
 
362
}
 
363
 
 
364
NS_IMPL_ISUPPORTS2(nsPKCS11ModuleDB, nsIPKCS11ModuleDB, nsICryptoFIPSInfo)
 
365
 
 
366
nsPKCS11ModuleDB::nsPKCS11ModuleDB()
 
367
{
 
368
}
 
369
 
 
370
nsPKCS11ModuleDB::~nsPKCS11ModuleDB()
 
371
{
 
372
}
 
373
 
 
374
/* nsIPKCS11Module getInternal (); */
 
375
NS_IMETHODIMP 
 
376
nsPKCS11ModuleDB::GetInternal(nsIPKCS11Module **_retval)
 
377
{
 
378
  nsNSSShutDownPreventionLock locker;
 
379
  SECMODModule *nssMod = 
 
380
    SECMOD_CreateModule(NULL,SECMOD_INT_NAME, NULL,SECMOD_INT_FLAGS);
 
381
  nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(nssMod);
 
382
  SECMOD_DestroyModule(nssMod);
 
383
  if (!module)
 
384
    return NS_ERROR_OUT_OF_MEMORY;
 
385
  *_retval = module;
 
386
  NS_ADDREF(*_retval);
 
387
  return NS_OK;
 
388
}
 
389
 
 
390
/* nsIPKCS11Module getInternalFIPS (); */
 
391
NS_IMETHODIMP 
 
392
nsPKCS11ModuleDB::GetInternalFIPS(nsIPKCS11Module **_retval)
 
393
{
 
394
  nsNSSShutDownPreventionLock locker;
 
395
  SECMODModule *nssMod = 
 
396
    SECMOD_CreateModule(NULL, SECMOD_FIPS_NAME, NULL, SECMOD_FIPS_FLAGS);
 
397
  nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(nssMod);
 
398
  SECMOD_DestroyModule(nssMod);
 
399
  if (!module)
 
400
    return NS_ERROR_OUT_OF_MEMORY;
 
401
  *_retval = module;
 
402
  NS_ADDREF(*_retval);
 
403
  return NS_OK;
 
404
}
 
405
 
 
406
/* nsIPKCS11Module findModuleByName(in wstring name); */
 
407
NS_IMETHODIMP 
 
408
nsPKCS11ModuleDB::FindModuleByName(const PRUnichar *aName,
 
409
                                   nsIPKCS11Module **_retval)
 
410
{
 
411
  nsNSSShutDownPreventionLock locker;
 
412
  NS_ConvertUCS2toUTF8 aUtf8Name(aName);
 
413
  SECMODModule *mod =
 
414
    SECMOD_FindModule(NS_CONST_CAST(char *, aUtf8Name.get()));
 
415
  if (!mod)
 
416
    return NS_ERROR_FAILURE;
 
417
  nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(mod);
 
418
  SECMOD_DestroyModule(mod);
 
419
  if (!module)
 
420
    return NS_ERROR_OUT_OF_MEMORY;
 
421
  *_retval = module;
 
422
  NS_ADDREF(*_retval);
 
423
  return NS_OK;
 
424
}
 
425
 
 
426
/* This is essentially the same as nsIPK11Token::findTokenByName, except
 
427
 * that it returns an nsIPKCS11Slot, which may be desired.
 
428
 */
 
429
/* nsIPKCS11Module findSlotByName(in wstring name); */
 
430
NS_IMETHODIMP 
 
431
nsPKCS11ModuleDB::FindSlotByName(const PRUnichar *aName,
 
432
                                 nsIPKCS11Slot **_retval)
 
433
{
 
434
  nsNSSShutDownPreventionLock locker;
 
435
  NS_ConvertUCS2toUTF8 aUtf8Name(aName);
 
436
  PK11SlotInfo *slotinfo =
 
437
   PK11_FindSlotByName(NS_CONST_CAST(char*, aUtf8Name.get()));
 
438
  if (!slotinfo)
 
439
    return NS_ERROR_FAILURE;
 
440
  nsCOMPtr<nsIPKCS11Slot> slot = new nsPKCS11Slot(slotinfo);
 
441
  PK11_FreeSlot(slotinfo);
 
442
  if (!slot)
 
443
    return NS_ERROR_OUT_OF_MEMORY;
 
444
  *_retval = slot;
 
445
  NS_ADDREF(*_retval);
 
446
  return NS_OK;
 
447
}
 
448
 
 
449
/* nsIEnumerator listModules (); */
 
450
NS_IMETHODIMP 
 
451
nsPKCS11ModuleDB::ListModules(nsIEnumerator **_retval)
 
452
{
 
453
  nsNSSShutDownPreventionLock locker;
 
454
  nsresult rv = NS_OK;
 
455
  /* get isupports array */
 
456
  nsCOMPtr<nsISupportsArray> array;
 
457
  rv = NS_NewISupportsArray(getter_AddRefs(array));
 
458
  if (NS_FAILED(rv)) return rv;
 
459
  /* get the default list of modules */
 
460
  SECMODModuleList *list = SECMOD_GetDefaultModuleList();
 
461
  /* lock down the list for reading */
 
462
  SECMODListLock *lock = SECMOD_GetDefaultModuleListLock();
 
463
  SECMOD_GetReadLock(lock);
 
464
  while (list) {
 
465
    nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(list->module);
 
466
    array->AppendElement(module);
 
467
    list = list->next;
 
468
  }
 
469
  SECMOD_ReleaseReadLock(lock);
 
470
  rv = array->Enumerate(_retval);
 
471
  return rv;
 
472
}
 
473
 
 
474
NS_IMETHODIMP nsPKCS11ModuleDB::GetCanToggleFIPS(PRBool *aCanToggleFIPS)
 
475
{
 
476
  nsNSSShutDownPreventionLock locker;
 
477
  *aCanToggleFIPS = SECMOD_CanDeleteInternalModule();
 
478
  return NS_OK;
 
479
}
 
480
 
 
481
 
 
482
/* void toggleFIPSMode (); */
 
483
NS_IMETHODIMP nsPKCS11ModuleDB::ToggleFIPSMode()
 
484
{
 
485
  nsNSSShutDownPreventionLock locker;
 
486
  // The way to toggle FIPS mode in NSS is extremely obscure.
 
487
  // Basically, we delete the internal module, and voila it
 
488
  // gets replaced with the opposite module, ie if it was 
 
489
  // FIPS before, then it becomes non-FIPS next.
 
490
  SECMODModule *internal;
 
491
 
 
492
  // This function returns us a pointer to a local copy of 
 
493
  // the internal module stashed in NSS.  We don't want to
 
494
  // delete it since it will cause much pain in NSS.
 
495
  internal = SECMOD_GetInternalModule();
 
496
  if (!internal)
 
497
    return NS_ERROR_FAILURE;
 
498
 
 
499
  SECStatus srv = SECMOD_DeleteInternalModule(internal->commonName);
 
500
  if (srv != SECSuccess)
 
501
    return NS_ERROR_FAILURE;
 
502
 
 
503
  return NS_OK;
 
504
}
 
505
 
 
506
/* readonly attribute boolean isFIPSEnabled; */
 
507
NS_IMETHODIMP nsPKCS11ModuleDB::GetIsFIPSEnabled(PRBool *aIsFIPSEnabled)
 
508
{
 
509
  nsNSSShutDownPreventionLock locker;
 
510
  *aIsFIPSEnabled = PK11_IsFIPS();
 
511
  return NS_OK;
 
512
}
 
513
 
 
514
NS_IMETHODIMP nsPKCS11ModuleDB::GetIsFIPSModeActive(PRBool *aIsFIPSModeActive)
 
515
{
 
516
  return GetIsFIPSEnabled(aIsFIPSModeActive);
 
517
}