RESOLVED FIXED 171103
[GCrypt] ECDSA signing and verification support
https://bugs.webkit.org/show_bug.cgi?id=171103
Summary [GCrypt] ECDSA signing and verification support
Zan Dobersek
Reported 2017-04-21 00:24:46 PDT
[GCrypt] ECDSA signing and verification support
Attachments
Patch (13.53 KB, patch)
2017-04-21 00:32 PDT, Zan Dobersek
no flags
Patch for landing (15.94 KB, patch)
2017-04-23 07:23 PDT, Zan Dobersek
no flags
Patch for landing (16.03 KB, patch)
2017-05-01 22:50 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2017-04-21 00:32:15 PDT
Carlos Garcia Campos
Comment 2 2017-04-21 00:46:47 PDT
Comment on attachment 307705 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=307705&action=review Doesn't this fix any test currently skipped? > Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:79 > +std::optional<Vector<uint8_t>> mpiData(gcry_sexp_t paramSexp) should this be static?
Zan Dobersek
Comment 3 2017-04-23 07:23:12 PDT
Created attachment 307935 [details] Patch for landing Also marks the majority of ECDSA layout tests under crypto/subtle/ as passing.
Michael Catanzaro
Comment 4 2017-04-27 09:08:19 PDT
Planning to land this? Jiewen, do you mind sanity-checking it please? Thanks for looking over these patches. :)
Jiewen Tan
Comment 5 2017-04-27 13:59:53 PDT
Comment on attachment 307935 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=307935&action=review Looks good to me. > Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:151 > + Vector<uint8_t> signature; Not sure if you could always assume that r and s equal to key size as this is in fact not the case for CommonCrypto. From RFC 6090:https://www.ietf.org/rfc/rfc6090.txt, I didn't see this guarantee as well.
Zan Dobersek
Comment 6 2017-04-28 07:13:03 PDT
Comment on attachment 307935 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=307935&action=review >> Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:151 >> + Vector<uint8_t> signature; > > Not sure if you could always assume that r and s equal to key size as this is in fact not the case for CommonCrypto. > From RFC 6090:https://www.ietf.org/rfc/rfc6090.txt, I didn't see this guarantee as well. We check that the retrieved data is of proper size below, before appending the r and s data to the signature Vector.
Jiewen Tan
Comment 7 2017-04-28 12:23:47 PDT
Comment on attachment 307935 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=307935&action=review >>> Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:151 >>> + Vector<uint8_t> signature; >> >> Not sure if you could always assume that r and s equal to key size as this is in fact not the case for CommonCrypto. >> From RFC 6090:https://www.ietf.org/rfc/rfc6090.txt, I didn't see this guarantee as well. > > We check that the retrieved data is of proper size below, before appending the r and s data to the signature Vector. Sure. What I mean is a valid r and s pair does not necessarily meet the check below.
Jiewen Tan
Comment 8 2017-04-28 12:25:26 PDT
Comment on attachment 307935 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=307935&action=review >>>> Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:151 >>>> + Vector<uint8_t> signature; >>> >>> Not sure if you could always assume that r and s equal to key size as this is in fact not the case for CommonCrypto. >>> From RFC 6090:https://www.ietf.org/rfc/rfc6090.txt, I didn't see this guarantee as well. >> >> We check that the retrieved data is of proper size below, before appending the r and s data to the signature Vector. > > Sure. What I mean is a valid r and s pair does not necessarily meet the check below. Also see: https://www.w3.org/TR/WebCryptoAPI/#dfn-convert-integer-to-octet-string
Zan Dobersek
Comment 9 2017-05-01 22:34:20 PDT
(In reply to Jiewen Tan from comment #8) > Comment on attachment 307935 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=307935&action=review > > >>>> Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:151 > >>>> + Vector<uint8_t> signature; > >>> > >>> Not sure if you could always assume that r and s equal to key size as this is in fact not the case for CommonCrypto. > >>> From RFC 6090:https://www.ietf.org/rfc/rfc6090.txt, I didn't see this guarantee as well. > >> > >> We check that the retrieved data is of proper size below, before appending the r and s data to the signature Vector. > > > > Sure. What I mean is a valid r and s pair does not necessarily meet the check below. > > Also see: > https://www.w3.org/TR/WebCryptoAPI/#dfn-convert-integer-to-octet-string Ah, understood. I'll add a FIXME that points to a new bug.
Zan Dobersek
Comment 10 2017-05-01 22:50:03 PDT
Created attachment 308802 [details] Patch for landing
Zan Dobersek
Comment 11 2017-05-01 23:49:09 PDT
Note You need to log in before you can comment on or make changes to this bug.