RESOLVED FIXED 175657
[WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKey for exporting ECC JWKs
https://bugs.webkit.org/show_bug.cgi?id=175657
Summary [WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKe...
Jiewen Tan
Reported 2017-08-16 21:49:28 PDT
For unknown reasons, CCECCryptorGetKeyComponents sometimes output wrong values. Hence, we need to replace it with CCECCryptorGetKeyComponents for reliable outputs.
Attachments
Patch (18.79 KB, patch)
2017-08-17 12:41 PDT, Jiewen Tan
bfulgham: review+
bfulgham: commit-queue-
Patch for landing (18.79 KB, patch)
2017-08-18 12:32 PDT, Jiewen Tan
no flags
Jiewen Tan
Comment 1 2017-08-16 21:49:49 PDT
Jiewen Tan
Comment 2 2017-08-17 12:41:23 PDT
Brent Fulgham
Comment 3 2017-08-18 09:14:42 PDT
Comment on attachment 318401 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318401&action=review I think this looks good, but I would prefer you revise the return code as I outlined above. r=me assuming you make the changes I suggest. > Source/WebCore/crypto/keys/CryptoKeyEC.cpp:149 > + return Exception { OperationError }; I think this would be clearer if you did the early return for the failure case, rather than success. I also think this would be clearer (use 'isEmpty()' rather than a zero-check for size()) if (result.isEmpty()) return Exception { OperationError }; return WTFMove(result); > Source/WebCore/crypto/keys/CryptoKeyEC.cpp:168 > + return Exception { OperationError }; Ditto the early-return case. > Source/WebCore/crypto/keys/CryptoKeyEC.cpp:179 > + return Exception { OperationError }; Ditto. > Source/WebCore/crypto/keys/CryptoKeyEC.cpp:190 > + return Exception { OperationError }; Ditto.
Jiewen Tan
Comment 4 2017-08-18 12:28:43 PDT
Comment on attachment 318401 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318401&action=review Thanks Brent for r+ my patch. >> Source/WebCore/crypto/keys/CryptoKeyEC.cpp:149 >> + return Exception { OperationError }; > > I think this would be clearer if you did the early return for the failure case, rather than success. > > I also think this would be clearer (use 'isEmpty()' rather than a zero-check for size()) > > if (result.isEmpty()) > return Exception { OperationError }; > > return WTFMove(result); Fixed. >> Source/WebCore/crypto/keys/CryptoKeyEC.cpp:168 >> + return Exception { OperationError }; > > Ditto the early-return case. Fixed. >> Source/WebCore/crypto/keys/CryptoKeyEC.cpp:179 >> + return Exception { OperationError }; > > Ditto. Fixed. >> Source/WebCore/crypto/keys/CryptoKeyEC.cpp:190 >> + return Exception { OperationError }; > > Ditto. Fixed.
Jiewen Tan
Comment 5 2017-08-18 12:32:58 PDT
Created attachment 318528 [details] Patch for landing
WebKit Commit Bot
Comment 6 2017-08-18 14:30:49 PDT
Comment on attachment 318528 [details] Patch for landing Clearing flags on attachment: 318528 Committed r220933: <http://trac.webkit.org/changeset/220933>
Note You need to log in before you can comment on or make changes to this bug.