Bug 124466

Summary: Use uint8_t vectors for WebCrypto data
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebCore Misc.Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, darin, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 122679    
Attachments:
Description Flags
proposed patch sam: review+

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>.