summaryrefslogtreecommitdiff
path: root/security/nss/lib/dev
diff options
context:
space:
mode:
authorjpierre%netscape.com <devnull@localhost>2002-05-20 23:21:39 +0000
committerjpierre%netscape.com <devnull@localhost>2002-05-20 23:21:39 +0000
commitbc5bc84311131c17cb5dbfca648bab63911b97b2 (patch)
tree5dcc6dab54dfb5fce7a2683a171887aa4b197ecb /security/nss/lib/dev
parent82694ac0631b01f21596a78a598a96c870663a03 (diff)
downloadnss-hg-bc5bc84311131c17cb5dbfca648bab63911b97b2.tar.gz
Fix for bug 137645 - cached certificate does not get its nickname updated after P12 import of matching user certificate
Diffstat (limited to 'security/nss/lib/dev')
-rw-r--r--security/nss/lib/dev/devm.h2
-rw-r--r--security/nss/lib/dev/devtoken.c9
-rw-r--r--security/nss/lib/dev/devutil.c3
3 files changed, 7 insertions, 7 deletions
diff --git a/security/nss/lib/dev/devm.h b/security/nss/lib/dev/devm.h
index 69ec759ec..0dd0d5b36 100644
--- a/security/nss/lib/dev/devm.h
+++ b/security/nss/lib/dev/devm.h
@@ -208,7 +208,7 @@ nssTokenObjectCache_ImportObject
CK_ULONG otlen
);
-NSS_EXTERN PRStatus
+NSS_EXTERN void
nssTokenObjectCache_RemoveObject
(
nssTokenObjectCache *cache,
diff --git a/security/nss/lib/dev/devtoken.c b/security/nss/lib/dev/devtoken.c
index 70f552d4b..a43ed43f4 100644
--- a/security/nss/lib/dev/devtoken.c
+++ b/security/nss/lib/dev/devtoken.c
@@ -282,7 +282,7 @@ nssToken_DeleteStoredObject
nssSession *session = NULL;
void *epv = nssToken_GetCryptokiEPV(instance->token);
if (token->cache) {
- status = nssTokenObjectCache_RemoveObject(token->cache, instance);
+ nssTokenObjectCache_RemoveObject(token->cache, instance);
}
if (instance->isTokenObject) {
if (nssSession_IsReadWrite(token->defaultSession)) {
@@ -301,9 +301,7 @@ nssToken_DeleteStoredObject
if (createdSession) {
nssSession_Destroy(session);
}
- if (ckrv != CKR_OK) {
- return PR_FAILURE;
- }
+ status = (ckrv == CKR_OK) ? PR_SUCCESS : PR_FAILURE;
return status;
}
@@ -592,6 +590,9 @@ nssToken_ImportCertificate
nssCKObject_SetAttributes(rvObject->handle,
cert_tmpl, ctsize,
session, slot);
+ if (!rvObject->label && nickname) {
+ rvObject->label = nssUTF8_Duplicate(nickname, NULL);
+ }
nssSession_Destroy(session);
nssSlot_Destroy(slot);
} else {
diff --git a/security/nss/lib/dev/devutil.c b/security/nss/lib/dev/devutil.c
index 6e82574e7..99218f83d 100644
--- a/security/nss/lib/dev/devutil.c
+++ b/security/nss/lib/dev/devutil.c
@@ -1370,7 +1370,7 @@ nssTokenObjectCache_ImportObject
return status;
}
-NSS_IMPLEMENT PRStatus
+NSS_IMPLEMENT void
nssTokenObjectCache_RemoveObject
(
nssTokenObjectCache *cache,
@@ -1408,7 +1408,6 @@ nssTokenObjectCache_RemoveObject
cache->objects[oType] = NULL;
}
PZ_Unlock(cache->lock);
- return PR_SUCCESS;
}
/* XXX of course this doesn't belong here */