Bug 227656 - [OpenSSL] Implement HKDF and PBKDF2 support
Summary: [OpenSSL] Implement HKDF and PBKDF2 support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yoshiaki Jitsukawa
URL:
Keywords: InRadar
Depends on:
Blocks: 206439
  Show dependency treegraph
 
Reported: 2021-07-03 00:57 PDT by Yoshiaki Jitsukawa
Modified: 2021-07-08 12:27 PDT (History)
4 users (show)

See Also:


Attachments
Patch (57.95 KB, text/plain)
2021-07-07 16:23 PDT, Yoshiaki Jitsukawa
no flags Details
Patch (7.28 KB, patch)
2021-07-07 17:32 PDT, Yoshiaki Jitsukawa
no flags Details | Formatted Diff | Diff
Patch (7.30 KB, patch)
2021-07-07 19:04 PDT, Yoshiaki Jitsukawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshiaki Jitsukawa 2021-07-03 00:57:17 PDT
Implement HKDF and PBKDF2 support.
Comment 1 Yoshiaki Jitsukawa 2021-07-07 16:23:22 PDT
Created attachment 433091 [details]
Patch
Comment 2 Yoshiaki Jitsukawa 2021-07-07 17:32:14 PDT
Created attachment 433097 [details]
Patch
Comment 3 Fujii Hironori 2021-07-07 17:55:41 PDT
Comment on attachment 433097 [details]
Patch

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

> Source/WebCore/crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp:49
> +    if (PKCS5_PBKDF2_HMAC((const char*)key.key().data(), key.key().size(), parameters.saltVector().data(), parameters.saltVector().size(), parameters.iterations, algorithm, output.size(), output.data()) <= 0)

Even though WebKit code style guideline doesn't mention, some reviewer dislikes C-style case. You should use C++-style cast. Unfortunately, it's reinterpret_cast in this case.
Comment 4 Yoshiaki Jitsukawa 2021-07-07 18:21:37 PDT
(In reply to Fujii Hironori from comment #3)
> Comment on attachment 433097 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=433097&action=review
> 
> > Source/WebCore/crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp:49
> > +    if (PKCS5_PBKDF2_HMAC((const char*)key.key().data(), key.key().size(), parameters.saltVector().data(), parameters.saltVector().size(), parameters.iterations, algorithm, output.size(), output.data()) <= 0)
> 
> Even though WebKit code style guideline doesn't mention, some reviewer
> dislikes C-style case. You should use C++-style cast. Unfortunately, it's
> reinterpret_cast in this case.

Got it, I'll fix it. Thank you.
Comment 5 Yoshiaki Jitsukawa 2021-07-07 19:04:08 PDT
Created attachment 433109 [details]
Patch
Comment 6 EWS 2021-07-08 12:27:00 PDT
Committed r279742 (239523@main): <https://commits.webkit.org/239523@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 433109 [details].
Comment 7 Radar WebKit Bug Importer 2021-07-08 12:27:17 PDT
<rdar://problem/80337626>