[webkit-reviews] review granted: [Bug 171222] [GCrypt] RSA-OAEP support : [Attachment 308234] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 20 13:35:05 PDT 2017


Michael Catanzaro <mcatanzaro at igalia.com> has granted Zan Dobersek
<zan at falconsigh.net>'s request for review:
Bug 171222: [GCrypt] RSA-OAEP support
https://bugs.webkit.org/show_bug.cgi?id=171222

Attachment 308234: Patch

https://bugs.webkit.org/attachment.cgi?id=308234&action=review




--- Comment #5 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Comment on attachment 308234
  --> https://bugs.webkit.org/attachment.cgi?id=308234
Patch

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

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:57
> -void
CryptoAlgorithmRSA_OAEP::platformEncrypt(std::unique_ptr<CryptoAlgorithmParamet
ers>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&,
ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&)
> +static std::optional<const char*>
hashAlgorithmName(CryptoAlgorithmIdentifier identifier)
>  {
> -    notImplemented();
> +    switch (identifier) {
> +    case CryptoAlgorithmIdentifier::SHA_1:
> +	   return "sha1";
> +    case CryptoAlgorithmIdentifier::SHA_224:
> +	   return "sha224";
> +    case CryptoAlgorithmIdentifier::SHA_256:
> +	   return "sha256";
> +    case CryptoAlgorithmIdentifier::SHA_384:
> +	   return "sha384";
> +    case CryptoAlgorithmIdentifier::SHA_512:
> +	   return "sha512";
> +    default:
> +	   return std::nullopt;
> +    }
>  }

This is getting a bit absurd... it needs to move to a shared location.

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:59
> +static std::optional<Vector<uint8_t>> mpiData(gcry_sexp_t paramSexp)

This too... don't you have some utility file for stuff like this? You need one.


More information about the webkit-reviews mailing list