Closed Bug 1234417 Opened 4 years ago Closed 4 years ago
ECPublic Key leaks a reference to the internal PKCS#11 slot
58 bytes, text/x-review-board-request
CreateECPublicKey creates a SECKEYPublicKey allocated on a scoped arena. It then calls CryptoKey::PublicKeyValid, which has the side-effect of importing the key to the internal PKCS#11 slot. When the arena goes out of scope, the memory for the key is released, but the reference to the slot isn't, causing a leak. (This can be reproduced by running `NSPR_LOG_MODULES=pipnss:5 ./mach xpcshell-test dom/push/test/xpcshell/test_notification_data.js` and observing the string "NSS SHUTDOWN FAILURE" in the output.)
Review commit: https://reviewboard.mozilla.org/r/28905/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/28905/
Attachment #8701142 - Flags: review?(rlb)
Comment on attachment 8701142 [details] MozReview Request: bug 1234417 - fix a leak in CreateECPublicKey r?rbarnes LGTM. I wrote it but I think I can't give r+.
Attachment #8701142 - Flags: feedback+
Comment on attachment 8701142 [details] MozReview Request: bug 1234417 - fix a leak in CreateECPublicKey r?rbarnes https://reviewboard.mozilla.org/r/28905/#review25887 LGTM. Thanks for the catch, Keeler!
Attachment #8701142 - Flags: review?(rlb) → review+
You need to log in before you can comment on or make changes to this bug.