Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unreviewed, rolling out r158526.
http://trac.webkit.org/changeset/158526
https://bugs.webkit.org/show_bug.cgi?id=123744

it broke the build (Requested by jessieberlin on #webkit).

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesCbcParams):
(WebCore::createHmacParams):
(WebCore::createHmacKeyParams):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
* bindings/js/JSSubtleCryptoCustom.cpp:
* crypto/CryptoAlgorithmAesKeyGenParams.h: Removed.
* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKeyAES.cpp:
* crypto/CryptoKeyAES.h:
* crypto/CryptoKeyMac.cpp: Removed.
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):

LayoutTests:

* crypto/subtle/aes-cbc-generate-key-expected.txt: Removed.
* crypto/subtle/aes-cbc-generate-key.html: Removed.
* crypto/subtle/hmac-generate-key-expected.txt: Removed.
* crypto/subtle/hmac-generate-key.html: Removed.
* crypto/subtle/sha-1-expected.txt:

Canonical link: https://commits.webkit.org/141931@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Nov 4, 2013
1 parent 8bba297 commit 8b86351
Show file tree
Hide file tree
Showing 23 changed files with 64 additions and 386 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
2013-11-04 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r158526.
http://trac.webkit.org/changeset/158526
https://bugs.webkit.org/show_bug.cgi?id=123744

it broke the build (Requested by jessieberlin on #webkit).

* crypto/subtle/aes-cbc-generate-key-expected.txt: Removed.
* crypto/subtle/aes-cbc-generate-key.html: Removed.
* crypto/subtle/hmac-generate-key-expected.txt: Removed.
* crypto/subtle/hmac-generate-key.html: Removed.
* crypto/subtle/sha-1-expected.txt:

2013-11-04 Robert Plociennik <r.plociennik@samsung.com>

[EFL] accessibility/textarea-line-for-index.html is failing
Expand Down
19 changes: 0 additions & 19 deletions LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt

This file was deleted.

42 changes: 0 additions & 42 deletions LayoutTests/crypto/subtle/aes-cbc-generate-key.html

This file was deleted.

27 changes: 0 additions & 27 deletions LayoutTests/crypto/subtle/hmac-generate-key-expected.txt

This file was deleted.

52 changes: 0 additions & 52 deletions LayoutTests/crypto/subtle/hmac-generate-key.html

This file was deleted.

2 changes: 1 addition & 1 deletion LayoutTests/crypto/subtle/sha-1-expected.txt
Expand Up @@ -11,7 +11,7 @@ SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
= [2c 7e 7c 38 4f 78 29 69 42 82 b1 e3 a6 21 6d ef 80 82 d0 55]
SHA1 of [new Uint8Array([0, 1, 2, 3, 4]), new Uint8Array(5, 6, 7, 8, 9, 10])]
= [2c 7e 7c 38 4f 78 29 69 42 82 b1 e3 a6 21 6d ef 80 82 d0 55]
PASS crypto.subtle.generateKey('sha-1') threw exception Error: NotSupportedError: DOM Exception 9.
PASS crypto.subtle.generateKey('sha-1') threw exception TypeError: undefined is not a function (evaluating 'crypto.subtle.generateKey('sha-1')').
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
31 changes: 31 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,34 @@
2013-11-04 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r158526.
http://trac.webkit.org/changeset/158526
https://bugs.webkit.org/show_bug.cgi?id=123744

it broke the build (Requested by jessieberlin on #webkit).

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesCbcParams):
(WebCore::createHmacParams):
(WebCore::createHmacKeyParams):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
* bindings/js/JSSubtleCryptoCustom.cpp:
* crypto/CryptoAlgorithmAesKeyGenParams.h: Removed.
* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKeyAES.cpp:
* crypto/CryptoKeyAES.h:
* crypto/CryptoKeyMac.cpp: Removed.
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):

2013-11-04 Przemyslaw Szymanski <p.szymanski3@samsung.com>

[Texmap] Remove redundant calls in CoordinatedGraphicsScene
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Expand Up @@ -20176,7 +20176,6 @@
E19AC3DF1824DC6900349426 /* CryptoAlgorithmSHA256Mac.cpp */,
E19AC3E01824DC6900349426 /* CryptoAlgorithmSHA384Mac.cpp */,
E19AC3E11824DC6900349426 /* CryptoAlgorithmSHA512Mac.cpp */,
E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */,
);
name = mac;
sourceTree = "<group>";
Expand Down Expand Up @@ -20217,7 +20216,6 @@
isa = PBXGroup;
children = (
E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParams.h */,
E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h */,
E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParams.h */,
E1C6571E1816E50300256CDD /* CryptoAlgorithmHmacParams.h */,
);
Expand Down Expand Up @@ -23193,7 +23191,6 @@
D359D8BF129CA55C0006E5D2 /* JSHTMLDetailsElement.h in Headers */,
76808B50159DADFA002B5233 /* JSHTMLDialogElement.h in Headers */,
1A85B1E70A1B240500D8C87C /* JSHTMLDirectoryElement.h in Headers */,
E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h in Headers */,
1A85B2B70A1B2AC700D8C87C /* JSHTMLDivElement.h in Headers */,
1A85B1E90A1B240500D8C87C /* JSHTMLDListElement.h in Headers */,
1A494E350A12358B00FDAFC1 /* JSHTMLDocument.h in Headers */,
Expand Down Expand Up @@ -27012,7 +27009,6 @@
C6F0900E14327B6100685849 /* MutationObserver.cpp in Sources */,
E19AC3E51824DC6900349426 /* CryptoAlgorithmSHA512Mac.cpp in Sources */,
D6E528A3149A926D00EFE1F3 /* MutationObserverInterestGroup.cpp in Sources */,
E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */,
D6E276AF14637455001D280A /* MutationObserverRegistration.cpp in Sources */,
C6F08FBC1430FE8F00685849 /* MutationRecord.cpp in Sources */,
52B6C9C515E3F4DF00690B05 /* NamedFlowCollection.cpp in Sources */,
Expand Down
31 changes: 4 additions & 27 deletions Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
Expand Up @@ -29,7 +29,6 @@
#if ENABLE(SUBTLE_CRYPTO)

#include "CryptoAlgorithmAesCbcParams.h"
#include "CryptoAlgorithmAesKeyGenParams.h"
#include "CryptoAlgorithmHmacKeyParams.h"
#include "CryptoAlgorithmHmacParams.h"
#include "CryptoAlgorithmRegistry.h"
Expand Down Expand Up @@ -127,7 +126,7 @@ static std::unique_ptr<CryptoAlgorithmParameters> createAesCbcParams(JSC::ExecSt
if (exec->hadException())
return nullptr;

auto result = std::make_unique<CryptoAlgorithmAesCbcParams>();
std::unique_ptr<CryptoAlgorithmAesCbcParams> result = std::make_unique<CryptoAlgorithmAesCbcParams>();

CryptoOperationData ivData;
if (!cryptoOperationDataFromJSValue(exec, iv, ivData)) {
Expand All @@ -145,24 +144,6 @@ static std::unique_ptr<CryptoAlgorithmParameters> createAesCbcParams(JSC::ExecSt
return std::move(result);
}

static std::unique_ptr<CryptoAlgorithmParameters> createAesKeyGenParams(JSC::ExecState* exec, JSC::JSValue value)
{
if (!value.isObject()) {
throwTypeError(exec);
return nullptr;
}

auto result = std::make_unique<CryptoAlgorithmAesKeyGenParams>();

JSValue lengthValue = getProperty(exec, value.getObject(), "length");
if (exec->hadException())
return nullptr;

result->length = toUInt16(exec, lengthValue, EnforceRange);

return std::move(result);
}

static std::unique_ptr<CryptoAlgorithmParameters> createHmacParams(JSC::ExecState* exec, JSC::JSValue value)
{
if (!value.isObject()) {
Expand All @@ -171,7 +152,7 @@ static std::unique_ptr<CryptoAlgorithmParameters> createHmacParams(JSC::ExecStat
}

JSDictionary jsDictionary(exec, value.getObject());
auto result = std::make_unique<CryptoAlgorithmHmacParams>();
std::unique_ptr<CryptoAlgorithmHmacParams> result = std::make_unique<CryptoAlgorithmHmacParams>();

if (!getHashAlgorithm(jsDictionary, result->hash)) {
ASSERT(exec->hadException());
Expand All @@ -189,7 +170,7 @@ static std::unique_ptr<CryptoAlgorithmParameters> createHmacKeyParams(JSC::ExecS
}

JSDictionary jsDictionary(exec, value.getObject());
auto result = std::make_unique<CryptoAlgorithmHmacKeyParams>();
std::unique_ptr<CryptoAlgorithmHmacKeyParams> result = std::make_unique<CryptoAlgorithmHmacKeyParams>();

if (!getHashAlgorithm(jsDictionary, result->hash)) {
ASSERT(exec->hadException());
Expand Down Expand Up @@ -363,7 +344,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
}
}

std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue value)
std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
{
switch (algorithm) {
case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
Expand All @@ -372,16 +353,12 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
case CryptoAlgorithmIdentifier::RSA_OAEP:
case CryptoAlgorithmIdentifier::ECDSA:
case CryptoAlgorithmIdentifier::ECDH:
setDOMException(exec, NOT_SUPPORTED_ERR);
return nullptr;
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
return createAesKeyGenParams(exec, value);
case CryptoAlgorithmIdentifier::HMAC:
return createHmacKeyParams(exec, value);
case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
Expand Down
45 changes: 0 additions & 45 deletions Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp
Expand Up @@ -337,51 +337,6 @@ JSValue JSSubtleCrypto::digest(ExecState* exec)
return promise;
}

JSValue JSSubtleCrypto::generateKey(JSC::ExecState* exec)
{
if (exec->argumentCount() < 1)
return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));

auto algorithm = createAlgorithmFromJSValue(exec, exec->uncheckedArgument(0));
if (!algorithm) {
ASSERT(exec->hadException());
return jsUndefined();
}

auto parameters = JSCryptoAlgorithmDictionary::createParametersForGenerateKey(exec, algorithm->identifier(), exec->uncheckedArgument(0));
if (!parameters) {
ASSERT(exec->hadException());
return jsUndefined();
}

bool extractable = false;
if (exec->argumentCount() >= 2) {
extractable = exec->uncheckedArgument(1).toBoolean(exec);
if (exec->hadException())
return jsUndefined();
}

CryptoKeyUsage keyUsages = 0;
if (exec->argumentCount() >= 3) {
if (!cryptoKeyUsagesFromJSValue(exec, exec->argument(2), keyUsages)) {
ASSERT(exec->hadException());
return jsUndefined();
}
}

JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject());
auto promiseWrapper = PromiseWrapper::create(globalObject(), promise);

ExceptionCode ec = 0;
algorithm->generateKey(*parameters, extractable, keyUsages, std::move(promiseWrapper), ec);
if (ec) {
setDOMException(exec, ec);
return jsUndefined();
}

return promise;
}

JSValue JSSubtleCrypto::importKey(JSC::ExecState* exec)
{
if (exec->argumentCount() < 3)
Expand Down

0 comments on commit 8b86351

Please sign in to comment.