Closed Bug 129756 Opened 23 years ago Closed 23 years ago

PK11_SetObjectNickname is broken

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jamie-bugzilla, Assigned: jamie-bugzilla)

Details

Attachments

(1 file, 2 obsolete files)

1) It incorrectly sets len = strlen(nickname)-1. It should just set len=strlen(nickname). 2) It doesn't acquire a read-write session on the slot. So the operation fails when it tries to set the label on a token object. I'll attach a patch that addresses these two problems.
Attached patch proposed patch (obsolete) — Splinter Review
This patch does two things. 1) Sets the length of the attribute correctly to be the strlen() of the nickname. 2) Obtains a read-write session so it can write to token objects.
Adding wtc to the CC list. Bob, can you please review the patch?
Comment on attachment 73294 [details] [diff] [review] proposed patch The PK11_EnterSlotMonitor and PK11_ExitSlotMonitor calls in this patch are not matched. I guess the PK11_EnterSlotMonitor call also needs to be deleted?
Attachment #73294 - Flags: needs-work+
Attached patch remove the EnterSlotMonitor call (obsolete) — Splinter Review
wtc is right. PK11_GetRWSession should replace PK11_EnterSlotMonitor.
Comment on attachment 73322 [details] [diff] [review] remove the EnterSlotMonitor call This patch still has the extra PK11_ExitSlotMonitor in the error path (which is really a bug in the original code). Other than that it is fine.
Attachment #73322 - Flags: needs-work+
Attached patch proposed patchSplinter Review
Doh! This time, for sure.
Attachment #73294 - Attachment is obsolete: true
Attachment #73322 - Attachment is obsolete: true
Comment on attachment 73607 [details] [diff] [review] proposed patch ok r=relyea
Attachment #73607 - Flags: review+
Checked in to trunk for NSS 3.4. /cvsroot/mozilla/security/nss/lib/pk11wrap/pk11slot.c,v <-- pk11slot.c new revision: 1.33; previous revision: 1.32
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Set target milestone to NSS 3.4.
Target Milestone: --- → 3.4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: