Closed Bug 262274 Opened 17 years ago Closed 17 years ago

visibility of PK11_GetCertFromPrivateKey and CERT_DecodeDERCertificate


(NSS :: Libraries, defect)

Not set


(Not tracked)



(Reporter: caolanm, Assigned: rrelyea)



(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040929
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040929 1.9.54 attempt to make use of PK11_GetCertFromPrivateKey and 
CERT_DecodeDERCertificate from OOo has patched their own build to
provide visible PK11_GetCertFromPrivateKey and CERT_DecodeDERCertificate symbols
by adding them to nss.def (e.g.

They are listed in the nss/pk11func.h and nss/cert.h headers. Should they be
visible from ? Or should use not be made of them from external
applications ? (mozilla 1.7.3)

Reproducible: Always
Steps to Reproduce:
1. compile something using PK11_GetCertFromPrivateKey &
CERT_DecodeDERCertificate from nss/pk11func.h and nss/cert.h
2. link against for PK11_GetCertFromPrivateKey &
Actual Results:  
fails to link

Expected Results:  
link happily
Bob, Nelson, could you look at this?  Is it okay
to export PK11_GetCertFromPrivateKey and

I remember we debated CERT_DecodeDERCertificate
when Nelson tried to make crmftest work again
(bug 244329. see also bug 243245).
Assignee: wchang0222 → rrelyea0264
Ever confirmed: true should not be using CERT_DecodeDERCertificate. The cert returned
from that function is not a 'complete' cert. Instead, import the cert as a temp

(if we separated the 'cert decoding' from the cert representation, then we could
crack a cert without importing it. Stan API's are designed to do that).

There is no reason not to export PK11_GetCertFromPrivateKey, however.

So if there's no reason not to export PK11_GetCertFromPrivateKey will it be
exported in a future release ?
Good point.

This patch puts the export in NSS 3.10. If we need it sooner I can supply a
separate patch that puts it in NSS 3.9.x, though I think we're trying to close
3.9.3 shortly?
Comment on attachment 162083 [details] [diff] [review]
Export PK11_GetCertFromPrivatekey

This is a simple change.  I can export the
function in NSS 3.9.3.	Any objections?

I plan to close NSS 3.9.3 today.
The 3.9 version of the patch.
Attached patch new 3.10 patch.Splinter Review
This patch also updates the 3.10 branch to be consistant with the 3.9.3 export
list. (there were two missing functions).

Since we plan to export this in 3.9.3, we need to move the export the 3.9.3
export block in our 3.10 patch
Attachment #162083 - Attachment is obsolete: true
Comment on attachment 162102 [details] [diff] [review]
3.9.3 version of patch (add PK11_GetCertFromPrivateKey

wtc: please review
Attachment #162102 - Flags: review?(wchang0222)
Comment on attachment 162103 [details] [diff] [review]
new 3.10 patch.

wtc please review
Attachment #162103 - Flags: review?(wchang0222)
Attachment #162102 - Flags: review?(wchang0222) → review+
Attachment #162103 - Flags: review?(wchang0222) → review+
This change doesn't have a compile issue since on NSS 3.10 pk11priv.h and
pk11pub.h are new and both are included in pk11func.h, but the current rules
are anything publically exported should be in a public header, so this change
is needed for cleanliness.

No equivalent change is needed in NSS 3.9.3 since all the functions are listed
in pk11func.h flat without any indication of which are public and which are

All the patches are checked into the appropriate branches. (including the header
change for NSS 3.10).

Marked the bug fixed.
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.9.3
You need to log in before you can comment on or make changes to this bug.