| Differences between
and this patch
- a/Source/WTF/ChangeLog +11 lines
Lines 1-3 a/Source/WTF/ChangeLog_sec1
1
2017-05-22  Jiewen Tan  <jiewen_tan@apple.com>
2
3
        [WebCrypto] Support RSA-PSS
4
        https://bugs.webkit.org/show_bug.cgi?id=170869
5
        <rdar://problem/31640672>
6
7
        Reviewed by NOBODY (OOPS!).
8
9
        * wtf/Platform.h:
10
        Add a flag to enable RSA-PSS in the future.
11
1
2017-05-15  Mark Lam  <mark.lam@apple.com>
12
2017-05-15  Mark Lam  <mark.lam@apple.com>
2
13
3
        Rolling out r214038 and r213697: Crashes when using computed properties with rest destructuring and object spread.
14
        Rolling out r214038 and r213697: Crashes when using computed properties with rest destructuring and object spread.
- a/Source/WebCore/ChangeLog +70 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2017-05-22  Jiewen Tan  <jiewen_tan@apple.com>
2
3
        [WebCrypto] Support RSA-PSS
4
        https://bugs.webkit.org/show_bug.cgi?id=170869
5
        <rdar://problem/31640672>
6
7
        Reviewed by NOBODY (OOPS!).
8
9
        This patch implements RSA-PSS according to the spec: https://www.w3.org/TR/WebCryptoAPI/#rsa-pss.
10
        Supported operations include sign, verify, generateKey, importKey and exportKey.
11
12
        Tests: crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html
13
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html
14
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html
15
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html
16
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html
17
               crypto/subtle/rsa-pss-generate-export-key-pkcs8.html
18
               crypto/subtle/rsa-pss-generate-export-key-spki.html
19
               crypto/subtle/rsa-pss-generate-key.html
20
               crypto/subtle/rsa-pss-import-jwk-private-key.html
21
               crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html
22
               crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html
23
               crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html
24
               crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html
25
               crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html
26
               crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html
27
               crypto/subtle/rsa-pss-import-key-sign-large-salt.html
28
               crypto/subtle/rsa-pss-import-key-sign.html
29
               crypto/subtle/rsa-pss-import-key-verify.html
30
               crypto/subtle/rsa-pss-import-pkcs8-key.html
31
               crypto/subtle/rsa-pss-import-spki-key-empty-usages.html
32
               crypto/subtle/rsa-pss-import-spki-key.html
33
               crypto/workers/subtle/rsa-pss-import-key-sign.html
34
               crypto/workers/subtle/rsa-pss-import-key-verify.html
35
36
        * CMakeLists.txt:
37
        * DerivedSources.make:
38
        * PlatformGTK.cmake:
39
        * WebCore.xcodeproj/project.pbxproj:
40
        * bindings/js/JSSubtleCryptoCustom.cpp:
41
        (WebCore::normalizeCryptoAlgorithmParameters):
42
        * crypto/CryptoAlgorithmParameters.h:
43
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: Added.
44
        (WebCore::CryptoAlgorithmRSA_PSS::create):
45
        (WebCore::CryptoAlgorithmRSA_PSS::identifier):
46
        (WebCore::CryptoAlgorithmRSA_PSS::sign):
47
        (WebCore::CryptoAlgorithmRSA_PSS::verify):
48
        (WebCore::CryptoAlgorithmRSA_PSS::generateKey):
49
        (WebCore::CryptoAlgorithmRSA_PSS::importKey):
50
        (WebCore::CryptoAlgorithmRSA_PSS::exportKey):
51
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Added.
52
        * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
53
        (WebCore::cryptoDigestAlgorithm): Deleted.
54
        Extract function cryptoDigestAlgorithm to a separate file.
55
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
56
        (WebCore::cryptoDigestAlgorithm): Deleted.
57
        Extract function cryptoDigestAlgorithm to a separate file.
58
        * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: Added.
59
        (WebCore::signRSA_PSS):
60
        (WebCore::verifyRSA_PSS):
61
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
62
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
63
        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
64
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
65
        * crypto/mac/CryptoDigestAlgorithm.h: Added.
66
        (WebCore::cryptoDigestAlgorithm):
67
        Have cryptoDigestAlgorithm in a separate file.
68
        * crypto/parameters/CryptoAlgorithmRsaPssParams.h: Added.
69
        * crypto/parameters/RsaPssParams.idl: Added.
70
1
2017-05-16  Youenn Fablet  <youenn@apple.com>
71
2017-05-16  Youenn Fablet  <youenn@apple.com>
2
72
3
        Modernize WebKit2 getUserMedia passing of parameters
73
        Modernize WebKit2 getUserMedia passing of parameters
- a/Source/WTF/wtf/Platform.h +4 lines
Lines 1253-1256 a/Source/WTF/wtf/Platform.h_sec1
1253
#define USE_LIBWEBRTC 1
1253
#define USE_LIBWEBRTC 1
1254
#endif
1254
#endif
1255
1255
1256
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
1257
#define HAVE_RSA_PSS 1
1258
#endif
1259
1256
#endif /* WTF_Platform_h */
1260
#endif /* WTF_Platform_h */
- a/Source/WebCore/CMakeLists.txt +1 lines
Lines 358-363 set(WebCore_NON_SVG_IDL_FILES a/Source/WebCore/CMakeLists.txt_sec1
358
    crypto/parameters/RsaHashedKeyGenParams.idl
358
    crypto/parameters/RsaHashedKeyGenParams.idl
359
    crypto/parameters/RsaKeyGenParams.idl
359
    crypto/parameters/RsaKeyGenParams.idl
360
    crypto/parameters/RsaOaepParams.idl
360
    crypto/parameters/RsaOaepParams.idl
361
    crypto/parameters/RsaPssParams.idl
361
362
362
    css/CSSFontFaceLoadEvent.idl
363
    css/CSSFontFaceLoadEvent.idl
363
    css/CSSFontFaceRule.idl
364
    css/CSSFontFaceRule.idl
- a/Source/WebCore/DerivedSources.make +1 lines
Lines 299-304 JS_BINDING_IDLS = \ a/Source/WebCore/DerivedSources.make_sec1
299
    $(WebCore)/crypto/parameters/RsaHashedKeyGenParams.idl \
299
    $(WebCore)/crypto/parameters/RsaHashedKeyGenParams.idl \
300
    $(WebCore)/crypto/parameters/RsaKeyGenParams.idl \
300
    $(WebCore)/crypto/parameters/RsaKeyGenParams.idl \
301
    $(WebCore)/crypto/parameters/RsaOaepParams.idl \
301
    $(WebCore)/crypto/parameters/RsaOaepParams.idl \
302
	$(WebCore)/crypto/parameters/RsaPssParams.idl \
302
    $(WebCore)/css/CSSFontFaceLoadEvent.idl \
303
    $(WebCore)/css/CSSFontFaceLoadEvent.idl \
303
    $(WebCore)/css/CSSFontFaceRule.idl \
304
    $(WebCore)/css/CSSFontFaceRule.idl \
304
    $(WebCore)/css/CSSImportRule.idl \
305
    $(WebCore)/css/CSSImportRule.idl \
- a/Source/WebCore/PlatformGTK.cmake +1 lines
Lines 394-399 if (ENABLE_SUBTLE_CRYPTO) a/Source/WebCore/PlatformGTK.cmake_sec1
394
        crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
394
        crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
395
        crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
395
        crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
396
        crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
396
        crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
397
        crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
397
        crypto/algorithms/CryptoAlgorithmSHA1.cpp
398
        crypto/algorithms/CryptoAlgorithmSHA1.cpp
398
        crypto/algorithms/CryptoAlgorithmSHA224.cpp
399
        crypto/algorithms/CryptoAlgorithmSHA224.cpp
399
        crypto/algorithms/CryptoAlgorithmSHA256.cpp
400
        crypto/algorithms/CryptoAlgorithmSHA256.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +30 lines
Lines 2527-2532 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
2527
		571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
2527
		571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
2528
		571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */; };
2528
		571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */; };
2529
		572093D31DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h */; };
2529
		572093D31DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h */; };
2530
		5721A9851ECE4FB90081295A /* CryptoAlgorithmRSA_PSSMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5721A9831ECE4FB90081295A /* CryptoAlgorithmRSA_PSSMac.cpp */; };
2531
		5721A9871ECE53B10081295A /* CryptoDigestAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 5721A9861ECE53B10081295A /* CryptoDigestAlgorithm.h */; };
2532
		5721A98B1ECE57040081295A /* CryptoAlgorithmRsaPssParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5721A9881ECE57040081295A /* CryptoAlgorithmRsaPssParams.h */; };
2530
		572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
2533
		572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
2531
		572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
2534
		572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
2532
		573489391DAC6B6E00DC0667 /* CryptoAlgorithmParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */; };
2535
		573489391DAC6B6E00DC0667 /* CryptoAlgorithmParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */; };
Lines 2540-2545 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
2540
		5750A9821E6A150800705C4A /* JSEcKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9801E6A150800705C4A /* JSEcKeyParams.h */; };
2543
		5750A9821E6A150800705C4A /* JSEcKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9801E6A150800705C4A /* JSEcKeyParams.h */; };
2541
		5750A9861E6A216800705C4A /* CryptoAlgorithmECDH.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */; };
2544
		5750A9861E6A216800705C4A /* CryptoAlgorithmECDH.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */; };
2542
		5750A9871E6A216800705C4A /* CryptoAlgorithmECDH.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */; };
2545
		5750A9871E6A216800705C4A /* CryptoAlgorithmECDH.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */; };
2546
		5754719F1ECE628300DD63B2 /* JSRsaPssParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 575471991ECE5D2A00DD63B2 /* JSRsaPssParams.h */; };
2547
		575471A01ECE628700DD63B2 /* JSRsaPssParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5754719A1ECE5D2A00DD63B2 /* JSRsaPssParams.cpp */; };
2543
		5768142A1E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */; };
2548
		5768142A1E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */; };
2544
		576814351E6FE3E800E77754 /* CryptoAlgorithmECDHMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 576814341E6FE3E800E77754 /* CryptoAlgorithmECDHMac.cpp */; };
2549
		576814351E6FE3E800E77754 /* CryptoAlgorithmECDHMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 576814341E6FE3E800E77754 /* CryptoAlgorithmECDHMac.cpp */; };
2545
		576814401E709FA100E77754 /* JSEcdhKeyDeriveParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768143D1E709C3600E77754 /* JSEcdhKeyDeriveParams.cpp */; };
2550
		576814401E709FA100E77754 /* JSEcdhKeyDeriveParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768143D1E709C3600E77754 /* JSEcdhKeyDeriveParams.cpp */; };
Lines 2554-2559 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
2554
		57777E391E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h in Headers */ = {isa = PBXBuildFile; fileRef = 57777E371E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h */; };
2559
		57777E391E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h in Headers */ = {isa = PBXBuildFile; fileRef = 57777E371E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h */; };
2555
		5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; };
2560
		5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; };
2556
		5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */; };
2561
		5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */; };
2562
		5790996D1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790996B1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.h */; };
2563
		5790996E1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5790996C1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.cpp */; };
2557
		57957CA81E971DE0008072AB /* CryptoAlgorithmHKDF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57957CA61E971DE0008072AB /* CryptoAlgorithmHKDF.cpp */; };
2564
		57957CA81E971DE0008072AB /* CryptoAlgorithmHKDF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57957CA61E971DE0008072AB /* CryptoAlgorithmHKDF.cpp */; };
2558
		57957CA91E971DE0008072AB /* CryptoAlgorithmHKDF.h in Headers */ = {isa = PBXBuildFile; fileRef = 57957CA71E971DE0008072AB /* CryptoAlgorithmHKDF.h */; };
2565
		57957CA91E971DE0008072AB /* CryptoAlgorithmHKDF.h in Headers */ = {isa = PBXBuildFile; fileRef = 57957CA71E971DE0008072AB /* CryptoAlgorithmHKDF.h */; };
2559
		57957CAC1E97247B008072AB /* CryptoAlgorithmHKDFMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57957CAA1E97247B008072AB /* CryptoAlgorithmHKDFMac.cpp */; };
2566
		57957CAC1E97247B008072AB /* CryptoAlgorithmHKDFMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57957CAA1E97247B008072AB /* CryptoAlgorithmHKDFMac.cpp */; };
Lines 10241-10246 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
10241
		571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = "<group>"; };
10248
		571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = "<group>"; };
10242
		572093D11DDCEA4B00310AB0 /* AesCbcCfbParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AesCbcCfbParams.idl; sourceTree = "<group>"; };
10249
		572093D11DDCEA4B00310AB0 /* AesCbcCfbParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AesCbcCfbParams.idl; sourceTree = "<group>"; };
10243
		572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesCbcCfbParams.h; sourceTree = "<group>"; };
10250
		572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesCbcCfbParams.h; sourceTree = "<group>"; };
10251
		5721A9831ECE4FB90081295A /* CryptoAlgorithmRSA_PSSMac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSA_PSSMac.cpp; sourceTree = "<group>"; };
10252
		5721A9861ECE53B10081295A /* CryptoDigestAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoDigestAlgorithm.h; sourceTree = "<group>"; };
10253
		5721A9881ECE57040081295A /* CryptoAlgorithmRsaPssParams.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaPssParams.h; sourceTree = "<group>"; };
10254
		5721A98A1ECE57040081295A /* RsaPssParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaPssParams.idl; sourceTree = "<group>"; };
10244
		572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = "<group>"; };
10255
		572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = "<group>"; };
10245
		572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = "<group>"; };
10256
		572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = "<group>"; };
10246
		573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmParameters.h; sourceTree = "<group>"; };
10257
		573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmParameters.h; sourceTree = "<group>"; };
Lines 10257-10262 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
10257
		5750A9801E6A150800705C4A /* JSEcKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEcKeyParams.h; sourceTree = "<group>"; };
10268
		5750A9801E6A150800705C4A /* JSEcKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEcKeyParams.h; sourceTree = "<group>"; };
10258
		5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmECDH.cpp; sourceTree = "<group>"; };
10269
		5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmECDH.cpp; sourceTree = "<group>"; };
10259
		5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmECDH.h; sourceTree = "<group>"; };
10270
		5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmECDH.h; sourceTree = "<group>"; };
10271
		575471991ECE5D2A00DD63B2 /* JSRsaPssParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaPssParams.h; sourceTree = "<group>"; };
10272
		5754719A1ECE5D2A00DD63B2 /* JSRsaPssParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaPssParams.cpp; sourceTree = "<group>"; };
10260
		576814281E6F98AD00E77754 /* EcdhKeyDeriveParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = EcdhKeyDeriveParams.idl; sourceTree = "<group>"; };
10273
		576814281E6F98AD00E77754 /* EcdhKeyDeriveParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = EcdhKeyDeriveParams.idl; sourceTree = "<group>"; };
10261
		576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmEcdhKeyDeriveParams.h; sourceTree = "<group>"; };
10274
		576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmEcdhKeyDeriveParams.h; sourceTree = "<group>"; };
10262
		576814341E6FE3E800E77754 /* CryptoAlgorithmECDHMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmECDHMac.cpp; sourceTree = "<group>"; };
10275
		576814341E6FE3E800E77754 /* CryptoAlgorithmECDHMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmECDHMac.cpp; sourceTree = "<group>"; };
Lines 10277-10282 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
10277
		5778BD801DA4733E009E3009 /* SubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = "<group>"; };
10290
		5778BD801DA4733E009E3009 /* SubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = "<group>"; };
10278
		5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = "<group>"; };
10291
		5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = "<group>"; };
10279
		5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = "<group>"; };
10292
		5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = "<group>"; };
10293
		5790996B1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRSA_PSS.h; sourceTree = "<group>"; };
10294
		5790996C1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSA_PSS.cpp; sourceTree = "<group>"; };
10280
		57957CA61E971DE0008072AB /* CryptoAlgorithmHKDF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmHKDF.cpp; sourceTree = "<group>"; };
10295
		57957CA61E971DE0008072AB /* CryptoAlgorithmHKDF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmHKDF.cpp; sourceTree = "<group>"; };
10281
		57957CA71E971DE0008072AB /* CryptoAlgorithmHKDF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHKDF.h; sourceTree = "<group>"; };
10296
		57957CA71E971DE0008072AB /* CryptoAlgorithmHKDF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHKDF.h; sourceTree = "<group>"; };
10282
		57957CAA1E97247B008072AB /* CryptoAlgorithmHKDFMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmHKDFMac.cpp; sourceTree = "<group>"; };
10297
		57957CAA1E97247B008072AB /* CryptoAlgorithmHKDFMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmHKDFMac.cpp; sourceTree = "<group>"; };
Lines 24357-24364 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
24357
				57E657E81E714D1A00F941CA /* CryptoAlgorithmPBKDF2Mac.cpp */,
24372
				57E657E81E714D1A00F941CA /* CryptoAlgorithmPBKDF2Mac.cpp */,
24358
				E1BB84AC1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp */,
24373
				E1BB84AC1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp */,
24359
				E1FE136E183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp */,
24374
				E1FE136E183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp */,
24375
				5721A9831ECE4FB90081295A /* CryptoAlgorithmRSA_PSSMac.cpp */,
24360
				E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */,
24376
				E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */,
24361
				E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */,
24377
				E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */,
24378
				5721A9861ECE53B10081295A /* CryptoDigestAlgorithm.h */,
24362
				5750A97A1E69161600705C4A /* CryptoKeyECMac.cpp */,
24379
				5750A97A1E69161600705C4A /* CryptoKeyECMac.cpp */,
24363
				E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */,
24380
				E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */,
24364
				E164FAA418315E1A00DB4E61 /* CryptoKeyRSAMac.cpp */,
24381
				E164FAA418315E1A00DB4E61 /* CryptoKeyRSAMac.cpp */,
Lines 24392-24397 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
24392
				57777E371E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h */,
24409
				57777E371E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h */,
24393
				E1FE1368183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp */,
24410
				E1FE1368183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp */,
24394
				E1FE1369183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h */,
24411
				E1FE1369183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h */,
24412
				5790996B1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.h */,
24413
				5790996C1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.cpp */,
24395
				E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */,
24414
				E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */,
24396
				E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */,
24415
				E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */,
24397
				E1BD3317182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp */,
24416
				E1BD3317182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp */,
Lines 24460-24465 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
24460
				E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */,
24479
				E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */,
24461
				E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */,
24480
				E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */,
24462
				5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */,
24481
				5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */,
24482
				5721A9881ECE57040081295A /* CryptoAlgorithmRsaPssParams.h */,
24463
				E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */,
24483
				E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */,
24464
				E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */,
24484
				E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */,
24465
				576814281E6F98AD00E77754 /* EcdhKeyDeriveParams.idl */,
24485
				576814281E6F98AD00E77754 /* EcdhKeyDeriveParams.idl */,
Lines 24472-24477 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec10
24472
				57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */,
24492
				57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */,
24473
				57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */,
24493
				57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */,
24474
				5706A6941DDE5BF800A03B14 /* RsaOaepParams.idl */,
24494
				5706A6941DDE5BF800A03B14 /* RsaOaepParams.idl */,
24495
				5721A98A1ECE57040081295A /* RsaPssParams.idl */,
24475
			);
24496
			);
24476
			path = parameters;
24497
			path = parameters;
24477
			sourceTree = "<group>";
24498
			sourceTree = "<group>";
Lines 24665-24670 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec11
24665
				57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */,
24686
				57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */,
24666
				5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */,
24687
				5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */,
24667
				5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */,
24688
				5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */,
24689
				5754719A1ECE5D2A00DD63B2 /* JSRsaPssParams.cpp */,
24690
				575471991ECE5D2A00DD63B2 /* JSRsaPssParams.h */,
24668
				57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */,
24691
				57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */,
24669
				57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */,
24692
				57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */,
24670
				571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */,
24693
				571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */,
Lines 26817-26822 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec12
26817
				A80E6CE90A1989CA007FB8C5 /* CSSValueList.h in Headers */,
26840
				A80E6CE90A1989CA007FB8C5 /* CSSValueList.h in Headers */,
26818
				E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */,
26841
				E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */,
26819
				9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */,
26842
				9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */,
26843
				5754719F1ECE628300DD63B2 /* JSRsaPssParams.h in Headers */,
26820
				9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */,
26844
				9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */,
26821
				9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */,
26845
				9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */,
26822
				93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
26846
				93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
Lines 26959-26964 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec13
26959
				7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */,
26983
				7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */,
26960
				FB91392416AE4C17001FE682 /* DOMPath.h in Headers */,
26984
				FB91392416AE4C17001FE682 /* DOMPath.h in Headers */,
26961
				A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
26985
				A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
26986
				5721A9871ECE53B10081295A /* CryptoDigestAlgorithm.h in Headers */,
26962
				A9C6E4F00D745E38006442E9 /* DOMPluginArray.h in Headers */,
26987
				A9C6E4F00D745E38006442E9 /* DOMPluginArray.h in Headers */,
26963
				0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */,
26988
				0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */,
26964
				0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */,
26989
				0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */,
Lines 29191-29196 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec14
29191
				B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
29216
				B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
29192
				93F1994F08245E59001E9ABC /* Settings.h in Headers */,
29217
				93F1994F08245E59001E9ABC /* Settings.h in Headers */,
29193
				53EF766B16530A61004CBE49 /* SettingsMacros.h in Headers */,
29218
				53EF766B16530A61004CBE49 /* SettingsMacros.h in Headers */,
29219
				5790996D1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.h in Headers */,
29194
				0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */,
29220
				0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */,
29195
				BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */,
29221
				BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */,
29196
				A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */,
29222
				A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */,
Lines 29312-29317 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec15
29312
				BC5EB8B90E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.h in Headers */,
29338
				BC5EB8B90E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.h in Headers */,
29313
				319AE064142D6B24006563A1 /* StyleFilterData.h in Headers */,
29339
				319AE064142D6B24006563A1 /* StyleFilterData.h in Headers */,
29314
				5317612313C516690026E454 /* StyleFlexibleBoxData.h in Headers */,
29340
				5317612313C516690026E454 /* StyleFlexibleBoxData.h in Headers */,
29341
				5721A98B1ECE57040081295A /* CryptoAlgorithmRsaPssParams.h in Headers */,
29315
				E4D58EB917B4ED8900CBDCA8 /* StyleFontSizeFunctions.h in Headers */,
29342
				E4D58EB917B4ED8900CBDCA8 /* StyleFontSizeFunctions.h in Headers */,
29316
				BCEF444A0E6745E0001C1287 /* StyleGeneratedImage.h in Headers */,
29343
				BCEF444A0E6745E0001C1287 /* StyleGeneratedImage.h in Headers */,
29317
				A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */,
29344
				A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */,
Lines 30839-30844 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec16
30839
				371F53EA0D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp in Sources */,
30866
				371F53EA0D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp in Sources */,
30840
				BC7D8FEF1BD03B6400FFE540 /* CSSUnsetValue.cpp in Sources */,
30867
				BC7D8FEF1BD03B6400FFE540 /* CSSUnsetValue.cpp in Sources */,
30841
				AD03AAFA1468455300A39B5B /* CSSValue.cpp in Sources */,
30868
				AD03AAFA1468455300A39B5B /* CSSValue.cpp in Sources */,
30869
				5790996E1ECD23DA00FC0768 /* CryptoAlgorithmRSA_PSS.cpp in Sources */,
30842
				1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
30870
				1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
30843
				A80E6CE40A1989CA007FB8C5 /* CSSValueList.cpp in Sources */,
30871
				A80E6CE40A1989CA007FB8C5 /* CSSValueList.cpp in Sources */,
30844
				E49BDA0B131FD3E5003C56F0 /* CSSValuePool.cpp in Sources */,
30872
				E49BDA0B131FD3E5003C56F0 /* CSSValuePool.cpp in Sources */,
Lines 32158-32163 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec17
32158
				B2FA3DFE0AB75A6F000E5AC4 /* JSSVGSwitchElement.cpp in Sources */,
32186
				B2FA3DFE0AB75A6F000E5AC4 /* JSSVGSwitchElement.cpp in Sources */,
32159
				B2FA3E000AB75A6F000E5AC4 /* JSSVGSymbolElement.cpp in Sources */,
32187
				B2FA3E000AB75A6F000E5AC4 /* JSSVGSymbolElement.cpp in Sources */,
32160
				B2FA3E020AB75A6F000E5AC4 /* JSSVGTextContentElement.cpp in Sources */,
32188
				B2FA3E020AB75A6F000E5AC4 /* JSSVGTextContentElement.cpp in Sources */,
32189
				5721A9851ECE4FB90081295A /* CryptoAlgorithmRSA_PSSMac.cpp in Sources */,
32161
				B2FA3E040AB75A6F000E5AC4 /* JSSVGTextElement.cpp in Sources */,
32190
				B2FA3E040AB75A6F000E5AC4 /* JSSVGTextElement.cpp in Sources */,
32162
				B22362280C3AF04A0008CA9B /* JSSVGTextPathElement.cpp in Sources */,
32191
				B22362280C3AF04A0008CA9B /* JSSVGTextPathElement.cpp in Sources */,
32163
				B2FA3E060AB75A6F000E5AC4 /* JSSVGTextPositioningElement.cpp in Sources */,
32192
				B2FA3E060AB75A6F000E5AC4 /* JSSVGTextPositioningElement.cpp in Sources */,
Lines 32823-32828 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec18
32823
				31955A86160D199000858025 /* RenderSnapshottedPlugIn.cpp in Sources */,
32852
				31955A86160D199000858025 /* RenderSnapshottedPlugIn.cpp in Sources */,
32824
				BC8C8FAD0DDCD31B00B592F4 /* RenderStyle.cpp in Sources */,
32853
				BC8C8FAD0DDCD31B00B592F4 /* RenderStyle.cpp in Sources */,
32825
				0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */,
32854
				0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */,
32855
				575471A01ECE628700DD63B2 /* JSRsaPssParams.cpp in Sources */,
32826
				0F4E57171313276200CF85AF /* RenderSVGAllInOne.cpp in Sources */,
32856
				0F4E57171313276200CF85AF /* RenderSVGAllInOne.cpp in Sources */,
32827
				A8DF4AEC0980C42C0052981B /* RenderTable.cpp in Sources */,
32857
				A8DF4AEC0980C42C0052981B /* RenderTable.cpp in Sources */,
32828
				6ED878C4147493F4004C3597 /* RenderTableCaption.cpp in Sources */,
32858
				6ED878C4147493F4004C3597 /* RenderTableCaption.cpp in Sources */,
- a/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp -1 / +7 lines
Lines 50-55 a/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp_sec1
50
#include "JSRsaHashedKeyGenParams.h"
50
#include "JSRsaHashedKeyGenParams.h"
51
#include "JSRsaKeyGenParams.h"
51
#include "JSRsaKeyGenParams.h"
52
#include "JSRsaOaepParams.h"
52
#include "JSRsaOaepParams.h"
53
#include "JSRsaPssParams.h"
53
#include "ScriptState.h"
54
#include "ScriptState.h"
54
#include <runtime/Error.h>
55
#include <runtime/Error.h>
55
#include <runtime/JSArray.h>
56
#include <runtime/JSArray.h>
Lines 158-164 static std::unique_ptr<CryptoAlgorithmParameters> normalizeCryptoAlgorithmParame a/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp_sec2
158
                RETURN_IF_EXCEPTION(scope, nullptr);
159
                RETURN_IF_EXCEPTION(scope, nullptr);
159
                result = std::make_unique<CryptoAlgorithmEcdsaParams>(params);
160
                result = std::make_unique<CryptoAlgorithmEcdsaParams>(params);
160
                break;
161
                break;
161
162
            }
163
            case CryptoAlgorithmIdentifier::RSA_PSS: {
164
                auto params = convertDictionary<CryptoAlgorithmRsaPssParams>(state, value);
165
                RETURN_IF_EXCEPTION(scope, nullptr);
166
                result = std::make_unique<CryptoAlgorithmRsaPssParams>(params);
167
                break;
162
            }
168
            }
163
            default:
169
            default:
164
                throwNotSupportedError(state, scope);
170
                throwNotSupportedError(state, scope);
- a/Source/WebCore/crypto/CryptoAlgorithmParameters.h +1 lines
Lines 51-56 public: a/Source/WebCore/crypto/CryptoAlgorithmParameters.h_sec1
51
        RsaHashedImportParams,
51
        RsaHashedImportParams,
52
        RsaKeyGenParams,
52
        RsaKeyGenParams,
53
        RsaOaepParams,
53
        RsaOaepParams,
54
        RsaPssParams,
54
    };
55
    };
55
56
56
    // FIXME: Consider merging name and identifier.
57
    // FIXME: Consider merging name and identifier.
- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp +234 lines
Line 0 a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp_sec1
1
/*
2
 * Copyright (C) 2017 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "CryptoAlgorithmRSA_PSS.h"
28
29
#if ENABLE(SUBTLE_CRYPTO) && HAVE(RSA_PSS)
30
31
#include "CryptoAlgorithmRsaHashedImportParams.h"
32
#include "CryptoAlgorithmRsaHashedKeyGenParams.h"
33
#include "CryptoKeyPair.h"
34
#include "CryptoKeyRSA.h"
35
#include "ExceptionCode.h"
36
#include <wtf/Variant.h>
37
38
namespace WebCore {
39
40
static const char* const ALG1 = "PS1";
41
static const char* const ALG224 = "PS224";
42
static const char* const ALG256 = "PS256";
43
static const char* const ALG384 = "PS384";
44
static const char* const ALG512 = "PS512";
45
46
Ref<CryptoAlgorithm> CryptoAlgorithmRSA_PSS::create()
47
{
48
    return adoptRef(*new CryptoAlgorithmRSA_PSS);
49
}
50
51
CryptoAlgorithmIdentifier CryptoAlgorithmRSA_PSS::identifier() const
52
{
53
    return s_identifier;
54
}
55
56
void CryptoAlgorithmRSA_PSS::sign(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& data, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
57
{
58
    if (key->type() != CryptoKeyType::Private) {
59
        exceptionCallback(INVALID_ACCESS_ERR);
60
        return;
61
    }
62
    platformSign(WTFMove(parameters), WTFMove(key), WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), context, workQueue);
63
}
64
65
void CryptoAlgorithmRSA_PSS::verify(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& signature, Vector<uint8_t>&& data, BoolCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
66
{
67
    if (key->type() != CryptoKeyType::Public) {
68
        exceptionCallback(INVALID_ACCESS_ERR);
69
        return;
70
    }
71
    platformVerify(WTFMove(parameters), WTFMove(key), WTFMove(signature), WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), context, workQueue);
72
}
73
74
void CryptoAlgorithmRSA_PSS::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context)
75
{
76
    const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedKeyGenParams>(parameters);
77
78
    if (usages & (CryptoKeyUsageDecrypt | CryptoKeyUsageEncrypt | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey)) {
79
        exceptionCallback(SYNTAX_ERR);
80
        return;
81
    }
82
83
    auto keyPairCallback = [capturedCallback = WTFMove(callback)](CryptoKeyPair&& pair) {
84
        pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageVerify);
85
        pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageSign);
86
        capturedCallback(WTFMove(pair));
87
    };
88
    auto failureCallback = [capturedCallback = WTFMove(exceptionCallback)]() {
89
        capturedCallback(OperationError);
90
    };
91
    CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_PSS, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), &context);
92
}
93
94
void CryptoAlgorithmRSA_PSS::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
95
{
96
    ASSERT(parameters);
97
    const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedImportParams>(*parameters);
98
99
    RefPtr<CryptoKeyRSA> result;
100
    switch (format) {
101
    case SubtleCrypto::KeyFormat::Jwk: {
102
        JsonWebKey key = WTFMove(WTF::get<JsonWebKey>(data));
103
104
        if (usages && ((!key.d.isNull() && (usages ^ CryptoKeyUsageSign)) || (key.d.isNull() && (usages ^ CryptoKeyUsageVerify)))) {
105
            exceptionCallback(SYNTAX_ERR);
106
            return;
107
        }
108
        if (usages && !key.use.isNull() && key.use != "sig") {
109
            exceptionCallback(DataError);
110
            return;
111
        }
112
113
        bool isMatched = false;
114
        switch (rsaParameters.hashIdentifier) {
115
        case CryptoAlgorithmIdentifier::SHA_1:
116
            isMatched = key.alg.isNull() || key.alg == ALG1;
117
            break;
118
        case CryptoAlgorithmIdentifier::SHA_224:
119
            isMatched = key.alg.isNull() || key.alg == ALG224;
120
            break;
121
        case CryptoAlgorithmIdentifier::SHA_256:
122
            isMatched = key.alg.isNull() || key.alg == ALG256;
123
            break;
124
        case CryptoAlgorithmIdentifier::SHA_384:
125
            isMatched = key.alg.isNull() || key.alg == ALG384;
126
            break;
127
        case CryptoAlgorithmIdentifier::SHA_512:
128
            isMatched = key.alg.isNull() || key.alg == ALG512;
129
            break;
130
        default:
131
            break;
132
        }
133
        if (!isMatched) {
134
            exceptionCallback(DataError);
135
            return;
136
        }
137
138
        result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages);
139
        break;
140
    }
141
    case SubtleCrypto::KeyFormat::Spki: {
142
        if (usages && (usages ^ CryptoKeyUsageVerify)) {
143
            exceptionCallback(SYNTAX_ERR);
144
            return;
145
        }
146
        // FIXME: <webkit.org/b/165436>
147
        result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
148
        break;
149
    }
150
    case SubtleCrypto::KeyFormat::Pkcs8: {
151
        if (usages && (usages ^ CryptoKeyUsageSign)) {
152
            exceptionCallback(SYNTAX_ERR);
153
            return;
154
        }
155
        // FIXME: <webkit.org/b/165436>
156
        result = CryptoKeyRSA::importPkcs8(parameters->identifier, rsaParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
157
        break;
158
    }
159
    default:
160
        exceptionCallback(NOT_SUPPORTED_ERR);
161
        return;
162
    }
163
    if (!result) {
164
        exceptionCallback(DataError);
165
        return;
166
    }
167
168
    callback(*result);
169
}
170
171
void CryptoAlgorithmRSA_PSS::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
172
{
173
    const auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
174
175
    if (!rsaKey.keySizeInBits()) {
176
        exceptionCallback(OperationError);
177
        return;
178
    }
179
180
    KeyData result;
181
    switch (format) {
182
    case SubtleCrypto::KeyFormat::Jwk: {
183
        JsonWebKey jwk = rsaKey.exportJwk();
184
        switch (rsaKey.hashAlgorithmIdentifier()) {
185
        case CryptoAlgorithmIdentifier::SHA_1:
186
            jwk.alg = String(ALG1);
187
            break;
188
        case CryptoAlgorithmIdentifier::SHA_224:
189
            jwk.alg = String(ALG224);
190
            break;
191
        case CryptoAlgorithmIdentifier::SHA_256:
192
            jwk.alg = String(ALG256);
193
            break;
194
        case CryptoAlgorithmIdentifier::SHA_384:
195
            jwk.alg = String(ALG384);
196
            break;
197
        case CryptoAlgorithmIdentifier::SHA_512:
198
            jwk.alg = String(ALG512);
199
            break;
200
        default:
201
            ASSERT_NOT_REACHED();
202
        }
203
        result = WTFMove(jwk);
204
        break;
205
    }
206
    case SubtleCrypto::KeyFormat::Spki: {
207
        auto spki = rsaKey.exportSpki();
208
        if (spki.hasException()) {
209
            exceptionCallback(spki.releaseException().code());
210
            return;
211
        }
212
        result = spki.releaseReturnValue();
213
        break;
214
    }
215
    case SubtleCrypto::KeyFormat::Pkcs8: {
216
        auto pkcs8 = rsaKey.exportPkcs8();
217
        if (pkcs8.hasException()) {
218
            exceptionCallback(pkcs8.releaseException().code());
219
            return;
220
        }
221
        result = pkcs8.releaseReturnValue();
222
        break;
223
    }
224
    default:
225
        exceptionCallback(NOT_SUPPORTED_ERR);
226
        return;
227
    }
228
229
    callback(format, WTFMove(result));
230
}
231
232
}
233
234
#endif // ENABLE(SUBTLE_CRYPTO) && HAVE(RSA_PSS)
- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.h +58 lines
Line 0 a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.h_sec1
1
/*
2
 * Copyright (C) 2017 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include "CryptoAlgorithm.h"
29
30
#if ENABLE(SUBTLE_CRYPTO) && HAVE(RSA_PSS)
31
32
namespace WebCore {
33
34
class CryptoKeyRSA;
35
36
class CryptoAlgorithmRSA_PSS final : public CryptoAlgorithm {
37
public:
38
    static constexpr const char* s_name = "RSA-PSS";
39
    static constexpr CryptoAlgorithmIdentifier s_identifier = CryptoAlgorithmIdentifier::RSA_PSS;
40
    static Ref<CryptoAlgorithm> create();
41
42
private:
43
    CryptoAlgorithmRSA_PSS() = default;
44
    CryptoAlgorithmIdentifier identifier() const final;
45
46
    void sign(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
47
    void verify(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&& signature, Vector<uint8_t>&&, BoolCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
48
    void generateKey(const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
49
    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
50
    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
51
52
    void platformSign(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&);
53
    void platformVerify(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&& signature, Vector<uint8_t>&&, BoolCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&);
54
};
55
56
} // namespace WebCore
57
58
#endif // ENABLE(SUBTLE_CRYPTO) && HAVE(RSA_PSS)
- a/Source/WebCore/crypto/mac/CryptoAlgorithmECDSAMac.cpp -19 / +1 lines
Lines 31-61 a/Source/WebCore/crypto/mac/CryptoAlgorithmECDSAMac.cpp_sec1
31
#include "CommonCryptoDERUtilities.h"
31
#include "CommonCryptoDERUtilities.h"
32
#include "CommonCryptoUtilities.h"
32
#include "CommonCryptoUtilities.h"
33
#include "CryptoAlgorithmEcdsaParams.h"
33
#include "CryptoAlgorithmEcdsaParams.h"
34
#include "CryptoDigestAlgorithm.h"
34
#include "CryptoKeyEC.h"
35
#include "CryptoKeyEC.h"
35
#include "ExceptionCode.h"
36
#include "ExceptionCode.h"
36
#include "ScriptExecutionContext.h"
37
#include "ScriptExecutionContext.h"
37
#include <pal/crypto/CryptoDigest.h>
38
38
39
namespace WebCore {
39
namespace WebCore {
40
40
41
inline std::optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
42
{
43
    switch (hashFunction) {
44
    case CryptoAlgorithmIdentifier::SHA_1:
45
        return PAL::CryptoDigest::Algorithm::SHA_1;
46
    case CryptoAlgorithmIdentifier::SHA_224:
47
        return PAL::CryptoDigest::Algorithm::SHA_224;
48
    case CryptoAlgorithmIdentifier::SHA_256:
49
        return PAL::CryptoDigest::Algorithm::SHA_256;
50
    case CryptoAlgorithmIdentifier::SHA_384:
51
        return PAL::CryptoDigest::Algorithm::SHA_384;
52
    case CryptoAlgorithmIdentifier::SHA_512:
53
        return PAL::CryptoDigest::Algorithm::SHA_512;
54
    default:
55
        return std::nullopt;
56
    }
57
}
58
59
static ExceptionOr<Vector<uint8_t>> signECDSA(CryptoAlgorithmIdentifier hash, const PlatformECKey key, size_t keyLengthInBytes, const Vector<uint8_t>& data)
41
static ExceptionOr<Vector<uint8_t>> signECDSA(CryptoAlgorithmIdentifier hash, const PlatformECKey key, size_t keyLengthInBytes, const Vector<uint8_t>& data)
60
{
42
{
61
    CCDigestAlgorithm digestAlgorithm;
43
    CCDigestAlgorithm digestAlgorithm;
- a/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp -19 / +1 lines
Lines 30-60 a/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp_sec1
30
30
31
#include "CommonCryptoUtilities.h"
31
#include "CommonCryptoUtilities.h"
32
#include "CryptoAlgorithmRsaSsaParamsDeprecated.h"
32
#include "CryptoAlgorithmRsaSsaParamsDeprecated.h"
33
#include "CryptoDigestAlgorithm.h"
33
#include "CryptoKeyRSA.h"
34
#include "CryptoKeyRSA.h"
34
#include "ExceptionCode.h"
35
#include "ExceptionCode.h"
35
#include "ScriptExecutionContext.h"
36
#include "ScriptExecutionContext.h"
36
#include <pal/crypto/CryptoDigest.h>
37
37
38
namespace WebCore {
38
namespace WebCore {
39
39
40
inline std::optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
41
{
42
    switch (hashFunction) {
43
    case CryptoAlgorithmIdentifier::SHA_1:
44
        return PAL::CryptoDigest::Algorithm::SHA_1;
45
    case CryptoAlgorithmIdentifier::SHA_224:
46
        return PAL::CryptoDigest::Algorithm::SHA_224;
47
    case CryptoAlgorithmIdentifier::SHA_256:
48
        return PAL::CryptoDigest::Algorithm::SHA_256;
49
    case CryptoAlgorithmIdentifier::SHA_384:
50
        return PAL::CryptoDigest::Algorithm::SHA_384;
51
    case CryptoAlgorithmIdentifier::SHA_512:
52
        return PAL::CryptoDigest::Algorithm::SHA_512;
53
    default:
54
        return std::nullopt;
55
    }
56
}
57
58
// FIXME: We should change data to Vector<uint8_t> type once WebKitSubtleCrypto is deprecated.
40
// FIXME: We should change data to Vector<uint8_t> type once WebKitSubtleCrypto is deprecated.
59
// https://bugs.webkit.org/show_bug.cgi?id=164939
41
// https://bugs.webkit.org/show_bug.cgi?id=164939
60
static ExceptionOr<Vector<uint8_t>> signRSASSA_PKCS1_v1_5(CryptoAlgorithmIdentifier hash, const PlatformRSAKey key, size_t keyLength, const uint8_t* data, size_t dataLength)
42
static ExceptionOr<Vector<uint8_t>> signRSASSA_PKCS1_v1_5(CryptoAlgorithmIdentifier hash, const PlatformRSAKey key, size_t keyLength, const uint8_t* data, size_t dataLength)
- a/Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp +134 lines
Line 0 a/Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp_sec1
1
/*
2
 * Copyright (C) 2017 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "CryptoAlgorithmRSA_PSS.h"
28
29
#if ENABLE(SUBTLE_CRYPTO) && HAVE(RSA_PSS)
30
31
#include "CommonCryptoUtilities.h"
32
#include "CryptoAlgorithmRsaPssParams.h"
33
#include "CryptoDigestAlgorithm.h"
34
#include "CryptoKeyRSA.h"
35
#include "ExceptionCode.h"
36
#include "ScriptExecutionContext.h"
37
38
namespace WebCore {
39
40
static ExceptionOr<Vector<uint8_t>> signRSA_PSS(CryptoAlgorithmIdentifier hash, const PlatformRSAKey key, size_t keyLength, const Vector<uint8_t>& data, size_t saltLength)
41
{
42
    CCDigestAlgorithm digestAlgorithm;
43
    if (!getCommonCryptoDigestAlgorithm(hash, digestAlgorithm))
44
        return Exception { OperationError };
45
46
    auto cryptoDigestAlgorithm = WebCore::cryptoDigestAlgorithm(hash);
47
    if (!cryptoDigestAlgorithm)
48
        return Exception { OperationError };
49
    auto digest = PAL::CryptoDigest::create(*cryptoDigestAlgorithm);
50
    if (!digest)
51
        return Exception { OperationError };
52
    digest->addBytes(data.data(), data.size());
53
    auto digestData = digest->computeHash();
54
55
    Vector<uint8_t> signature(keyLength / 8); // Per https://tools.ietf.org/html/rfc3447#section-8.1.1
56
    size_t signatureSize = signature.size();
57
58
    CCCryptorStatus status = CCRSACryptorSign(key, ccRSAPSSPadding, digestData.data(), digestData.size(), digestAlgorithm, saltLength, signature.data(), &signatureSize);
59
    if (status)
60
        return Exception { OperationError };
61
62
    return WTFMove(signature);
63
}
64
65
static ExceptionOr<bool> verifyRSA_PSS(CryptoAlgorithmIdentifier hash, const PlatformRSAKey key, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, size_t saltLength)
66
{
67
    CCDigestAlgorithm digestAlgorithm;
68
    if (!getCommonCryptoDigestAlgorithm(hash, digestAlgorithm))
69
        return Exception { OperationError };
70
71
    auto cryptoDigestAlgorithm = WebCore::cryptoDigestAlgorithm(hash);
72
    if (!cryptoDigestAlgorithm)
73
        return Exception { OperationError };
74
    auto digest = PAL::CryptoDigest::create(*cryptoDigestAlgorithm);
75
    if (!digest)
76
        return Exception { OperationError };
77
    digest->addBytes(data.data(), data.size());
78
    auto digestData = digest->computeHash();
79
80
    auto status = CCRSACryptorVerify(key, ccRSAPSSPadding, digestData.data(), digestData.size(), digestAlgorithm, saltLength, signature.data(), signature.size());
81
    if (!status)
82
        return true;
83
    return false;
84
}
85
86
void CryptoAlgorithmRSA_PSS::platformSign(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& data, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
87
{
88
    context.ref();
89
    workQueue.dispatch([parameters = WTFMove(parameters), key = WTFMove(key), data = WTFMove(data), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), &context]() mutable {
90
        auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
91
        auto& rsaParams = downcast<CryptoAlgorithmRsaPssParams>(*parameters);
92
        auto result = signRSA_PSS(rsaKey.hashAlgorithmIdentifier(), rsaKey.platformKey(), rsaKey.keySizeInBits(), data, rsaParams.saltLength);
93
        if (result.hasException()) {
94
            // We should only dereference callbacks after being back to the Document/Worker threads.
95
            context.postTask([exceptionCallback = WTFMove(exceptionCallback), ec = result.releaseException().code(), callback = WTFMove(callback)](ScriptExecutionContext& context) {
96
                exceptionCallback(ec);
97
                context.deref();
98
            });
99
            return;
100
        }
101
        // We should only dereference callbacks after being back to the Document/Worker threads.
102
        context.postTask([callback = WTFMove(callback), result = result.releaseReturnValue(), exceptionCallback = WTFMove(exceptionCallback)](ScriptExecutionContext& context) {
103
            callback(result);
104
            context.deref();
105
        });
106
    });
107
}
108
109
void CryptoAlgorithmRSA_PSS::platformVerify(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& signature, Vector<uint8_t>&& data, BoolCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
110
{
111
    context.ref();
112
    workQueue.dispatch([parameters = WTFMove(parameters), key = WTFMove(key), signature = WTFMove(signature), data = WTFMove(data), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), &context]() mutable {
113
        auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
114
        auto& rsaParams = downcast<CryptoAlgorithmRsaPssParams>(*parameters);
115
        auto result = verifyRSA_PSS(rsaKey.hashAlgorithmIdentifier(), rsaKey.platformKey(), signature, data, rsaParams.saltLength);
116
        if (result.hasException()) {
117
            // We should only dereference callbacks after being back to the Document/Worker threads.
118
            context.postTask([exceptionCallback = WTFMove(exceptionCallback), ec = result.releaseException().code(), callback = WTFMove(callback)](ScriptExecutionContext& context) {
119
                exceptionCallback(ec);
120
                context.deref();
121
            });
122
            return;
123
        }
124
        // We should only dereference callbacks after being back to the Document/Worker threads.
125
        context.postTask([callback = WTFMove(callback), result = result.releaseReturnValue(), exceptionCallback = WTFMove(exceptionCallback)](ScriptExecutionContext& context) {
126
            callback(result);
127
            context.deref();
128
        });
129
    });
130
}
131
132
} // namespace WebCore
133
134
#endif // ENABLE(SUBTLE_CRYPTO) && HAVE(RSA_PSS)
- a/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp +4 lines
Lines 41-46 a/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp_sec1
41
#include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
41
#include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
42
#include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h"
42
#include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h"
43
#include "CryptoAlgorithmRSA_OAEP.h"
43
#include "CryptoAlgorithmRSA_OAEP.h"
44
#include "CryptoAlgorithmRSA_PSS.h"
44
#include "CryptoAlgorithmSHA1.h"
45
#include "CryptoAlgorithmSHA1.h"
45
#include "CryptoAlgorithmSHA224.h"
46
#include "CryptoAlgorithmSHA224.h"
46
#include "CryptoAlgorithmSHA256.h"
47
#include "CryptoAlgorithmSHA256.h"
Lines 64-69 void CryptoAlgorithmRegistry::platformRegisterAlgorithms() a/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp_sec2
64
    registerAlgorithm<CryptoAlgorithmRSAES_PKCS1_v1_5>();
65
    registerAlgorithm<CryptoAlgorithmRSAES_PKCS1_v1_5>();
65
    registerAlgorithm<CryptoAlgorithmRSASSA_PKCS1_v1_5>();
66
    registerAlgorithm<CryptoAlgorithmRSASSA_PKCS1_v1_5>();
66
    registerAlgorithm<CryptoAlgorithmRSA_OAEP>();
67
    registerAlgorithm<CryptoAlgorithmRSA_OAEP>();
68
#if HAVE(RSA_PSS)
69
    registerAlgorithm<CryptoAlgorithmRSA_PSS>();
70
#endif
67
    registerAlgorithm<CryptoAlgorithmSHA1>();
71
    registerAlgorithm<CryptoAlgorithmSHA1>();
68
    registerAlgorithm<CryptoAlgorithmSHA224>();
72
    registerAlgorithm<CryptoAlgorithmSHA224>();
69
    registerAlgorithm<CryptoAlgorithmSHA256>();
73
    registerAlgorithm<CryptoAlgorithmSHA256>();
- a/Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h +56 lines
Line 0 a/Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h_sec1
1
/*
2
 * Copyright (C) 2017 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include <pal/crypto/CryptoDigest.h>
29
30
#if ENABLE(SUBTLE_CRYPTO)
31
32
#include "CryptoAlgorithm.h"
33
34
namespace WebCore {
35
36
static std::optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
37
{
38
    switch (hashFunction) {
39
    case CryptoAlgorithmIdentifier::SHA_1:
40
        return PAL::CryptoDigest::Algorithm::SHA_1;
41
    case CryptoAlgorithmIdentifier::SHA_224:
42
        return PAL::CryptoDigest::Algorithm::SHA_224;
43
    case CryptoAlgorithmIdentifier::SHA_256:
44
        return PAL::CryptoDigest::Algorithm::SHA_256;
45
    case CryptoAlgorithmIdentifier::SHA_384:
46
        return PAL::CryptoDigest::Algorithm::SHA_384;
47
    case CryptoAlgorithmIdentifier::SHA_512:
48
        return PAL::CryptoDigest::Algorithm::SHA_512;
49
    default:
50
        return std::nullopt;
51
    }
52
}
53
54
} // namespace WebCore
55
56
#endif // ENABLE(SUBTLE_CRYPTO)
- a/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaPssParams.h +45 lines
Line 0 a/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaPssParams.h_sec1
1
/*
2
 * Copyright (C) 2017 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include "CryptoAlgorithmParameters.h"
29
30
#if ENABLE(SUBTLE_CRYPTO)
31
32
namespace WebCore {
33
34
class CryptoAlgorithmRsaPssParams final : public CryptoAlgorithmParameters {
35
public:
36
    size_t saltLength;
37
38
    Class parametersClass() const final { return Class::RsaPssParams; }
39
};
40
41
} // namespace WebCore
42
43
SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaPssParams)
44
45
#endif // ENABLE(SUBTLE_CRYPTO)
- a/Source/WebCore/crypto/parameters/RsaPssParams.idl +32 lines
Line 0 a/Source/WebCore/crypto/parameters/RsaPssParams.idl_sec1
1
/*
2
 * Copyright (C) 2017 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
[
27
    Conditional=SUBTLE_CRYPTO,
28
    ImplementedAs=CryptoAlgorithmRsaPssParams
29
] dictionary RsaPssParams : CryptoAlgorithmParameters {
30
    // The desired length of the random salt
31
    required [EnforceRange] unsigned long saltLength;
32
};
- a/LayoutTests/ChangeLog +63 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2017-05-22  Jiewen Tan  <jiewen_tan@apple.com>
2
3
        [WebCrypto] Support RSA-PSS
4
        https://bugs.webkit.org/show_bug.cgi?id=170869
5
        <rdar://problem/31640672>
6
7
        Reviewed by NOBODY (OOPS!).
8
9
        * TestExpectations:
10
        Skip tests related to RSA-PSS for now.
11
        * crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt:
12
        * crypto/subtle/rsa-generate-key-malformed-parameters.html:
13
        * crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
14
        * crypto/subtle/rsa-import-key-malformed-parameters.html:
15
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha1-expected.txt: Added.
16
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html: Added.
17
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha224-expected.txt: Added.
18
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html: Added.
19
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha256-expected.txt: Added.
20
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html: Added.
21
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha384-expected.txt: Added.
22
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html: Added.
23
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha512-expected.txt: Added.
24
        * crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html: Added.
25
        * crypto/subtle/rsa-pss-generate-export-key-pkcs8-expected.txt: Added.
26
        * crypto/subtle/rsa-pss-generate-export-key-pkcs8.html: Added.
27
        * crypto/subtle/rsa-pss-generate-export-key-spki-expected.txt: Added.
28
        * crypto/subtle/rsa-pss-generate-export-key-spki.html: Added.
29
        * crypto/subtle/rsa-pss-generate-key-expected.txt: Added.
30
        * crypto/subtle/rsa-pss-generate-key.html: Added.
31
        * crypto/subtle/rsa-pss-import-jwk-private-key-expected.txt: Added.
32
        * crypto/subtle/rsa-pss-import-jwk-private-key.html: Added.
33
        * crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages-expected.txt: Added.
34
        * crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html: Added.
35
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha1-expected.txt: Added.
36
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html: Added.
37
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha224-expected.txt: Added.
38
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html: Added.
39
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha256-expected.txt: Added.
40
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html: Added.
41
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha384-expected.txt: Added.
42
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html: Added.
43
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha512-expected.txt: Added.
44
        * crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html: Added.
45
        * crypto/subtle/rsa-pss-import-key-sign-expected.txt: Added.
46
        * crypto/subtle/rsa-pss-import-key-sign-large-salt-expected.txt: Added.
47
        * crypto/subtle/rsa-pss-import-key-sign-large-salt.html: Added.
48
        * crypto/subtle/rsa-pss-import-key-sign.html: Added.
49
        * crypto/subtle/rsa-pss-import-key-verify-expected.txt: Added.
50
        * crypto/subtle/rsa-pss-import-key-verify.html: Added.
51
        * crypto/subtle/rsa-pss-import-pkcs8-key-expected.txt: Added.
52
        * crypto/subtle/rsa-pss-import-pkcs8-key.html: Added.
53
        * crypto/subtle/rsa-pss-import-spki-key-empty-usages-expected.txt: Added.
54
        * crypto/subtle/rsa-pss-import-spki-key-empty-usages.html: Added.
55
        * crypto/subtle/rsa-pss-import-spki-key-expected.txt: Added.
56
        * crypto/subtle/rsa-pss-import-spki-key.html: Added.
57
        * crypto/workers/subtle/resources/rsa-pss-import-key-sign.js: Added.
58
        * crypto/workers/subtle/resources/rsa-pss-import-key-verify.js: Added.
59
        * crypto/workers/subtle/rsa-pss-import-key-sign-expected.txt: Added.
60
        * crypto/workers/subtle/rsa-pss-import-key-sign.html: Added.
61
        * crypto/workers/subtle/rsa-pss-import-key-verify-expected.txt: Added.
62
        * crypto/workers/subtle/rsa-pss-import-key-verify.html: Added.
63
1
2017-05-16  Myles C. Maxfield  <mmaxfield@apple.com>
64
2017-05-16  Myles C. Maxfield  <mmaxfield@apple.com>
2
65
3
        REGRESSION(r212513): LastResort is platform-dependent, so its semantics should not be required to perform font loading correctly.
66
        REGRESSION(r212513): LastResort is platform-dependent, so its semantics should not be required to perform font loading correctly.
- a/LayoutTests/TestExpectations -1 / +24 lines
Lines 1020-1027 imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_successes_RSA-OAEP a/LayoutTests/TestExpectations_sec1
1020
imported/w3c/web-platform-tests/WebCryptoAPI/import_export/rsa_importKey.worker.html [ Slow ]
1020
imported/w3c/web-platform-tests/WebCryptoAPI/import_export/rsa_importKey.worker.html [ Slow ]
1021
imported/w3c/web-platform-tests/WebCryptoAPI/import_export/test_rsa_importKey.html [ Slow ]
1021
imported/w3c/web-platform-tests/WebCryptoAPI/import_export/test_rsa_importKey.html [ Slow ]
1022
1022
1023
# WebCryptoAPI tests that we haven't fully supported yet
1023
# WebCryptoAPI features that hasn't been enabled for current OS
1024
imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html [ Skip ]
1024
imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html [ Skip ]
1025
crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html [ Skip ]
1026
crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html [ Skip ]
1027
crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html [ Skip ]
1028
crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html [ Skip ]
1029
crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html [ Skip ]
1030
crypto/subtle/rsa-pss-generate-export-key-pkcs8.html [ Skip ]
1031
crypto/subtle/rsa-pss-generate-export-key-spki.html [ Skip ]
1032
crypto/subtle/rsa-pss-generate-key.html [ Skip ]
1033
crypto/subtle/rsa-pss-import-jwk-private-key.html [ Skip ]
1034
crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html [ Skip ]
1035
crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html [ Skip ]
1036
crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html [ Skip ]
1037
crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html [ Skip ]
1038
crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html [ Skip ]
1039
crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html [ Skip ]
1040
crypto/subtle/rsa-pss-import-key-sign-large-salt.html [ Skip ]
1041
crypto/subtle/rsa-pss-import-key-sign.html [ Skip ]
1042
crypto/subtle/rsa-pss-import-key-verify.html [ Skip ]
1043
crypto/subtle/rsa-pss-import-pkcs8-key.html [ Skip ]
1044
crypto/subtle/rsa-pss-import-spki-key-empty-usages.html [ Skip ]
1045
crypto/subtle/rsa-pss-import-spki-key.html [ Skip ]
1046
crypto/workers/subtle/rsa-pss-import-key-sign.html [ Skip ]
1047
crypto/workers/subtle/rsa-pss-import-key-verify.html [ Skip ]
1025
1048
1026
# WebCryptoAPI superset tests
1049
# WebCryptoAPI superset tests
1027
imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures.html [ Skip ]
1050
imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures.html [ Skip ]
- a/LayoutTests/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt +6 lines
Lines 33-38 PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExp a/LayoutTests/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt_sec1
33
PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["verify"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
33
PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["verify"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
34
PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
34
PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
35
PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveBits"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
35
PASS crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveBits"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
36
PASS crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["encrypt"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
37
PASS crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["decrypt"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
38
PASS crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveKey"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
39
PASS crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveBits"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
40
PASS crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["wrapKey"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
41
PASS crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["unwrapKey"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
36
PASS crypto.subtle.generateKey({name: "RSASSA-PKCS1-v1_5", modulusLength: 0, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
42
PASS crypto.subtle.generateKey({name: "RSASSA-PKCS1-v1_5", modulusLength: 0, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
37
PASS successfullyParsed is true
43
PASS successfullyParsed is true
38
44
- a/LayoutTests/crypto/subtle/rsa-generate-key-malformed-parameters.html +6 lines
Lines 49-54 shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, a/LayoutTests/crypto/subtle/rsa-generate-key-malformed-parameters.html_sec1
49
shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["verify"])');
49
shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["verify"])');
50
shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveKey"])');
50
shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveKey"])');
51
shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveBits"])');
51
shouldReject('crypto.subtle.generateKey({name: "RSA-OAEP", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveBits"])');
52
shouldReject('crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["encrypt"])');
53
shouldReject('crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["decrypt"])');
54
shouldReject('crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveKey"])');
55
shouldReject('crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["deriveBits"])');
56
shouldReject('crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["wrapKey"])');
57
shouldReject('crypto.subtle.generateKey({name: "RSA-PSS", modulusLength: 2048, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["unwrapKey"])');
52
// modulusLength = 0
58
// modulusLength = 0
53
shouldReject('crypto.subtle.generateKey({name: "RSASSA-PKCS1-v1_5", modulusLength: 0, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["sign", "verify"])').then(finishJSTest);
59
shouldReject('crypto.subtle.generateKey({name: "RSASSA-PKCS1-v1_5", modulusLength: 0, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["sign", "verify"])').then(finishJSTest);
54
</script>
60
</script>
- a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt +17 lines
Lines 12-23 PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt_sec1
12
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
12
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
13
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
13
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
14
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
14
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
15
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
16
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
17
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
15
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
18
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
16
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
19
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
17
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
20
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
18
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
21
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
19
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
22
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
20
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
23
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
24
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc"}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
25
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
21
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "foo"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
26
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "foo"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
22
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
27
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
23
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS224"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
28
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS224"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
Lines 40-45 PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "R a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt_sec2
40
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-256"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
45
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-256"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
41
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-384"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
46
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-384"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
42
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-512"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
47
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-512"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
48
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS224"}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
49
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS256"}, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
50
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS384"}, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
51
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS512"}, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
52
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS1"}, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
53
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
54
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
55
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
56
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
57
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
43
PASS crypto.subtle.importKey("jwk", {kty: "oct", n: n, e: e}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
58
PASS crypto.subtle.importKey("jwk", {kty: "oct", n: n, e: e}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
44
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, key_ops: ["sign", "verify"]}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
59
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, key_ops: ["sign", "verify"]}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
45
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, key_ops: [ ]}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
60
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, key_ops: [ ]}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
Lines 58-66 PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: "", q: q, a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt_sec3
58
PASS crypto.subtle.importKey("spki", spkiKey, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
73
PASS crypto.subtle.importKey("spki", spkiKey, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
59
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["sign"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
74
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["sign"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
60
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
75
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
76
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
61
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
77
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
62
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
78
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
63
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
79
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
80
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
64
PASS crypto.subtle.importKey("spki", malformedKey0, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
81
PASS crypto.subtle.importKey("spki", malformedKey0, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
65
PASS crypto.subtle.importKey("spki", malformedKey1, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
82
PASS crypto.subtle.importKey("spki", malformedKey1, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
66
PASS crypto.subtle.importKey("spki", malformedKey2, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
83
PASS crypto.subtle.importKey("spki", malformedKey2, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
- a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html +17 lines
Lines 42-47 shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {n a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html_sec1
42
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"])');
42
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"])');
43
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
43
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
44
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
44
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
45
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"])');
46
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
47
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
45
// Jwk: Wrong use
48
// Jwk: Wrong use
46
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
49
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
47
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
50
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
Lines 49-54 shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc" a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html_sec2
49
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"])');
52
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"])');
50
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
53
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
51
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
54
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
55
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc"}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
56
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
52
// Jwk: Wrong alg
57
// Jwk: Wrong alg
53
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "foo"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
58
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "foo"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
54
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
59
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
Lines 72-77 shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html_sec3
72
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-256"}, extractable, ["encrypt", "wrapKey"])');
77
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-256"}, extractable, ["encrypt", "wrapKey"])');
73
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-384"}, extractable, ["encrypt", "wrapKey"])');
78
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-384"}, extractable, ["encrypt", "wrapKey"])');
74
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-512"}, extractable, ["encrypt", "wrapKey"])');
79
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-512"}, extractable, ["encrypt", "wrapKey"])');
80
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS224"}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
81
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS256"}, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["verify"])');
82
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS384"}, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["verify"])');
83
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS512"}, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["verify"])');
84
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS1"}, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["verify"])');
85
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
86
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["verify"])');
87
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["verify"])');
88
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["verify"])');
89
shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["verify"])');
75
// Jwk: Wrong kty
90
// Jwk: Wrong kty
76
shouldReject('crypto.subtle.importKey("jwk", {kty: "oct", n: n, e: e}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
91
shouldReject('crypto.subtle.importKey("jwk", {kty: "oct", n: n, e: e}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
77
// Jwk: Wrong key_ops
92
// Jwk: Wrong key_ops
Lines 98-107 shouldReject('crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: " a/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html_sec4
98
shouldReject('crypto.subtle.importKey("spki", spkiKey, "RSAES-PKCS1-v1_5", extractable, ["decrypt"])');
113
shouldReject('crypto.subtle.importKey("spki", spkiKey, "RSAES-PKCS1-v1_5", extractable, ["decrypt"])');
99
shouldReject('crypto.subtle.importKey("spki", spkiKey, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["sign"])');
114
shouldReject('crypto.subtle.importKey("spki", spkiKey, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["sign"])');
100
shouldReject('crypto.subtle.importKey("spki", spkiKey, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"])');
115
shouldReject('crypto.subtle.importKey("spki", spkiKey, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"])');
116
shouldReject('crypto.subtle.importKey("spki", spkiKey, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"])');
101
// Pkcs8: Wrong usages
117
// Pkcs8: Wrong usages
102
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
118
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
103
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"])');
119
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"])');
104
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
120
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"])');
121
shouldReject('crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"])');
105
// Malformed Key for Spki and Pkcs8
122
// Malformed Key for Spki and Pkcs8
106
shouldReject('crypto.subtle.importKey("spki", malformedKey0, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
123
shouldReject('crypto.subtle.importKey("spki", malformedKey0, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
107
shouldReject('crypto.subtle.importKey("spki", malformedKey1, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
124
shouldReject('crypto.subtle.importKey("spki", malformedKey1, "RSAES-PKCS1-v1_5", extractable, ["encrypt"])');
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha1-expected.txt +25 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha1-expected.txt_sec1
1
Test exporting a SHA-1 RSA-PSS key pair with JWK format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the public key...
8
PASS publicKey.kty is 'RSA'
9
PASS publicKey.key_ops is ['verify']
10
PASS publicKey.alg is 'PS1'
11
PASS publicKey.ext is true
12
PASS Base64URL.parse(publicKey.n).byteLength is 256
13
PASS bytesToHexString(Base64URL.parse(publicKey.e)) is '010001'
14
Exporting the private key...
15
PASS privateKey.kty is 'RSA'
16
PASS privateKey.key_ops is ['sign']
17
PASS privateKey.alg is 'PS1'
18
PASS privateKey.ext is true
19
PASS Base64URL.parse(privateKey.n).byteLength is 256
20
PASS bytesToHexString(Base64URL.parse(privateKey.e)) is '010001'
21
PASS privateKey.oth is undefined.
22
PASS successfullyParsed is true
23
24
TEST COMPLETE
25
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html +60 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a SHA-1 RSA-PSS key pair with JWK format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-1",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the public key...");
30
    return crypto.subtle.exportKey("jwk", keyPair.publicKey);
31
}).then(function(result) {
32
    publicKey = result;
33
34
    shouldBe("publicKey.kty", "'RSA'");
35
    shouldBe("publicKey.key_ops", "['verify']");
36
    shouldBe("publicKey.alg", "'PS1'");
37
    shouldBe("publicKey.ext", "true");
38
    shouldBe("Base64URL.parse(publicKey.n).byteLength", "256");
39
    shouldBe("bytesToHexString(Base64URL.parse(publicKey.e))", "'010001'");
40
41
    debug("Exporting the private key...");
42
    return crypto.subtle.exportKey("jwk", keyPair.privateKey);
43
}).then(function(result) {
44
    privateKey = result;
45
46
    shouldBe("privateKey.kty", "'RSA'");
47
    shouldBe("privateKey.key_ops", "['sign']");
48
    shouldBe("privateKey.alg", "'PS1'");
49
    shouldBe("privateKey.ext", "true");
50
    shouldBe("Base64URL.parse(privateKey.n).byteLength", "256");
51
    shouldBe("bytesToHexString(Base64URL.parse(privateKey.e))", "'010001'");
52
    shouldBeUndefined("privateKey.oth");
53
54
    finishJSTest();
55
});
56
</script>
57
58
<script src="../../resources/js-test-post.js"></script>
59
</body>
60
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha224-expected.txt +25 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha224-expected.txt_sec1
1
Test exporting a SHA-224 RSA-PSS key pair with JWK format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the public key...
8
PASS publicKey.kty is 'RSA'
9
PASS publicKey.key_ops is ['verify']
10
PASS publicKey.alg is 'PS224'
11
PASS publicKey.ext is true
12
PASS Base64URL.parse(publicKey.n).byteLength is 256
13
PASS bytesToHexString(Base64URL.parse(publicKey.e)) is '010001'
14
Exporting the private key...
15
PASS privateKey.kty is 'RSA'
16
PASS privateKey.key_ops is ['sign']
17
PASS privateKey.alg is 'PS224'
18
PASS privateKey.ext is true
19
PASS Base64URL.parse(privateKey.n).byteLength is 256
20
PASS bytesToHexString(Base64URL.parse(privateKey.e)) is '010001'
21
PASS privateKey.oth is undefined.
22
PASS successfullyParsed is true
23
24
TEST COMPLETE
25
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html +60 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a SHA-224 RSA-PSS key pair with JWK format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-224",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the public key...");
30
    return crypto.subtle.exportKey("jwk", keyPair.publicKey);
31
}).then(function(result) {
32
    publicKey = result;
33
34
    shouldBe("publicKey.kty", "'RSA'");
35
    shouldBe("publicKey.key_ops", "['verify']");
36
    shouldBe("publicKey.alg", "'PS224'");
37
    shouldBe("publicKey.ext", "true");
38
    shouldBe("Base64URL.parse(publicKey.n).byteLength", "256");
39
    shouldBe("bytesToHexString(Base64URL.parse(publicKey.e))", "'010001'");
40
41
    debug("Exporting the private key...");
42
    return crypto.subtle.exportKey("jwk", keyPair.privateKey);
43
}).then(function(result) {
44
    privateKey = result;
45
46
    shouldBe("privateKey.kty", "'RSA'");
47
    shouldBe("privateKey.key_ops", "['sign']");
48
    shouldBe("privateKey.alg", "'PS224'");
49
    shouldBe("privateKey.ext", "true");
50
    shouldBe("Base64URL.parse(privateKey.n).byteLength", "256");
51
    shouldBe("bytesToHexString(Base64URL.parse(privateKey.e))", "'010001'");
52
    shouldBeUndefined("privateKey.oth");
53
54
    finishJSTest();
55
});
56
</script>
57
58
<script src="../../resources/js-test-post.js"></script>
59
</body>
60
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha256-expected.txt +25 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha256-expected.txt_sec1
1
Test exporting a SHA-256 RSA-PSS key pair with JWK format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the public key...
8
PASS publicKey.kty is 'RSA'
9
PASS publicKey.key_ops is ['verify']
10
PASS publicKey.alg is 'PS256'
11
PASS publicKey.ext is true
12
PASS Base64URL.parse(publicKey.n).byteLength is 256
13
PASS bytesToHexString(Base64URL.parse(publicKey.e)) is '010001'
14
Exporting the private key...
15
PASS privateKey.kty is 'RSA'
16
PASS privateKey.key_ops is ['sign']
17
PASS privateKey.alg is 'PS256'
18
PASS privateKey.ext is true
19
PASS Base64URL.parse(privateKey.n).byteLength is 256
20
PASS bytesToHexString(Base64URL.parse(privateKey.e)) is '010001'
21
PASS privateKey.oth is undefined.
22
PASS successfullyParsed is true
23
24
TEST COMPLETE
25
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html +60 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a SHA-256 RSA-PSS key pair with JWK format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-256",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the public key...");
30
    return crypto.subtle.exportKey("jwk", keyPair.publicKey);
31
}).then(function(result) {
32
    publicKey = result;
33
34
    shouldBe("publicKey.kty", "'RSA'");
35
    shouldBe("publicKey.key_ops", "['verify']");
36
    shouldBe("publicKey.alg", "'PS256'");
37
    shouldBe("publicKey.ext", "true");
38
    shouldBe("Base64URL.parse(publicKey.n).byteLength", "256");
39
    shouldBe("bytesToHexString(Base64URL.parse(publicKey.e))", "'010001'");
40
41
    debug("Exporting the private key...");
42
    return crypto.subtle.exportKey("jwk", keyPair.privateKey);
43
}).then(function(result) {
44
    privateKey = result;
45
46
    shouldBe("privateKey.kty", "'RSA'");
47
    shouldBe("privateKey.key_ops", "['sign']");
48
    shouldBe("privateKey.alg", "'PS256'");
49
    shouldBe("privateKey.ext", "true");
50
    shouldBe("Base64URL.parse(privateKey.n).byteLength", "256");
51
    shouldBe("bytesToHexString(Base64URL.parse(privateKey.e))", "'010001'");
52
    shouldBeUndefined("privateKey.oth");
53
54
    finishJSTest();
55
});
56
</script>
57
58
<script src="../../resources/js-test-post.js"></script>
59
</body>
60
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha384-expected.txt +25 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha384-expected.txt_sec1
1
Test exporting a SHA-384 RSA-PSS key pair with JWK format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the public key...
8
PASS publicKey.kty is 'RSA'
9
PASS publicKey.key_ops is ['verify']
10
PASS publicKey.alg is 'PS384'
11
PASS publicKey.ext is true
12
PASS Base64URL.parse(publicKey.n).byteLength is 256
13
PASS bytesToHexString(Base64URL.parse(publicKey.e)) is '010001'
14
Exporting the private key...
15
PASS privateKey.kty is 'RSA'
16
PASS privateKey.key_ops is ['sign']
17
PASS privateKey.alg is 'PS384'
18
PASS privateKey.ext is true
19
PASS Base64URL.parse(privateKey.n).byteLength is 256
20
PASS bytesToHexString(Base64URL.parse(privateKey.e)) is '010001'
21
PASS privateKey.oth is undefined.
22
PASS successfullyParsed is true
23
24
TEST COMPLETE
25
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html +60 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a SHA-384 RSA-PSS key pair with JWK format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-384",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the public key...");
30
    return crypto.subtle.exportKey("jwk", keyPair.publicKey);
31
}).then(function(result) {
32
    publicKey = result;
33
34
    shouldBe("publicKey.kty", "'RSA'");
35
    shouldBe("publicKey.key_ops", "['verify']");
36
    shouldBe("publicKey.alg", "'PS384'");
37
    shouldBe("publicKey.ext", "true");
38
    shouldBe("Base64URL.parse(publicKey.n).byteLength", "256");
39
    shouldBe("bytesToHexString(Base64URL.parse(publicKey.e))", "'010001'");
40
41
    debug("Exporting the private key...");
42
    return crypto.subtle.exportKey("jwk", keyPair.privateKey);
43
}).then(function(result) {
44
    privateKey = result;
45
46
    shouldBe("privateKey.kty", "'RSA'");
47
    shouldBe("privateKey.key_ops", "['sign']");
48
    shouldBe("privateKey.alg", "'PS384'");
49
    shouldBe("privateKey.ext", "true");
50
    shouldBe("Base64URL.parse(privateKey.n).byteLength", "256");
51
    shouldBe("bytesToHexString(Base64URL.parse(privateKey.e))", "'010001'");
52
    shouldBeUndefined("privateKey.oth");
53
54
    finishJSTest();
55
});
56
</script>
57
58
<script src="../../resources/js-test-post.js"></script>
59
</body>
60
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha512-expected.txt +25 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha512-expected.txt_sec1
1
Test exporting a SHA-512 RSA-PSS key pair with JWK format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the public key...
8
PASS publicKey.kty is 'RSA'
9
PASS publicKey.key_ops is ['verify']
10
PASS publicKey.alg is 'PS512'
11
PASS publicKey.ext is true
12
PASS Base64URL.parse(publicKey.n).byteLength is 256
13
PASS bytesToHexString(Base64URL.parse(publicKey.e)) is '010001'
14
Exporting the private key...
15
PASS privateKey.kty is 'RSA'
16
PASS privateKey.key_ops is ['sign']
17
PASS privateKey.alg is 'PS512'
18
PASS privateKey.ext is true
19
PASS Base64URL.parse(privateKey.n).byteLength is 256
20
PASS bytesToHexString(Base64URL.parse(privateKey.e)) is '010001'
21
PASS privateKey.oth is undefined.
22
PASS successfullyParsed is true
23
24
TEST COMPLETE
25
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html +60 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a SHA-512 RSA-PSS key pair with JWK format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-512",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the public key...");
30
    return crypto.subtle.exportKey("jwk", keyPair.publicKey);
31
}).then(function(result) {
32
    publicKey = result;
33
34
    shouldBe("publicKey.kty", "'RSA'");
35
    shouldBe("publicKey.key_ops", "['verify']");
36
    shouldBe("publicKey.alg", "'PS512'");
37
    shouldBe("publicKey.ext", "true");
38
    shouldBe("Base64URL.parse(publicKey.n).byteLength", "256");
39
    shouldBe("bytesToHexString(Base64URL.parse(publicKey.e))", "'010001'");
40
41
    debug("Exporting the private key...");
42
    return crypto.subtle.exportKey("jwk", keyPair.privateKey);
43
}).then(function(result) {
44
    privateKey = result;
45
46
    shouldBe("privateKey.kty", "'RSA'");
47
    shouldBe("privateKey.key_ops", "['sign']");
48
    shouldBe("privateKey.alg", "'PS512'");
49
    shouldBe("privateKey.ext", "true");
50
    shouldBe("Base64URL.parse(privateKey.n).byteLength", "256");
51
    shouldBe("bytesToHexString(Base64URL.parse(privateKey.e))", "'010001'");
52
    shouldBeUndefined("privateKey.oth");
53
54
    finishJSTest();
55
});
56
</script>
57
58
<script src="../../resources/js-test-post.js"></script>
59
</body>
60
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-pkcs8-expected.txt +12 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-pkcs8-expected.txt_sec1
1
Test exporting a RSA-PSS private key with PKCS8 format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the private key...
8
PASS privateKey is an instance of ArrayBuffer
9
PASS successfullyParsed is true
10
11
TEST COMPLETE
12
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-pkcs8.html +42 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-pkcs8.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a RSA-PSS private key with PKCS8 format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-1",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the private key...");
30
    return crypto.subtle.exportKey("pkcs8", keyPair.privateKey);
31
}).then(function(result) {
32
    privateKey = result;
33
34
    shouldBeType("privateKey", "ArrayBuffer");
35
36
    finishJSTest();
37
});
38
</script>
39
40
<script src="../../resources/js-test-post.js"></script>
41
</body>
42
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-spki-expected.txt +12 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-spki-expected.txt_sec1
1
Test exporting a RSA-PSS public key with SPKI format.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
Exporting the public key...
8
PASS publicKey.byteLength is 294
9
PASS successfullyParsed is true
10
11
TEST COMPLETE
12
- a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-spki.html +42 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-export-key-spki.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test exporting a RSA-PSS public key with SPKI format.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-1",
22
};
23
var extractable = true;
24
25
var keyPair;
26
debug("Generating a key pair...");
27
crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
28
    keyPair = result;
29
    debug("Exporting the public key...");
30
    return crypto.subtle.exportKey("spki", keyPair.publicKey);
31
}).then(function(result) {
32
    publicKey = result;
33
34
    shouldBe("publicKey.byteLength", "294");
35
36
    finishJSTest();
37
});
38
</script>
39
40
<script src="../../resources/js-test-post.js"></script>
41
</body>
42
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-generate-key-expected.txt +25 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-key-expected.txt_sec1
1
Test generating an RSA key using RSA-PSS algorithm.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Generating a key pair...
7
PASS keyPair.toString() is '[object Object]'
8
PASS keyPair.publicKey.type is 'public'
9
PASS keyPair.publicKey.extractable is true
10
PASS keyPair.publicKey.algorithm.name is 'RSA-PSS'
11
PASS keyPair.publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
13
PASS keyPair.publicKey.algorithm.hash.name is 'SHA-1'
14
PASS keyPair.publicKey.usages is ['verify']
15
PASS keyPair.privateKey.type is 'private'
16
PASS keyPair.privateKey.extractable is false
17
PASS keyPair.privateKey.algorithm.name is 'RSA-PSS'
18
PASS keyPair.privateKey.algorithm.modulusLength is 2048
19
PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
20
PASS keyPair.privateKey.algorithm.hash.name is 'SHA-1'
21
PASS keyPair.privateKey.usages is ['sign']
22
PASS successfullyParsed is true
23
24
TEST COMPLETE
25
- a/LayoutTests/crypto/subtle/rsa-pss-generate-key.html +50 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-generate-key.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test generating an RSA key using RSA-PSS algorithm.");
13
14
jsTestIsAsync = true;
15
16
var algorithmKeyGen = {
17
    name: "RSA-PSS",
18
    // RsaKeyGenParams
19
    modulusLength: 2048,
20
    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
21
    hash: "sha-1",
22
};
23
var nonExtractable = false;
24
25
debug("Generating a key pair...");
26
crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, ["sign", "verify"]).then(function(result) {
27
    keyPair = result;
28
    shouldBe("keyPair.toString()", "'[object Object]'");
29
    shouldBe("keyPair.publicKey.type", "'public'");
30
    shouldBe("keyPair.publicKey.extractable", "true");
31
    shouldBe("keyPair.publicKey.algorithm.name", "'RSA-PSS'");
32
    shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
33
    shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
34
    shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-1'");
35
    shouldBe("keyPair.publicKey.usages", "['verify']");
36
    shouldBe("keyPair.privateKey.type", "'private'");
37
    shouldBe("keyPair.privateKey.extractable", "false");
38
    shouldBe("keyPair.privateKey.algorithm.name", "'RSA-PSS'");
39
    shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
40
    shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
41
    shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-1'");
42
    shouldBe("keyPair.privateKey.usages", "['sign']");
43
44
    finishJSTest();
45
});
46
</script>
47
48
<script src="../../resources/js-test-post.js"></script>
49
</body>
50
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-private-key-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-private-key-expected.txt_sec1
1
Test importing a JWK RSA-PSS private key with SHA-1
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS privateKey.toString() is '[object CryptoKey]'
8
PASS privateKey.type is 'private'
9
PASS privateKey.extractable is true
10
PASS privateKey.algorithm.name is 'RSA-PSS'
11
PASS privateKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
13
PASS privateKey.algorithm.hash.name is 'SHA-1'
14
PASS privateKey.usages is ['sign']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-private-key.html +53 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-private-key.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS private key with SHA-1");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS1",
19
    use: "sig",
20
    key_ops: ["sign"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB",
24
    d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
25
    p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
26
    q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
27
    dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
28
    dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
29
    qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk",
30
};
31
var extractable = true;
32
33
debug("Importing a key...");
34
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-1"}, extractable, ["sign"]).then(function(result) {
35
    privateKey = result;
36
37
    shouldBe("privateKey.toString()", "'[object CryptoKey]'");
38
    shouldBe("privateKey.type", "'private'");
39
    shouldBe("privateKey.extractable", "true");
40
    shouldBe("privateKey.algorithm.name", "'RSA-PSS'");
41
    shouldBe("privateKey.algorithm.modulusLength", "2048");
42
    shouldBe("bytesToHexString(privateKey.algorithm.publicExponent)", "'010001'");
43
    shouldBe("privateKey.algorithm.hash.name", "'SHA-1'");
44
    shouldBe("privateKey.usages", "['sign']");
45
46
    finishJSTest();
47
});
48
49
</script>
50
51
<script src="../../resources/js-test-post.js"></script>
52
</body>
53
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages-expected.txt_sec1
1
Test importing a JWK RSA-PSS public key with SHA-1 and empty usages
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-1'
14
PASS publicKey.usages is [ ]
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS public key with SHA-1 and empty usages");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS1",
19
    use: "sig",
20
    key_ops: ["verify"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB"
24
};
25
var extractable = true;
26
27
debug("Importing a key...");
28
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-1"}, extractable, [ ]).then(function(result) {
29
    publicKey = result;
30
31
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
32
    shouldBe("publicKey.type", "'public'");
33
    shouldBe("publicKey.extractable", "true");
34
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
35
    shouldBe("publicKey.algorithm.modulusLength", "2048");
36
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
37
    shouldBe("publicKey.algorithm.hash.name", "'SHA-1'");
38
    shouldBe("publicKey.usages", "[ ]");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha1-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha1-expected.txt_sec1
1
Test importing a JWK RSA-PSS public key with SHA-1
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-1'
14
PASS publicKey.usages is ['verify']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS public key with SHA-1");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS1",
19
    use: "sig",
20
    key_ops: ["verify"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB"
24
};
25
var extractable = true;
26
27
debug("Importing a key...");
28
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-1"}, extractable, ["verify"]).then(function(result) {
29
    publicKey = result;
30
31
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
32
    shouldBe("publicKey.type", "'public'");
33
    shouldBe("publicKey.extractable", "true");
34
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
35
    shouldBe("publicKey.algorithm.modulusLength", "2048");
36
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
37
    shouldBe("publicKey.algorithm.hash.name", "'SHA-1'");
38
    shouldBe("publicKey.usages", "['verify']");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha224-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha224-expected.txt_sec1
1
Test importing a JWK RSA-PSS public key with SHA-224
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-224'
14
PASS publicKey.usages is ['verify']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS public key with SHA-224");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS224",
19
    use: "sig",
20
    key_ops: ["verify"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB"
24
};
25
var extractable = true;
26
27
debug("Importing a key...");
28
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-224"}, extractable, ["verify"]).then(function(result) {
29
    publicKey = result;
30
31
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
32
    shouldBe("publicKey.type", "'public'");
33
    shouldBe("publicKey.extractable", "true");
34
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
35
    shouldBe("publicKey.algorithm.modulusLength", "2048");
36
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
37
    shouldBe("publicKey.algorithm.hash.name", "'SHA-224'");
38
    shouldBe("publicKey.usages", "['verify']");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha256-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha256-expected.txt_sec1
1
Test importing a JWK RSA-PSS public key with SHA-256
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-256'
14
PASS publicKey.usages is ['verify']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS public key with SHA-256");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS256",
19
    use: "sig",
20
    key_ops: ["verify"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB"
24
};
25
var extractable = true;
26
27
debug("Importing a key...");
28
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-256"}, extractable, ["verify"]).then(function(result) {
29
    publicKey = result;
30
31
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
32
    shouldBe("publicKey.type", "'public'");
33
    shouldBe("publicKey.extractable", "true");
34
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
35
    shouldBe("publicKey.algorithm.modulusLength", "2048");
36
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
37
    shouldBe("publicKey.algorithm.hash.name", "'SHA-256'");
38
    shouldBe("publicKey.usages", "['verify']");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha384-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha384-expected.txt_sec1
1
Test importing a JWK RSA-PSS public key with SHA-384
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-384'
14
PASS publicKey.usages is ['verify']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS public key with SHA-384");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS384",
19
    use: "sig",
20
    key_ops: ["verify"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB"
24
};
25
var extractable = true;
26
27
debug("Importing a key...");
28
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-384"}, extractable, ["verify"]).then(function(result) {
29
    publicKey = result;
30
31
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
32
    shouldBe("publicKey.type", "'public'");
33
    shouldBe("publicKey.extractable", "true");
34
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
35
    shouldBe("publicKey.algorithm.modulusLength", "2048");
36
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
37
    shouldBe("publicKey.algorithm.hash.name", "'SHA-384'");
38
    shouldBe("publicKey.usages", "['verify']");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha512-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha512-expected.txt_sec1
1
Test importing a JWK RSA-PSS public key with SHA-512
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-512'
14
PASS publicKey.usages is ['verify']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a JWK RSA-PSS public key with SHA-512");
13
14
jsTestIsAsync = true;
15
16
var jwkKey = {
17
    kty: "RSA",
18
    alg: "PS512",
19
    use: "sig",
20
    key_ops: ["verify"],
21
    ext: true,
22
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23
    e: "AQAB"
24
};
25
var extractable = true;
26
27
debug("Importing a key...");
28
crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-PSS", hash: "SHA-512"}, extractable, ["verify"]).then(function(result) {
29
    publicKey = result;
30
31
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
32
    shouldBe("publicKey.type", "'public'");
33
    shouldBe("publicKey.extractable", "true");
34
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
35
    shouldBe("publicKey.algorithm.modulusLength", "2048");
36
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
37
    shouldBe("publicKey.algorithm.hash.name", "'SHA-512'");
38
    shouldBe("publicKey.usages", "['verify']");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign-expected.txt +10 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign-expected.txt_sec1
1
Test signing with RSA-PSS SHA-1 using an imported key
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS signature.byteLength is 256
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign-large-salt-expected.txt +14 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign-large-salt-expected.txt_sec1
1
Test RSA-PSS signing using an imported key with salt length larger than hash size
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS crypto.subtle.sign({ name: "RSA-PSS", saltLength: 21 }, key, text) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
7
PASS crypto.subtle.sign({ name: "RSA-PSS", saltLength: 29 }, key, text) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
8
PASS crypto.subtle.sign({ name: "RSA-PSS", saltLength: 33 }, key, text) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
9
PASS crypto.subtle.sign({ name: "RSA-PSS", saltLength: 49 }, key, text) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
10
PASS crypto.subtle.sign({ name: "RSA-PSS", saltLength: 65 }, key, text) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
11
PASS successfullyParsed is true
12
13
TEST COMPLETE
14
- a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign-large-salt.html +49 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign-large-salt.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test RSA-PSS signing using an imported key with salt length larger than hash size");
13
14
jsTestIsAsync = true;
15
16
var text = asciiToUint8Array("Hello, World!");
17
var pkcs8Key = hexStringToUint8Array("308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100ca6ee8ec62b6a02e187b70c19ca15a13c386a470ee8816c7340a270f96f905511f93362f8f7aae3e60394dac34cb29ea5f540d6ef80b1df7155b66a2d6d6e44092bcbafbf69b061b3f4d927060c81d0fa07d22f481ff503c0581ffa444f57345204ddf0a93a225979c61aeb9686557f7632002e165430452868d010d505e3ccfed7315432a298a9b6d1a6ede98ee746c2c8bd22f5495cee563e2db24f1e33d91ced83af1baac754dba4ddba430f6cf3d4ac7edb0bf69891140854e8700056a7ef6d06ed5a605a05e74ecb3b246ce9cb310b39b00c707af3a637862e3d2914013de212ff09a36db84d99b8d610d0cfd36a4411dbf1b62e06ebff1bee50f040ca502030100010282010024706483309db925b3087d5a8cac4abfa60195963289d2b7d6f940e0c08760daa279685695583b074560eb47655570dd1c7dcfd13adb1d70bdaa6f463eaffdf455b59d5eff9c16344f67d2456256834cadd1f8b9d4b0b5aba83e275b55826d567323315401113dfd158c4bdc5a1b6c033f17a30d19a23fa3ef4e70730a157c928b1c7840a34401d19daab52cfa9b424cc8e1084254ca597304be22547b7221e875bf1fdca2386ba1e855d5e0bcaba03376bfd73de8513c07ab0e67cb3554dc8c8f7a67d231f99a2b653ad471ee2f8bd3b8fad51b02f807d131b6b71ab17e45a5faf161ce3b919d96b5e78e9e4e1202d6398a954def4c1980da1fcc30d56167e102818100ee24b92668d38465fdd9a2262e64be56846be561e4cfbcedc82496a3190b549636923d61c3e5a2d40cc6d2c46a3e89ac23eb44ac40c777147e3e49a80bd382bae06e284f1cc553f89d78f0c7bf20fd3a33ee598ce2caf61e3f5457cd228ff03fe009f10952206bf248e161d17950c6655af75b097bbda1b909038d4d752cd11d02818100d99cb65195a399f9a3aca1ef1593592992e7d91cc028b713ec5b661b9976fcffdb086f523f042699cb910321fe7b67a27dd4a72822e6fbb98d005280721efc32d889d431d2737c92a4f34d4885c7a9c6244e081a1264a283d07744b752a68ebb6fbff3492a039e3e3a0cc5b94537582a7d11cc6b8678e4c338671f96be029b2902818100a1a2a7509ca1c4217db4f3cbba7d827b32921134ea9add7efef36692f8f2a9ccf2e93b645a1448fa6859a2c0d1e3f489b42f8182f0ccf1d425039df6c360224139074bb0b6b47094343ddc1f97688ab7b07bbca8555eb0c242f5ba4a6f8506ea33e44b87aa087b7c0d5f7c8733325216853192c6d30818f68059bad4b20d633902818034b3bf7402c99c80d922f614f124be735320d3742315b94119fd08bda66d2ad8cc333ec2ac8054d8ea74344e0753dbc57eb401c7b6ac3a4ab5db5e1fbd83c3908ce0d4833c74bbb6c83c247b6beaef330d97d85e7815e7460536dd6d8896cdfa9715e5d5d2570dfc041313cfcaf39c66ade3a19e68f2de7469349071f192b00102818060a8271f45161d8ecf62c3ac5f0fa8539b6d86a35123aafcc37541e2d5e5b62715777db0ef75f3cdf67506b8fcad6baed862eaf88fa1f280f42736b69a41ea7a3fea31ce62aa0563c85df1d9b02b83839c4ab9453e420c5c401cce979f6fb7b6ac12baf1e9140546eed24e92e383b8f2d37b3e4410844d235c7175112e751ee0");
18
var extractable = true;
19
20
crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"]).then(function(result) {
21
    key = result;
22
    return shouldReject('crypto.subtle.sign({ name: "RSA-PSS", saltLength: 21 }, key, text)');
23
}).then(function(result) {
24
    return crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["sign"]);
25
}).then(function(result) {
26
    key = result;
27
    return shouldReject('crypto.subtle.sign({ name: "RSA-PSS", saltLength: 29 }, key, text)');
28
}).then(function(result) {
29
    return crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["sign"]);
30
}).then(function(result) {
31
    key = result;
32
    return shouldReject('crypto.subtle.sign({ name: "RSA-PSS", saltLength: 33 }, key, text)');
33
}).then(function(result) {
34
    return crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["sign"]);
35
}).then(function(result) {
36
    key = result;
37
    return shouldReject('crypto.subtle.sign({ name: "RSA-PSS", saltLength: 49 }, key, text)');
38
}).then(function(result) {
39
    return crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["sign"]);
40
}).then(function(result) {
41
    key = result;
42
    return shouldReject('crypto.subtle.sign({ name: "RSA-PSS", saltLength: 65 }, key, text)');
43
}).then(finishJSTest);
44
45
</script>
46
47
<script src="../../resources/js-test-post.js"></script>
48
</body>
49
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign.html +52 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-key-sign.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test signing with RSA-PSS SHA-1 using an imported key");
13
14
jsTestIsAsync = true;
15
16
var extractable = false;
17
var text = asciiToUint8Array("Hello, World!");
18
var rsaImportParams = {
19
    name: "RSA-PSS",
20
    hash: "SHA-1",
21
}
22
var jwkKey = {
23
    kty: "RSA",
24
    alg: "PS1",
25
    use: "sig",
26
    key_ops: ["sign"],
27
    ext: true,
28
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
29
    e: "AQAB",
30
    d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
31
    p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
32
    q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
33
    dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
34
    dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
35
    qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk",
36
};
37
38
crypto.subtle.importKey("jwk", jwkKey, rsaImportParams, extractable, ["sign"]).then(function(key) {
39
    return crypto.subtle.sign({ name: "RSA-PSS", saltLength: 16 }, key, text);
40
}).then(function(result) {
41
    signature = result;
42
43
    shouldBe("signature.byteLength", "256");
44
45
    finishJSTest();
46
}, failAndFinishJSTest);
47
48
</script>
49
50
<script src="../../resources/js-test-post.js"></script>
51
</body>
52
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-key-verify-expected.txt +10 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-key-verify-expected.txt_sec1
1
Test verification with RSA-PSS SHA-1 using an imported key
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS verified is true
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- a/LayoutTests/crypto/subtle/rsa-pss-import-key-verify.html +47 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-key-verify.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test verification with RSA-PSS SHA-1 using an imported key");
13
14
jsTestIsAsync = true;
15
16
var extractable = false;
17
var text = asciiToUint8Array("Hello, World!");
18
var rsaImportParams = {
19
    name: "RSA-PSS",
20
    hash: "SHA-1",
21
}
22
var jwkKey = {
23
    kty: "RSA",
24
    alg: "PS1",
25
    use: "sig",
26
    key_ops: ["verify"],
27
    ext: true,
28
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
29
    e: "AQAB",
30
};
31
var signature = hexStringToUint8Array("3119faeed99f4ef0516f9f8e8429bf9bd98aba7d0a89a8ca9331513094f4a2ab9cfdc003d618ef10254263b5631355d8a5a0bb082584f33db8da8a1f9283c2ee70c821d0feac3d7e63b0c612fb9aef003000a423b650e80858b2eb8b4cea8f61822344f816dc1f325c305e3d547f6b19f172703b47639d41c84dce94b33b58a3a9b6c0b6a5ce43087cc0ed2a06e5c525cdaa80d856c1e4316a792ad4af795936594c35c985c11c3eb2bb37013d2e3ce67a74664ef58bbf0b0f16e2b68d29180006b6a17abd95c444aac723ac7213d57bea714882c6c8b139ef007d6157dea01d8d2573aef64ac912958aeae7fa1b59633c8526220d7db6a8e362774243156a01");
32
33
crypto.subtle.importKey("jwk", jwkKey, rsaImportParams, extractable, ["verify"]).then(function(key) {
34
    return crypto.subtle.verify({ name: "RSA-PSS", saltLength: 16 }, key, signature, text);
35
}).then(function(result) {
36
    verified = result;
37
38
    shouldBeTrue("verified");
39
40
    finishJSTest();
41
});
42
43
</script>
44
45
<script src="../../resources/js-test-post.js"></script>
46
</body>
47
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-pkcs8-key-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-pkcs8-key-expected.txt_sec1
1
Test importing a PKCS8 RSA-PSS key
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS privateKey.toString() is '[object CryptoKey]'
8
PASS privateKey.type is 'private'
9
PASS privateKey.extractable is true
10
PASS privateKey.algorithm.name is 'RSA-PSS'
11
PASS privateKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
13
PASS privateKey.algorithm.hash.name is 'SHA-1'
14
PASS privateKey.usages is ['sign']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-pkcs8-key.html +39 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-pkcs8-key.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a PKCS8 RSA-PSS key");
13
14
jsTestIsAsync = true;
15
16
var pkcs8Key = hexStringToUint8Array("308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100ca6ee8ec62b6a02e187b70c19ca15a13c386a470ee8816c7340a270f96f905511f93362f8f7aae3e60394dac34cb29ea5f540d6ef80b1df7155b66a2d6d6e44092bcbafbf69b061b3f4d927060c81d0fa07d22f481ff503c0581ffa444f57345204ddf0a93a225979c61aeb9686557f7632002e165430452868d010d505e3ccfed7315432a298a9b6d1a6ede98ee746c2c8bd22f5495cee563e2db24f1e33d91ced83af1baac754dba4ddba430f6cf3d4ac7edb0bf69891140854e8700056a7ef6d06ed5a605a05e74ecb3b246ce9cb310b39b00c707af3a637862e3d2914013de212ff09a36db84d99b8d610d0cfd36a4411dbf1b62e06ebff1bee50f040ca502030100010282010024706483309db925b3087d5a8cac4abfa60195963289d2b7d6f940e0c08760daa279685695583b074560eb47655570dd1c7dcfd13adb1d70bdaa6f463eaffdf455b59d5eff9c16344f67d2456256834cadd1f8b9d4b0b5aba83e275b55826d567323315401113dfd158c4bdc5a1b6c033f17a30d19a23fa3ef4e70730a157c928b1c7840a34401d19daab52cfa9b424cc8e1084254ca597304be22547b7221e875bf1fdca2386ba1e855d5e0bcaba03376bfd73de8513c07ab0e67cb3554dc8c8f7a67d231f99a2b653ad471ee2f8bd3b8fad51b02f807d131b6b71ab17e45a5faf161ce3b919d96b5e78e9e4e1202d6398a954def4c1980da1fcc30d56167e102818100ee24b92668d38465fdd9a2262e64be56846be561e4cfbcedc82496a3190b549636923d61c3e5a2d40cc6d2c46a3e89ac23eb44ac40c777147e3e49a80bd382bae06e284f1cc553f89d78f0c7bf20fd3a33ee598ce2caf61e3f5457cd228ff03fe009f10952206bf248e161d17950c6655af75b097bbda1b909038d4d752cd11d02818100d99cb65195a399f9a3aca1ef1593592992e7d91cc028b713ec5b661b9976fcffdb086f523f042699cb910321fe7b67a27dd4a72822e6fbb98d005280721efc32d889d431d2737c92a4f34d4885c7a9c6244e081a1264a283d07744b752a68ebb6fbff3492a039e3e3a0cc5b94537582a7d11cc6b8678e4c338671f96be029b2902818100a1a2a7509ca1c4217db4f3cbba7d827b32921134ea9add7efef36692f8f2a9ccf2e93b645a1448fa6859a2c0d1e3f489b42f8182f0ccf1d425039df6c360224139074bb0b6b47094343ddc1f97688ab7b07bbca8555eb0c242f5ba4a6f8506ea33e44b87aa087b7c0d5f7c8733325216853192c6d30818f68059bad4b20d633902818034b3bf7402c99c80d922f614f124be735320d3742315b94119fd08bda66d2ad8cc333ec2ac8054d8ea74344e0753dbc57eb401c7b6ac3a4ab5db5e1fbd83c3908ce0d4833c74bbb6c83c247b6beaef330d97d85e7815e7460536dd6d8896cdfa9715e5d5d2570dfc041313cfcaf39c66ade3a19e68f2de7469349071f192b00102818060a8271f45161d8ecf62c3ac5f0fa8539b6d86a35123aafcc37541e2d5e5b62715777db0ef75f3cdf67506b8fcad6baed862eaf88fa1f280f42736b69a41ea7a3fea31ce62aa0563c85df1d9b02b83839c4ab9453e420c5c401cce979f6fb7b6ac12baf1e9140546eed24e92e383b8f2d37b3e4410844d235c7175112e751ee0");
17
var extractable = true;
18
19
debug("Importing a key...");
20
crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"]).then(function(result) {
21
    privateKey = result;
22
23
    shouldBe("privateKey.toString()", "'[object CryptoKey]'");
24
    shouldBe("privateKey.type", "'private'");
25
    shouldBe("privateKey.extractable", "true");
26
    shouldBe("privateKey.algorithm.name", "'RSA-PSS'");
27
    shouldBe("privateKey.algorithm.modulusLength", "2048");
28
    shouldBe("bytesToHexString(privateKey.algorithm.publicExponent)", "'010001'");
29
    shouldBe("privateKey.algorithm.hash.name", "'SHA-1'");
30
    shouldBe("privateKey.usages", "['sign']");
31
32
    finishJSTest();
33
});
34
35
</script>
36
37
<script src="../../resources/js-test-post.js"></script>
38
</body>
39
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key-empty-usages-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key-empty-usages-expected.txt_sec1
1
Test importing a SPKI RSA-PSS key with empty usages
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-1'
14
PASS publicKey.usages is [ ]
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key-empty-usages.html +40 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key-empty-usages.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a SPKI RSA-PSS key with empty usages");
13
14
jsTestIsAsync = true;
15
16
// Generated from OpenSSL
17
var spkiKey = Base64URL.parse("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwCjRCtFwvSNYMZ07u5SxARxglJl75T7bUZXFsDVxHkMhpNC2RaN4jWE5bwYUDMeD2fVmxhpaUQn/6AbFLh6gHxtwrCfc7rIo/SfDdGd3GkRlXK5xXwGuM6MvP9nuZHaarIyArRFh2U2UZxFlVsKI0pSHo6n58W1fPZ1syOoVEZ/WYE6gLhMMwfpeAm97mro7mekRdMULOV/mR5Ul3CHm9Zt93Dc8GpnPA8bhLiB0VNyGTEMa06nJul4gj1sjxLDoUvZY2EWq7oUUnfLBUYMfiqK0kQcW94wvBrIq2DQUApLyTTbaAOY46TLwX6c8LtubJriYKTC5a9Bb0/7ovTWB0wIDAQAB");
18
var extractable = true;
19
20
debug("Importing a key...");
21
crypto.subtle.importKey("spki", spkiKey, {name: "RSA-PSS", hash: "sha-1"}, extractable, [ ]).then(function(result) {
22
    publicKey = result;
23
24
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
25
    shouldBe("publicKey.type", "'public'");
26
    shouldBe("publicKey.extractable", "true");
27
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
28
    shouldBe("publicKey.algorithm.modulusLength", "2048");
29
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
30
    shouldBe("publicKey.algorithm.hash.name", "'SHA-1'");
31
    shouldBe("publicKey.usages", "[ ]");
32
33
    finishJSTest();
34
});
35
36
</script>
37
38
<script src="../../resources/js-test-post.js"></script>
39
</body>
40
</html>
- a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key-expected.txt +18 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key-expected.txt_sec1
1
Test importing a SPKI RSA-PSS key
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Importing a key...
7
PASS publicKey.toString() is '[object CryptoKey]'
8
PASS publicKey.type is 'public'
9
PASS publicKey.extractable is true
10
PASS publicKey.algorithm.name is 'RSA-PSS'
11
PASS publicKey.algorithm.modulusLength is 2048
12
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
13
PASS publicKey.algorithm.hash.name is 'SHA-1'
14
PASS publicKey.usages is ['verify']
15
PASS successfullyParsed is true
16
17
TEST COMPLETE
18
- a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key.html +40 lines
Line 0 a/LayoutTests/crypto/subtle/rsa-pss-import-spki-key.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script src="../resources/common.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
11
<script>
12
description("Test importing a SPKI RSA-PSS key");
13
14
jsTestIsAsync = true;
15
16
// Generated from OpenSSL
17
var spkiKey = Base64URL.parse("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwCjRCtFwvSNYMZ07u5SxARxglJl75T7bUZXFsDVxHkMhpNC2RaN4jWE5bwYUDMeD2fVmxhpaUQn/6AbFLh6gHxtwrCfc7rIo/SfDdGd3GkRlXK5xXwGuM6MvP9nuZHaarIyArRFh2U2UZxFlVsKI0pSHo6n58W1fPZ1syOoVEZ/WYE6gLhMMwfpeAm97mro7mekRdMULOV/mR5Ul3CHm9Zt93Dc8GpnPA8bhLiB0VNyGTEMa06nJul4gj1sjxLDoUvZY2EWq7oUUnfLBUYMfiqK0kQcW94wvBrIq2DQUApLyTTbaAOY46TLwX6c8LtubJriYKTC5a9Bb0/7ovTWB0wIDAQAB");
18
var extractable = true;
19
20
debug("Importing a key...");
21
crypto.subtle.importKey("spki", spkiKey, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]).then(function(result) {
22
    publicKey = result;
23
24
    shouldBe("publicKey.toString()", "'[object CryptoKey]'");
25
    shouldBe("publicKey.type", "'public'");
26
    shouldBe("publicKey.extractable", "true");
27
    shouldBe("publicKey.algorithm.name", "'RSA-PSS'");
28
    shouldBe("publicKey.algorithm.modulusLength", "2048");
29
    shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
30
    shouldBe("publicKey.algorithm.hash.name", "'SHA-1'");
31
    shouldBe("publicKey.usages", "['verify']");
32
33
    finishJSTest();
34
});
35
36
</script>
37
38
<script src="../../resources/js-test-post.js"></script>
39
</body>
40
</html>
- a/LayoutTests/crypto/workers/subtle/resources/rsa-pss-import-key-sign.js +38 lines
Line 0 a/LayoutTests/crypto/workers/subtle/resources/rsa-pss-import-key-sign.js_sec1
1
importScripts('../../../../resources/js-test-pre.js');
2
importScripts('../../../resources/common.js');
3
4
description("Test signing with RSA-PSS SHA-1 using an imported key in workers");
5
6
jsTestIsAsync = true;
7
8
var extractable = false;
9
var text = asciiToUint8Array("Hello, World!");
10
var rsaImportParams = {
11
    name: "RSA-PSS",
12
    hash: "SHA-1",
13
}
14
var jwkKey = {
15
    kty: "RSA",
16
    alg: "PS1",
17
    use: "sig",
18
    key_ops: ["sign"],
19
    ext: true,
20
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
21
    e: "AQAB",
22
    d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
23
    p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
24
    q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
25
    dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
26
    dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
27
    qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk",
28
};
29
30
crypto.subtle.importKey("jwk", jwkKey, rsaImportParams, extractable, ["sign"]).then(function(key) {
31
    return crypto.subtle.sign({ name: "RSA-PSS", saltLength: 16 }, key, text);
32
}).then(function(result) {
33
    signature = result;
34
35
    shouldBe("signature.byteLength", "256");
36
37
    finishJSTest();
38
}, failAndFinishJSTest);
- a/LayoutTests/crypto/workers/subtle/resources/rsa-pss-import-key-verify.js +33 lines
Line 0 a/LayoutTests/crypto/workers/subtle/resources/rsa-pss-import-key-verify.js_sec1
1
importScripts('../../../../resources/js-test-pre.js');
2
importScripts('../../../resources/common.js');
3
4
description("Test verification with RSA-PSS SHA-1 using an imported key in workers");
5
6
jsTestIsAsync = true;
7
8
var extractable = false;
9
var text = asciiToUint8Array("Hello, World!");
10
var rsaImportParams = {
11
    name: "RSA-PSS",
12
    hash: "SHA-1",
13
}
14
var jwkKey = {
15
    kty: "RSA",
16
    alg: "PS1",
17
    use: "sig",
18
    key_ops: ["verify"],
19
    ext: true,
20
    n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
21
    e: "AQAB",
22
};
23
var signature = hexStringToUint8Array("3119faeed99f4ef0516f9f8e8429bf9bd98aba7d0a89a8ca9331513094f4a2ab9cfdc003d618ef10254263b5631355d8a5a0bb082584f33db8da8a1f9283c2ee70c821d0feac3d7e63b0c612fb9aef003000a423b650e80858b2eb8b4cea8f61822344f816dc1f325c305e3d547f6b19f172703b47639d41c84dce94b33b58a3a9b6c0b6a5ce43087cc0ed2a06e5c525cdaa80d856c1e4316a792ad4af795936594c35c985c11c3eb2bb37013d2e3ce67a74664ef58bbf0b0f16e2b68d29180006b6a17abd95c444aac723ac7213d57bea714882c6c8b139ef007d6157dea01d8d2573aef64ac912958aeae7fa1b59633c8526220d7db6a8e362774243156a01");
24
25
crypto.subtle.importKey("jwk", jwkKey, rsaImportParams, extractable, ["verify"]).then(function(key) {
26
    return crypto.subtle.verify({ name: "RSA-PSS", saltLength: 16 }, key, signature, text);
27
}).then(function(result) {
28
    verified = result;
29
30
    shouldBeTrue("verified");
31
32
    finishJSTest();
33
});
- a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-sign-expected.txt +11 lines
Line 0 a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-sign-expected.txt_sec1
1
[Worker] Test signing with RSA-PSS SHA-1 using an imported key in workers
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Starting worker: resources/rsa-pss-import-key-sign.js
7
PASS [Worker] signature.byteLength is 256
8
PASS successfullyParsed is true
9
10
TEST COMPLETE
11
- a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-sign.html +12 lines
Line 0 a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-sign.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <script src="../../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
    <script>
8
        worker = startWorker('resources/rsa-pss-import-key-sign.js');
9
    </script>
10
    <script src="../../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-verify-expected.txt +11 lines
Line 0 a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-verify-expected.txt_sec1
1
[Worker] Test verification with RSA-PSS SHA-1 using an imported key in workers
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
Starting worker: resources/rsa-pss-import-key-verify.js
7
PASS [Worker] verified is true
8
PASS successfullyParsed is true
9
10
TEST COMPLETE
11
- a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-verify.html +12 lines
Line 0 a/LayoutTests/crypto/workers/subtle/rsa-pss-import-key-verify.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <script src="../../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
    <script>
8
        worker = startWorker('resources/rsa-pss-import-key-verify.js');
9
    </script>
10
    <script src="../../../resources/js-test-post.js"></script>
11
</body>
12
</html>

Return to Bug 170869