Bug 170274 - [GCrypt] Implement AES_KW support
Summary: [GCrypt] Implement AES_KW support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on: 170269 170271
Blocks: 133122
  Show dependency treegraph
 
Reported: 2017-03-30 00:10 PDT by Zan Dobersek
Modified: 2017-04-03 11:36 PDT (History)
3 users (show)

See Also:


Attachments
Patch (5.26 KB, patch)
2017-03-30 00:13 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (5.55 KB, patch)
2017-03-30 00:29 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (5.72 KB, patch)
2017-04-03 03:59 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (5.79 KB, patch)
2017-04-03 11:19 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2017-03-30 00:10:29 PDT
[GCrypt] Implement AES_KW support
Comment 1 Zan Dobersek 2017-03-30 00:13:31 PDT
Created attachment 305844 [details]
Patch
Comment 2 Build Bot 2017-03-30 00:15:11 PDT
Attachment 305844 [details] did not pass style-queue:


ERROR: Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:109:  CryptoAlgorithmAES_KW::platformWrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:121:  CryptoAlgorithmAES_KW::platformUnwrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Zan Dobersek 2017-03-30 00:29:10 PDT
Created attachment 305846 [details]
Patch
Comment 4 Build Bot 2017-03-30 00:31:07 PDT
Attachment 305846 [details] did not pass style-queue:


ERROR: Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:110:  CryptoAlgorithmAES_KW::platformWrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:122:  CryptoAlgorithmAES_KW::platformUnwrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Zan Dobersek 2017-03-30 00:44:37 PDT
Depends on the Utilities.h header that's being added in bug #170269, as well as the HandleDeleter<gcry_cipher_hd_t> specialization that's being added in bug #170271.
Comment 6 Michael Catanzaro 2017-04-01 18:06:31 PDT
Comment on attachment 305846 [details]
Patch

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

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:36
> +#include <pal/crypto/gcrypt/Handle.h>
> +#include <pal/crypto/gcrypt/Utilities.h>

:(

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:65
> +    Vector<uint8_t> output(data.size() + 8);

Correct, but it needs a short comment to explain the + 8 (e.g. "On encryption the provided output buffer must be 64 bit (8 byte) larger than the input buffer" from https://www.gnupg.org/documentation/manuals/gcrypt/Available-cipher-modes.html).

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:72
> +    return WTFMove(output);

:(

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:100
> +    Vector<uint8_t> output(data.size() - 8);

Comment

> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:107
> +    return WTFMove(output);

:(
Comment 7 Zan Dobersek 2017-04-02 23:58:20 PDT
Comment on attachment 305846 [details]
Patch

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

>> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:65
>> +    Vector<uint8_t> output(data.size() + 8);
> 
> Correct, but it needs a short comment to explain the + 8 (e.g. "On encryption the provided output buffer must be 64 bit (8 byte) larger than the input buffer" from https://www.gnupg.org/documentation/manuals/gcrypt/Available-cipher-modes.html).

OK.

>> Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:100
>> +    Vector<uint8_t> output(data.size() - 8);
> 
> Comment

OK.
Comment 8 Zan Dobersek 2017-04-03 03:59:51 PDT
Created attachment 306071 [details]
Patch for landing

Still depends on bug #170271.
Comment 9 Zan Dobersek 2017-04-03 11:19:03 PDT
Created attachment 306087 [details]
Patch for landing
Comment 10 Build Bot 2017-04-03 11:20:25 PDT
Attachment 306087 [details] did not pass style-queue:


ERROR: Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:112:  CryptoAlgorithmAES_KW::platformWrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:124:  CryptoAlgorithmAES_KW::platformUnwrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Zan Dobersek 2017-04-03 11:36:10 PDT
Comment on attachment 306087 [details]
Patch for landing

Clearing flags on attachment: 306087

Committed r214823: <http://trac.webkit.org/changeset/214823>
Comment 12 Zan Dobersek 2017-04-03 11:36:24 PDT
All reviewed patches have been landed.  Closing bug.