зеркало из https://github.com/mozilla/pjs.git
This fix some of the 64 bit issues.
This commit is contained in:
Родитель
103d24e5e9
Коммит
dce14e66de
|
@ -85,6 +85,8 @@ lg_NewObjectCache(SDB *sdb, const SECItem *dbKey, CK_OBJECT_HANDLE handle)
|
|||
obj->sdb = sdb;
|
||||
obj->objectInfo = NULL;
|
||||
obj->infoFree = NULL;
|
||||
obj->dbKey.data = NULL;
|
||||
obj->dbKey.len = 0;
|
||||
lg_DBLock(sdb);
|
||||
if (dbKey == NULL) {
|
||||
dbKey = lg_lookupTokenKeyByHandle(sdb,handle);
|
||||
|
|
|
@ -66,6 +66,7 @@ lg_createCertObject(SDB *sdb, CK_OBJECT_HANDLE *handle,
|
|||
char *label = NULL;
|
||||
char *email = NULL;
|
||||
SECStatus rv;
|
||||
CK_RV crv;
|
||||
PRBool inDB = PR_TRUE;
|
||||
NSSLOWCERTCertDBHandle *certHandle = lg_getCertDB(sdb);
|
||||
NSSLOWKEYDBHandle *keyHandle = NULL;
|
||||
|
@ -78,9 +79,10 @@ lg_createCertObject(SDB *sdb, CK_OBJECT_HANDLE *handle,
|
|||
}
|
||||
|
||||
/* We only support X.509 Certs for now */
|
||||
attribute = lg_FindAttribute(CKA_CERTIFICATE_TYPE, templ, count);
|
||||
if (attribute == NULL) return CKR_TEMPLATE_INCOMPLETE;
|
||||
type = *(CK_CERTIFICATE_TYPE *)attribute->pValue;
|
||||
crv = lg_GetULongAttribute(CKA_CERTIFICATE_TYPE, templ, count, &type);
|
||||
if (crv != CKR_OK) {
|
||||
return crv;
|
||||
}
|
||||
|
||||
if (type != CKC_X_509) {
|
||||
return CKR_ATTRIBUTE_VALUE_INVALID;
|
||||
|
|
|
@ -226,7 +226,7 @@ lg_GetULongAttribute(CK_ATTRIBUTE_TYPE type, const CK_ATTRIBUTE *templ,
|
|||
attribute = lg_FindAttribute(type, templ, count);
|
||||
if (attribute == NULL) return CKR_TEMPLATE_INCOMPLETE;
|
||||
|
||||
if (attribute->ulValueLen != sizeof(CK_ULONG)) {
|
||||
if (attribute->ulValueLen != 4) {
|
||||
return CKR_ATTRIBUTE_VALUE_INVALID;
|
||||
}
|
||||
data = (const unsigned char *)attribute->pValue;
|
||||
|
|
Загрузка…
Ссылка в новой задаче