Bug 124483

Summary: Support exporting private WebCrypto RSA keys
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebCore Misc.Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 122679    
Attachments:
Description Flags
proposed patch andersca: review+

Alexey Proskuryakov
Reported 2013-11-18 00:43:33 PST
The difficulty here is that CommonCrypto functions don't expose all key parts necessary for JWK, so we'll need to compute them from prime factors manually.
Attachments
proposed patch (15.59 KB, patch)
2013-12-03 12:10 PST, Alexey Proskuryakov
andersca: review+
Alexey Proskuryakov
Comment 1 2013-12-03 12:10:58 PST
Created attachment 218322 [details] proposed patch
Anders Carlsson
Comment 2 2013-12-03 12:13:25 PST
Comment on attachment 218322 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=218322&action=review > Source/WebCore/crypto/CommonCryptoUtilities.cpp:82 > + RELEASE_ASSERT(!status); I’d rather assert status == kCCSuccess here (and all the other places).
WebKit Commit Bot
Comment 3 2013-12-03 12:13:30 PST
Attachment 218322 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt', u'LayoutTests/crypto/subtle/rsa-export-private-key.html', u'Source/WebCore/ChangeLog', u'Source/WebCore/crypto/CommonCryptoUtilities.cpp', u'Source/WebCore/crypto/CommonCryptoUtilities.h', u'Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp']" exit_code: 1 ERROR: Source/WebCore/crypto/CommonCryptoUtilities.cpp:32: Missing spaces around / [whitespace/operators] [3] ERROR: Source/WebCore/crypto/CommonCryptoUtilities.h:100: Missing spaces around && [whitespace/operators] [3] ERROR: Source/WebCore/crypto/CommonCryptoUtilities.h:102: Missing spaces around && [whitespace/operators] [3] Total errors found: 3 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alexey Proskuryakov
Comment 4 2013-12-03 12:15:37 PST
Alexey Proskuryakov
Comment 5 2013-12-03 12:16:53 PST
> I’d rather assert status == kCCSuccess here (and all the other places). These pretty much only fail on out of memory conditions, which is normally a release assert for us.
Alexey Proskuryakov
Comment 6 2013-12-03 12:18:18 PST
Or did you mean a RELEASE_ASSERT in a different form? I personally prefer "status == kCCSuccess" too, but I don't think we ever do that for other types.
Anders Carlsson
Comment 7 2013-12-03 12:19:01 PST
(In reply to comment #6) > Or did you mean a RELEASE_ASSERT in a different form? I personally prefer "status == kCCSuccess" too, but I don't think we ever do that for other types. I mean i like the condition to be (status == kCCSuccess) as opposed to (!status) since it’s not clear (to me anyway) that kCCSuccess is 0.
Note You need to log in before you can comment on or make changes to this bug.