Closed Bug 672828 Opened 14 years ago Closed 11 years ago

PK11_PubDeriveWithKDF does not call PORT_SetError when returning NULL due to unrecognized key type

Categories

(NSS :: Libraries, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
3.16.1

People

(Reporter: briansmith, Assigned: Cykesiopka)

Details

Attachments

(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #668397 +++ See: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/security/nss/lib/pk11wrap/pk11skey.c&rev=1.122&mark=1898,1905,1907,1912-1913,1918#1897 I believe the whole function body can be replaced with: return privKey->keyType == ecKey ? pk11_PubDeriveECKeyWithKDF(privKey, pubKey, isSender, randomA, randomB, derive, target, operation, keySize, kdf, sharedData, wincx) : PK11_PubDerive(privKey, pubKey, isSender, randomA, randomB, derive, target, operation, keySize, wincx);
Attached patch bug672828_v1.patch (obsolete) — Splinter Review
Patch for the change described in Comment 0.
Attachment #8395443 - Flags: review?(ryan.sleevi)
Comment on attachment 8395443 [details] [diff] [review] bug672828_v1.patch Review of attachment 8395443 [details] [diff] [review]: ----------------------------------------------------------------- Use PORT_SetError(SEC_ERROR_BAD_KEY) in the default case.
Attachment #8395443 - Flags: review?(ryan.sleevi) → review-
Comment on attachment 8395443 [details] [diff] [review] bug672828_v1.patch Review of attachment 8395443 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/pk11wrap/pk11skey.c @@ +2221,5 @@ > + target, operation, keySize, > + kdf, sharedData, wincx) > + : PK11_PubDerive(privKey, pubKey, isSender, randomA, > + randomB, derive, target, operation, > + keySize, wincx); Also, using the ? : operator for such a complicated expression makes the code harder to read.
(In reply to Wan-Teh Chang from comment #3) > Comment on attachment 8395443 [details] [diff] [review] > bug672828_v1.patch > > Review of attachment 8395443 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: lib/pk11wrap/pk11skey.c > @@ +2221,5 @@ > > + target, operation, keySize, > > + kdf, sharedData, wincx) > > + : PK11_PubDerive(privKey, pubKey, isSender, randomA, > > + randomB, derive, target, operation, > > + keySize, wincx); > > Also, using the ? : operator for such a complicated expression > makes the code harder to read. Noted, thanks.
+ Use PORT_SetError(SEC_ERROR_BAD_KEY) in the default case
Assignee: nobody → cykesiopka.bmo
Attachment #8395443 - Attachment is obsolete: true
Attachment #8396165 - Flags: review?(ryan.sleevi)
Attachment #8396165 - Flags: review?(ryan.sleevi) → review+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.16.1
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: