Closed
Bug 125728
Opened 23 years ago
Closed 23 years ago
Implement correct utf8 pkcs11 string truncation.
Categories
(NSS :: Libraries, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
3.4
People
(Reporter: ssaux, Assigned: rrelyea)
References
Details
Attachments
(1 file, 2 obsolete files)
1.99 KB,
patch
|
Details | Diff | Splinter Review |
pkcs11 string are currently lopped off at 32 or 64 bytes without regards to the
utf8 character boundary.
I discussed this with Bob Relyea and he agreed that NSS could include the
functionality in softoken/pkcs11.c::pk11_setStringName().
I have a patch.
Reporter | ||
Comment 1•23 years ago
|
||
Tested with: all ascii.
entering escaped unicode in pipnss.properties so that:
utf8 boundary results in a string of exactly 32 bytes.
utf8 boundary results in a string of exactly 31 bytes, in which case the the
32nd byte becomes a blank.
Reporter | ||
Comment 2•23 years ago
|
||
Attachment #69671 -
Attachment is obsolete: true
Assignee | ||
Comment 3•23 years ago
|
||
Comments on the patch:
'And' masking is more common and generally easier to read than 'or' masking:
(byte & 0xc0) == 0x80
rather than
(byte | 0x3f) == 0xbf.
A shift is even easier to read, though less efficient:
(byte >> 6) == 0x02.
The and and or are equal efficiency.
bob
Reporter | ||
Comment 4•23 years ago
|
||
Do you want a new patch?
Comment 5•23 years ago
|
||
Assigned the bug to Bob.
Yes, Stephane, please attach a new patch.
Assignee: wtc → relyea
Priority: -- → P1
Target Milestone: --- → 3.4
Reporter | ||
Comment 6•23 years ago
|
||
Attachment #69675 -
Attachment is obsolete: true
Assignee | ||
Comment 7•23 years ago
|
||
Stephan's fix is checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•