Closed
Bug 518457
Opened 16 years ago
Closed 16 years ago
SECKEY_EncodeDERSubjectPublicKeyInfo and PK11_DEREncodePublicKey are duplicate
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
3.12.5
People
(Reporter: wtc, Assigned: wtc)
References
Details
Attachments
(2 files)
|
1.23 KB,
patch
|
rrelyea
:
review+
nelson
:
review+
|
Details | Diff | Splinter Review |
|
2.45 KB,
patch
|
Details | Diff | Splinter Review |
SECKEY_EncodeDERSubjectPublicKeyInfo and PK11_DEREncodePublicKey
have the same function prototypes and implementations (except
that PK11_DEREncodePublicKey has a leak, see bug 518446).
We should implement one by calling the other to reduce duplicate
code. Since lib/cryptohi appears to be at a higher layer than
lib/pk11wrap, I decided to have SECKEY_EncodeDERSubjectPublicKeyInfo
call PK11_DEREncodePublicKey.
Attachment #402456 -
Flags: review?(rrelyea)
Comment 1•16 years ago
|
||
Comment on attachment 402456 [details] [diff] [review]
Proposed patch
r=nelson.
The PK11 implementation is much cleaner, too.
Attachment #402456 -
Flags: review+
| Assignee | ||
Comment 2•16 years ago
|
||
Nelson, thanks for the code review. The two implementations
are copies of each other because the comments and coding styles
are exactly the same.
Updated•16 years ago
|
Attachment #402456 -
Flags: review?(rrelyea) → review+
| Assignee | ||
Comment 3•16 years ago
|
||
I checked in the patch on the NSS trunk (NSS 3.12.5).
Checking in seckey.c;
/cvsroot/mozilla/security/nss/lib/cryptohi/seckey.c,v <-- seckey.c
new revision: 1.50; previous revision: 1.49
done
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.12.5
| Assignee | ||
Comment 4•16 years ago
|
||
On closer inspection, I think it's better to let
SECKEY_EncodeDERSubjectPublicKeyInfo have the
real implementation because the symmetric function
SECKEY_DecodeDERSubjectPublicKeyInfo exists. This
allows us to contrast the Encode and Decode code.
pk11akey.c already includes keyhi.h (via key.h),
which includes keyhi.h, so it's fine for
PK11_DEREncodePublicKey to call
SECKEY_EncodeDERSubjectPublicKeyInfo.
Checking in cryptohi/seckey.c;
/cvsroot/mozilla/security/nss/lib/cryptohi/seckey.c,v <-- seckey.c
new revision: 1.51; previous revision: 1.50
done
Checking in pk11wrap/pk11akey.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11akey.c,v <-- pk11akey.c
new revision: 1.29; previous revision: 1.28
done
You need to log in
before you can comment on or make changes to this bug.
Description
•