Open Bug 294554 Opened 20 years ago Updated 2 years ago

unexported api calls in p12.h

Categories

(NSS :: Libraries, defect, P2)

3.10

Tracking

(Not tracked)

People

(Reporter: jason.m.reid, Unassigned)

Details

Attachments

(1 obsolete file)

The following api calls in p12.h are not found in a .def file.

SEC_PKCS12CreatePubKeyEncryptedSafe NOT exported
SEC_PKCS12AddPublicKeyIntegrity NOT exported
SEC_PKCS12AddKeyForCert NOT exported
SEC_PKCS12AddDERCertAndEncryptedKey NOT exported
SEC_PKCS12CreateNestedSafeContents NOT exported
QA Contact: bishakhabanerjee → jason.m.reid
Assignee: wtchang → nobody
QA Contact: jason.m.reid → libraries
So, we need to decide:
a) are these functions intended to be "public"? 

then if so, we need to add them to the relevant .def file,
and if not, we need to move these declarations to another file, or 
enclose them in an #ifdef with some symbol like PKCS12_private.
Assignee: nobody → neil.williams
OS: Linux → All
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → 3.11.2
Retargetting all P2s to 3.11.3 .
Target Milestone: 3.11.2 → 3.11.3
Target Milestone: 3.11.3 → 3.11.8
Moved declarations of 7 PKCS12 functions from distributed .h files into p12local.h. Added 3 function to smime.def since they pertain to testing PFX algorithms.
Attachment #271306 - Flags: review?(nelson)
(In reply to comment #3)
> Created an attachment (id=271306) [details]
> move non-exported pkcs12 functions to p12local.h
> 
> Moved declarations of 7 PKCS12 functions from distributed .h files into
> p12local.h. Added 3 function to smime.def since they pertain to testing PFX
> algorithms.
> 
This patch applies to bug # 294555 and bug # 294557 as well.
Comment on attachment 271306 [details] [diff] [review]
move non-exported pkcs12 functions to p12local.h

SEC_PKCS12CreatePubKeyEncryptedSafe is dead code.
SEC_PKCS12AddPublicKeyIntegrity     is dead code.
SEC_PKCS12AddDERCertAndEncryptedKey is dead code.
SEC_PKCS12CreateNestedSafeContents  is dead code.

SEC_PKCS12AddKeyForCert is called from SEC_PKCS12AddCertAndKey, an exported 
public function.

We should get completely rid of dead code.  Don't just delete the declarations
from the public header files, but get rid of the functions themselves.
For the one other function, I suggest exporting it.  It's in use, so it is 
tested.  It was clearly intended to be part of the public API, so might as
well export it.

This patch also makes changes for other bugs.  I would prefer if separate
patches were made for each of those bugs.
Attachment #271306 - Flags: review?(nelson) → review-
Comment on attachment 271306 [details] [diff] [review]
move non-exported pkcs12 functions to p12local.h

On further examination it makes better sense to patch each bug separately rather than lump them together in this patch.
Attachment #271306 - Attachment is obsolete: true
Attachment #271306 - Flags: review-
Bug 314331(In reply to comment #5)
> (From update of attachment 271306 [details] [diff] [review])
> SEC_PKCS12CreatePubKeyEncryptedSafe is dead code.
> SEC_PKCS12AddPublicKeyIntegrity     is dead code.

Let's call them infant code. They code looks reasonable and bug 314331 was opened about testing pub key encrypted p12 files and testing these routines would be part of that effort.

> SEC_PKCS12AddDERCertAndEncryptedKey is dead code.

I agree this one is dead.

> SEC_PKCS12CreateNestedSafeContents  is dead code.
> 
> SEC_PKCS12AddKeyForCert is called from SEC_PKCS12AddCertAndKey, an exported 
> public function.
> 
> ...
> This patch also makes changes for other bugs.  I would prefer if separate
> patches were made for each of those bugs.  
> 
Done. Partly because bug 294557 has 3 files worth of dead code, whereas, with this bug, I think we should leave the source for the pub key functions in and export them when I can get around to bug 314331.

Status: NEW → ASSIGNED
Assignee: neil.williams → nobody
Status: ASSIGNED → NEW
Target Milestone: 3.11.8 → ---
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: