Bug 171287

Summary: [WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: WebCore Misc.Assignee: Jiewen Tan <jiewen_tan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, jiewen_tan, ryanhaddad, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
bfulgham: review+
Patch for landing none

Description Jiewen Tan 2017-04-25 13:53:07 PDT
Enhance ways to convert an ECDSA signature binary(r||s) into DER format.
Comment 1 Jiewen Tan 2017-04-25 13:53:39 PDT
<rdar://problem/31735332>
Comment 2 Jiewen Tan 2017-04-25 14:00:08 PDT
Created attachment 308138 [details]
Patch
Comment 3 Jiewen Tan 2017-04-25 14:17:13 PDT
Created attachment 308143 [details]
Patch
Comment 4 Sam Weinig 2017-04-25 15:39:48 PDT
What does it mean this covered by existing tests? Do those tests change their results?
Comment 5 Jiewen Tan 2017-04-25 15:55:11 PDT
(In reply to Sam Weinig from comment #4)
> What does it mean this covered by existing tests? Do those tests change
> their results?

crypto/subtle/ecdsa-import-key-verify-p384.html fails in Internal Bots. After this change, it should pass. That's why this change is covered by existing tests. Please see radars for further information.
Comment 6 Brent Fulgham 2017-04-25 17:31:12 PDT
Comment on attachment 308143 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308143&action=review

r=me.

> Source/WebCore/crypto/mac/CryptoAlgorithmECDSAMac.cpp:147
> +    // InitialOctet is needed when the first byte of r/s is larger or equal than 128.

"larger or equal than" -> "greater than or equal to"
Comment 7 Jiewen Tan 2017-04-25 17:40:45 PDT
Comment on attachment 308143 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308143&action=review

Thanks Brent for r+ my patch.

>> Source/WebCore/crypto/mac/CryptoAlgorithmECDSAMac.cpp:147
>> +    // InitialOctet is needed when the first byte of r/s is larger or equal than 128.
> 
> "larger or equal than" -> "greater than or equal to"

Fixed.
Comment 8 Jiewen Tan 2017-04-25 17:42:41 PDT
Created attachment 308176 [details]
Patch for landing
Comment 9 WebKit Commit Bot 2017-04-25 21:32:01 PDT
Comment on attachment 308176 [details]
Patch for landing

Clearing flags on attachment: 308176

Committed r215791: <http://trac.webkit.org/changeset/215791>