-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Darwin] add API to get public key without leaks (with fixes) #36340
base: master
Are you sure you want to change the base?
Conversation
PR #36340: Size comparison from b0cc28a to d5bfe8d Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Co-authored-by: Boris Zbarsky <[email protected]>
…onal method calls
it's a test; this is the best we can do with an optional protocol method
remove comment - not this method's job to worry about other implementation's potential side-effects
Co-authored-by: Boris Zbarsky <[email protected]>
PR #36340: Size comparison from f3a9fe9 to 47e264a Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
check compatibility in CI before going back and removing
PR #36340: Size comparison from f3a9fe9 to 8dbbcaa Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36340: Size comparison from f3a9fe9 to d328eaf Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36340: Size comparison from 50ad31c to fbbd06a Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36340: Size comparison from 62a4a97 to fdbd53c Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm
Outdated
Show resolved
Hide resolved
SecKeyRef originalKeyRef = [testKeys publicKey]; | ||
SecKeyRef originalKeyRef; | ||
if ([testKeys respondsToSelector:@selector(copyPublicKey)]) { | ||
originalKeyRef = [testKeys copyPublicKey]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also looks like a leak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(added CFAutorelease(originalKeyRef);
below - it has been a while, scrutiny welcome)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(specifically: is manual creation of NSAutoreleasePool
or use of @autoreleasepool
merited here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to nil check CFAutorelease, please just use [object autorelease] per our chat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Otherwise you have a crash here potentially)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(discussing)
@@ -277,7 +293,7 @@ - (void)testGenerateOperationalCertNoIntermediateWithValidityPeriod | |||
|
|||
__auto_type * operationalCert = [MTRCertificates createOperationalCertificate:rootKeys | |||
signingCertificate:rootCert | |||
operationalPublicKey:operationalKeys.publicKey | |||
operationalPublicKey:operationalPublicKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not copy autorelease this? Makes for much easier code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(discussing)
PR #36340: Size comparison from 62a4a97 to a761b1c Increases above 0.2%:
Full report (67 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
reverted because mergify landed it with failing checks...?
CFAutorelease
on CoreFoundation typed public key copiescopyPublicKey
forMTRTestKeys
; add TODO note about optional method callscopyPublicKey
callscopyPublicKey
inMTRTestKeys