Localized certificate name is garbled, unable to send out signed/encrypted mail on a localized build

VERIFIED FIXED

Status

defect
VERIFIED FIXED
17 years ago
11 years ago

People

(Reporter: ji, Assigned: kaie)

Tracking

({intl, l12y})

Trunk
x86
Windows 2000
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [adt1 rtm])

Attachments

(3 attachments)

Reporter

Description

17 years ago
On a localized build, the translated certificate name is garbled on the
certificate list, the user can't send out signed or encrypted mail with that
certificate.

Steps to reproduce:
1. On a Japanese build, install a certificate.
2. Go to Mail account manager's Security pane
3. Click on Select button to select the installed certificate, you can see the
certificate's name is garbled on the list.
4. Compose the mail and send it out as a signed mail, an error comes up saying
the certificate is not found. 
A screen shot to follow.
Reporter

Comment 1

17 years ago
The translation is 
Xianglan Shirley JiのAmerican Online Inc (view this page in Japanese
(Shift-JIS))
Reporter

Comment 2

17 years ago
Nominating for nsbeta1.
Keywords: l12y, nsbeta1

Comment 3

17 years ago
Cc to putterman
Scott, I need help from mail group. Who is working on S/MIME?

Comment 4

17 years ago
nsbeta1+
Blocks: 141008
Keywords: nsbeta1intl, nsbeta1+

Comment 5

17 years ago
the certificate name is in pipness.properties:

nick_template=%1$s's %2$s ID
nick_template_with_num=%1$s's %2$s ID #%3$d

Comment 6

17 years ago
I looked at the code for the accout dialog but it just gets the string from
nsIUserCertPicker.

118 function smimeSelectCert(smime_cert)

http://lxr.mozilla.org/seamonkey/source/mailnews/extensions/smime/resources/content/am-smime.js#118

Reassign to putterman, please find a right owner for this.
Assignee: nhotta → putterman

Comment 7

17 years ago
It looks like mscott show the most on the cvsblame. 

Comment 8

17 years ago
reassgning to kaie.
Assignee: putterman → kaie
Assignee

Comment 9

17 years ago
For the first time, I tried Mozilla in japanese.

Question 1: When you say "a japanese build", do you just mean, a standard build
of Mozilla, that has the japanese language pack installed? I.e. should I be able
to see the problem, when I have a Mozilla 1.0.0 branch build, and install the
RC2 language pack from http://mozilla.org/projects/l10n/mlp_status.html ?

I did the above on my Linux system. I installed japanese fonts and was able to
select the UI, and it seems to work.

I started with an empty certificate database, installed my own corporate cert
from a p12 file backup.

Question 2: Did you do the same, i.e. restore from a cert p12 backup file? Or
did you obtain your certificate from the corporate certificates server?

When I do the above, and select the cert, I don't see a broken character. I am
able to send a signed message.
Assignee

Comment 10

17 years ago
Ji, in your comment 1, after "Xianglan Shirley Ji" and "American Online Inc"
what kind of character is that? Is that a part of your name in your certificate?
Does your name in your certificate contain a japanese character?
Reporter

Comment 11

17 years ago
Kai, please see my answer below:
>Question 1
I think you can install the language pack on your mozilla build, but please make
sure in that language pack, the following two strings are translated in
pipness.properties
nick_template=%1$s's %2$s ID
nick_template_with_num=%1$s's %2$s ID #%3$d

>Question 2
I obtained my certificate from the corporate certificates server

Between "Xianglan Shirley Ji" and "American Online Inc" that's the Japanese
translation of "'s" (the English string is "Xianglan Shirley Ji's American
Online Inc ID"), it's not part of my name, and it should be displayed correctly,
but now it's garbled.

Comment 12

17 years ago
Ying, could you put JA localized strings for nick_template and
nick_template_with_num.

I think replace those strings in pipness.properties and rebuild make the problem
reproducible on debug build.

Comment 13

17 years ago
Here it is!
Assignee

Comment 14

17 years ago
Ok, I found the problem.

When we install a certificate, we generate a nickname for it. That nickname is
allowed to be Unicode, get's converted to UTF-8 and is stored in the crypto
database.

However, when we read back the nickname (or any other certificate attributes)
from the crypto database, the code does an ASCII to Unicode conversion, instead
of converting from UTF-8 to Unicode.
Status: NEW → ASSIGNED
Whiteboard: [adt1 rtm]
Assignee

Comment 15

17 years ago
Posted patch Suggested FixSplinter Review
Javi, can you please review?
Assignee

Comment 16

17 years ago
FYI, I was able to reproduce the problem, using english strings, only replacing
the nick_template strings with the japanese translation. I saw the failure. The
patch fixes the problem for me.

Luckily we don't have corrupt data in the crypto database. To fix the problem
with the patch applied, it is sufficient to go to mail security preferences, and
select the certificate once again. After doing so I was able to send a signed
message.

Comment 17

17 years ago
Comment on attachment 83979 [details] [diff] [review]
Suggested Fix

i'll go ahead and sr this now since the change is so straight forward.

sr=mscott
pending Javi's module owner review of course.
Attachment #83979 - Flags: superreview+

Comment 18

17 years ago
Comment on attachment 83979 [details] [diff] [review]
Suggested Fix

r=javi
Attachment #83979 - Flags: review+
Assignee

Comment 19

17 years ago
Checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: adt1.0.0
Resolution: --- → FIXED
Reporter

Comment 20

17 years ago
Verified as fixed with 05/17 build by replacing pipnss.properties file with the
translated one in Ja build. The translated certificate is displayed correctly
and I can send out signed and encrypted mail by using that certificate.
Status: RESOLVED → VERIFIED

Updated

17 years ago
Keywords: approval

Comment 21

17 years ago
adding adt1.0.0+ for checkin to the 1.0 branch.  Please get drivers approval
before checking into the branch.
Keywords: adt1.0.0adt1.0.0+
Assignee

Comment 22

17 years ago
I received approval from endico by email and IRC.

Checked in to branch.
Keywords: adt1.0.0+fixed1.0.0

Updated

17 years ago
Blocks: 146292
No longer blocks: 141008
Reporter

Comment 23

17 years ago
Verified as fixed with 06/03 branch build by replacing pipnss.properties file
with the translated one in Ja build
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.