зеркало из https://github.com/mozilla/gecko-dev.git
FIPS library verifier.
This commit is contained in:
Родитель
691d3e25e1
Коммит
e7212afe42
|
@ -40,7 +40,7 @@ LIBRARY_NAME = softokn
|
|||
LIBRARY_VERSION = 3
|
||||
MAPFILE = $(OBJDIR)/softokn.def
|
||||
|
||||
DEFINES += -DSHLIB_SUFFIX=\"$(DLL_SUFFIX)\" -DSHLIB_PREFIX=\"$(DLL_PREFIX)\"
|
||||
DEFINES += -DSHLIB_SUFFIX=\"$(DLL_SUFFIX)\" -DSHLIB_PREFIX=\"$(DLL_PREFIX)\" -DSOFTOKEN_LIB_NAME=\"$(SHARED_LIBRARY)\"
|
||||
|
||||
|
||||
EXPORTS = \
|
||||
|
|
|
@ -2573,6 +2573,16 @@ CK_RV nsc_CommonInitialize(CK_VOID_PTR pReserved, PRBool isFIPS)
|
|||
int i;
|
||||
int moduleIndex = isFIPS? NSC_FIPS_MODULE : NSC_NON_FIPS_MODULE;
|
||||
|
||||
|
||||
if (isFIPS) {
|
||||
/* make sure that our check file signatures are OK */
|
||||
if (!BLAPI_VerifySelf(NULL) ||
|
||||
!BLAPI_SHVerify(SOFTOKEN_LIB_NAME, (PRFuncPtr) pk11_closePeer)) {
|
||||
crv = CKR_DEVICE_ERROR; /* better error code? checksum error? */
|
||||
return crv;
|
||||
}
|
||||
}
|
||||
|
||||
rv = RNG_RNGInit(); /* initialize random number generator */
|
||||
if (rv != SECSuccess) {
|
||||
crv = CKR_DEVICE_ERROR;
|
||||
|
|
Загрузка…
Ссылка в новой задаче