Renaming exported internal functions

RESOLVED FIXED in 3.2

Status

P1
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: wtc, Assigned: wtc)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

(Assignee)

Description

18 years ago
We have to export some internal functions from
the nss3 shared library for use by the ssl3 or
smime3 shared library.  We do not want our users
to use these internal functions that may change
or even be removed in a future NSS release.

One way to prevent users from using these exported
internal functions is to rename them.  My proposal
is to rename function Foo to __Foo, adding double
underscore in front of the function name.

The current list of functions that we want to rename
are:
CERT_NewTempCertificate;
nss_InitLock;
PK11_CreateContextByRawKey;
PK11_GetKeyData;

CERT_TraversePermCertsForNickname;
CERT_TraversePermCertsForSubject;
CERT_ClosePermCertDB;
CERT_DecodeDERCertificate;
HMAC_Begin;
HMAC_Create;
HMAC_Destroy;
HMAC_Finish;
HMAC_Update;
PBE_CreateContext;
PBE_DestroyContext;
PBE_GenerateBits;

Bob and Nelson think we should modify the pkcs12 code
to not use the HMAC functions.  Then we won't need to
export those HMAC symbols at all.
(Assignee)

Comment 1

18 years ago
Created attachment 23310 [details] [diff] [review]
Proposed patch.
(Assignee)

Comment 2

18 years ago
Created attachment 23312 [details]
New private header file mozilla/security/nss/lib/nss/nssrename.h.
(Assignee)

Comment 3

18 years ago
Please review my patch and the new nssrename.h header.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 3.2
(Assignee)

Updated

18 years ago
Priority: P2 → P1
(Assignee)

Comment 4

18 years ago
Created attachment 23753 [details] [diff] [review]
Revised patch.  (HMAC_ symbols are no longer exported.)
(Assignee)

Comment 5

18 years ago
Created attachment 23754 [details]
Revised nssrename.h.  (HMAC_ symbols are no longer exported.)

Comment 6

18 years ago
OK, these look good as well.

bob
(Assignee)

Comment 7

18 years ago
I decided to rename "nssrename.h" to "nssrenam.h" to follow
the 8.3 naming convention.

I checked in my latest patch on the tip, with the above change.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Assignee)

Comment 8

18 years ago
Created attachment 23865 [details]
A shell script to search for "evil functions" in a source tree.
(Assignee)

Comment 9

18 years ago
I found that some of the "evil functions" are being used
by our clients.  This work is not done.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 10

18 years ago
All known uses of the "evil" functions in our clients' code
have been removed.  Marked the bug as fixed.
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.