PK11_ImportDERPrivateKeyInfo should return a SECKEYPrivateKey*

RESOLVED FIXED in 3.4

Status

NSS
Libraries
P1
normal
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Jamie Nicolson, Assigned: Robert Relyea)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
If I call PK11_ImportDERPrivateKeyInfo, I should get back a pointer to the key I just created so I don't have to go hunting for it. This is especially true for JCA, where we will always want to get a pointer to a key after we import it.
(Reporter)

Updated

17 years ago
Blocks: 112882
Target Milestone: --- → 3.4
(Reporter)

Comment 1

17 years ago
Created attachment 61160 [details] [diff] [review]
proposed patch

Add one private and two public functions to NSS.

PK11_ImportAndReturnPrivateKey(private)
PK11_ImportPrivateKeyInfoAndReturnKey(public)
PK11_ImportDERPrivateKeyInfoAndReturnKey(public)

These functions supplement three existing functions whose names are the same as
above without "AndReturnKey". The existing functions have been reimplemented to
call the new functions.

The new functions simply take an extra argument, a SECKEYPrivateKey**. If not
NULL, it will be pointed at the new private key that was imported. The old
functions got as far as recovering the PKCS #11 object ID of the new key, then
simply threw it away. The new functions go the extra step of wrapping the
object ID and slot in a SECKEYPrivateKey*.
(Reporter)

Comment 2

17 years ago
Created attachment 61161 [details] [diff] [review]
proposed patch

Add one private and two public functions to NSS.

PK11_ImportAndReturnPrivateKey(private)
PK11_ImportPrivateKeyInfoAndReturnKey(public)
PK11_ImportDERPrivateKeyInfoAndReturnKey(public)

These functions supplement three existing functions whose names are the same as
above without "AndReturnKey". The existing functions have been reimplemented to
call the new functions.

The new functions simply take an extra argument, a SECKEYPrivateKey**. If not
NULL, it will be pointed at the new private key that was imported. The old
functions got as far as recovering the PKCS #11 object ID of the new key, then
simply threw it away. The new functions go the extra step of wrapping the
object ID and slot in a SECKEYPrivateKey*.
(Assignee)

Comment 3

17 years ago
looks OK Jamie, though I would have liked to see the public function return the
key as a parameter rather than return it as a parameter.

The implementation is fine. (it's okay for the internal function to take the
parameter so we don't allocate a new key when we don't need it).

bob

Updated

17 years ago
Priority: -- → P1
(Reporter)

Comment 4

17 years ago
Committed to trunk.

/cvsroot/mozilla/security/nss/lib/nss/nss.def,v  <--  nss.def
new revision: 1.44; previous revision: 1.43
done
Checking in pk11wrap/pk11func.h;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11func.h,v  <--  pk11func.h
new revision: 1.21; previous revision: 1.20
done
Checking in pk11wrap/pk11pk12.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11pk12.c,v  <--  pk11pk12.c
new revision: 1.3; previous revision: 1.2
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.