Bug 124466 - Use uint8_t vectors for WebCrypto data
Summary: Use uint8_t vectors for WebCrypto data
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks: 122679
  Show dependency treegraph
 
Reported: 2013-11-16 23:57 PST by Alexey Proskuryakov
Modified: 2013-11-17 13:39 PST (History)
3 users (show)

See Also:


Attachments
proposed patch (47.45 KB, patch)
2013-11-17 00:14 PST, Alexey Proskuryakov
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2013-11-16 23:57:35 PST
Using Vector<char> for key data is somewhat non-idiomatic, and it gets simply dangerous for bignums, because signed arithmetic is not appropriate for bignum digits.

There is no good way to move data between Vector<char> and Vector<uint8_t>, so switching to Vector<uint8_t> requires teaching Base64 code how to produce and consume those.
Comment 1 Alexey Proskuryakov 2013-11-17 00:14:42 PST
Created attachment 217145 [details]
proposed patch

Not sure if the SignedOrUnsignedCharVectorAdapter and ConstSignedOrUnsignedCharVectorAdapter classes are the very best way to make Base64 work with both types. Thoughts?
Comment 2 Sam Weinig 2013-11-17 12:05:54 PST
(In reply to comment #1)
> Created an attachment (id=217145) [details]
> proposed patch
> 
> Not sure if the SignedOrUnsignedCharVectorAdapter and ConstSignedOrUnsignedCharVectorAdapter classes are the very best way to make Base64 work with both types. Thoughts?

Seems fine.
Comment 3 Alexey Proskuryakov 2013-11-17 13:39:53 PST
Committed <http://trac.webkit.org/r159390>.