Closed Bug 142867 Opened 22 years ago Closed 21 years ago

pk12util always imports CA certs into softoken

Categories

(NSS :: Tools, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: rrelyea)

References

Details

Attachments

(1 file, 2 obsolete files)

Even if a hardware token is specified on the pk12util command-line, CA certs are 
always imported into softoken. Since is is currently not possible to import CA 
certs into a hardware token due to a limitation in NSS APIs, we should at least 
display an message stating so rather than try and succeed importing the 
certificate into the wrong token.
Depends on: 142866
Priority: -- → P2
Depends on: 142889
No longer depends on: 142889
Target Milestone: --- → 3.6
Assigned the bug to Bob.
Assignee: wtc → relyea
Target Milestone: 3.6 → 3.7
Moved to target milestone 3.8 because the original
NSS 3.7 release has been renamed 3.8.
Target Milestone: 3.7 → 3.8
I see at least one problem with this patch.  The function SECOID_AddEntry is
declared in secoid.h as returning a type SECOidTab, but the actual definition 
of the function in secoid.c returns a SECStatus.  I'm surprised your compiler
didn't generate an error for this.
Nelson, following up on your comment #4, please see bug 171084 .
Comment on attachment 116592 [details] [diff] [review]
Import Intermediate CA's into token from the pkcs12 file.

This doesn't need C++ to catch it.  I believe many c implementations will
detect it, just not the one Bob apparently used.
Attachment #116592 - Flags: review-
There is a completely different problem. This patch is not for this bug. 

bob
This patch is for bug 196360 . I've attached an update. Note that the function
is returning OidTags, even though it's locally declared to return SECStatus. The
compilier that didn't even generate any warnings! is the Windows compiler. I'll
attach the real patch for this bug just now...
This is the correct patch for this particular bug.
Attachment #116592 - Attachment is obsolete: true
Attachment #117089 - Flags: superreview?(nelsonb)
Attachment #117089 - Flags: review?(jpierre)
This patch includes changes to file pk11sdr.c that do not appear to be 
related to this bug.  Am I right that that change is unrelated?  
What bug does that change apply to? 
Yes, those changes are related to bug 168398.
Comment on attachment 117089 [details] [diff] [review]
Import Intermediate CA's into token from the pkcs12 file.

Code looks good. I didn't test it because my hardware token isn't functional
right now.
Attachment #117089 - Flags: review?(jpierre) → review+
Regarding patch id=117089, This seems like it will work at intended, but in
reviewing it, I found the use of the term "locale" confusing because that 
term commonly refers to character sets and localization of strings.  
The names of the enumerated constants were meaningful to me until I read 
the comments in the declaration.

I think these variable and type names might be easier to name if they described
what CAs (if any) go into the target token.  I suggest calling the type 
SECPKCS12TargetTokenCAs, and the values

SECPKCA12TargetTokenNoCAs,
SECPKCS12TargetTokenIntermediateCAs
SECPKCS12TargetTokenAllCAs

and the function that sets this variable be SEC_PKCS12DecoderSetTargetTokenCAs.
If those names are too long, perhaps you could drop Target or Token from them.
I like nelson's names better than mine... I'll attach an updated patch (I really
didn't like locale either for much the same reasons...)

bob
Same patch as before except 1) removed code from a different bug, 2) renamed
variables as nelson suggested.
Attachment #117089 - Attachment is obsolete: true
*** Bug 142889 has been marked as a duplicate of this bug. ***
Attachment #117089 - Flags: superreview?(nelsonb) → superreview-
Comment on attachment 118104 [details] [diff] [review]
Import CAs into PKCS 12 token

r=nbb
Attachment #118104 - Flags: review+
Final patch checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: