OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // fills it
with the last length elements and numProperties name,value pairs pushed onto des
erialization stack | 214 // fills it
with the last length elements and numProperties name,value pairs pushed onto des
erialization stack |
215 RegExpTag = 'R', // pattern:RawString, flags:uint32_t -> RegExp (ref) | 215 RegExpTag = 'R', // pattern:RawString, flags:uint32_t -> RegExp (ref) |
216 ArrayBufferTag = 'B', // byteLength:uint32_t, data:byte[byteLength] -> Array
Buffer (ref) | 216 ArrayBufferTag = 'B', // byteLength:uint32_t, data:byte[byteLength] -> Array
Buffer (ref) |
217 ArrayBufferTransferTag = 't', // index:uint32_t -> ArrayBuffer. For ArrayBuf
fer transfer | 217 ArrayBufferTransferTag = 't', // index:uint32_t -> ArrayBuffer. For ArrayBuf
fer transfer |
218 ArrayBufferViewTag = 'V', // subtag:byte, byteOffset:uint32_t, byteLength:ui
nt32_t -> ArrayBufferView (ref). Consumes an ArrayBuffer from the top of the des
erialization stack. | 218 ArrayBufferViewTag = 'V', // subtag:byte, byteOffset:uint32_t, byteLength:ui
nt32_t -> ArrayBufferView (ref). Consumes an ArrayBuffer from the top of the des
erialization stack. |
219 CryptoKeyTag = 'K', // subtag:byte, props, usages:uint32_t, keyDataLength:ui
nt32_t, keyData:byte[keyDataLength] | 219 CryptoKeyTag = 'K', // subtag:byte, props, usages:uint32_t, keyDataLength:ui
nt32_t, keyData:byte[keyDataLength] |
220 // If subtag=AesKeyTag: | 220 // If subtag=AesKeyTag: |
221 // props = keyLengthBytes:uint32_t, algorithmId:ui
nt32_t | 221 // props = keyLengthBytes:uint32_t, algorithmId:ui
nt32_t |
222 // If subtag=HmacKeyTag: | 222 // If subtag=HmacKeyTag: |
223 // props = keyLengthBytes:uint32_t, hashId:uint32_
t | 223 // props = keyLengthBytes:uint32_t, hashId:uint32_
t |
224 // If subtag=RsaKeyTag: | |
225 // props = algorithmId:uint32_t, type:uint32_t, mo
dulusLengthBits:uint32_t, publicExponentLength:uint32_t, publicExponent:byte[pub
licExponentLength] | |
226 // If subtag=RsaHashedKeyTag: | 224 // If subtag=RsaHashedKeyTag: |
227 // props = <same as for RsaKeyTag>, hashId:uint32_
t | 225 // props = algorithmId:uint32_t, type:uint32_t, mo
dulusLengthBits:uint32_t, publicExponentLength:uint32_t, publicExponent:byte[pub
licExponentLength], hashId:uint32_t |
228 ObjectReferenceTag = '^', // ref:uint32_t -> reference table[ref] | 226 ObjectReferenceTag = '^', // ref:uint32_t -> reference table[ref] |
229 GenerateFreshObjectTag = 'o', // -> empty object allocated an object ID and
pushed onto the open stack (ref) | 227 GenerateFreshObjectTag = 'o', // -> empty object allocated an object ID and
pushed onto the open stack (ref) |
230 GenerateFreshSparseArrayTag = 'a', // length:uint32_t -> empty array[length]
allocated an object ID and pushed onto the open stack (ref) | 228 GenerateFreshSparseArrayTag = 'a', // length:uint32_t -> empty array[length]
allocated an object ID and pushed onto the open stack (ref) |
231 GenerateFreshDenseArrayTag = 'A', // length:uint32_t -> empty array[length]
allocated an object ID and pushed onto the open stack (ref) | 229 GenerateFreshDenseArrayTag = 'A', // length:uint32_t -> empty array[length]
allocated an object ID and pushed onto the open stack (ref) |
232 ReferenceCountTag = '?', // refTableSize:uint32_t -> If the reference table
is not refTableSize big, fails. | 230 ReferenceCountTag = '?', // refTableSize:uint32_t -> If the reference table
is not refTableSize big, fails. |
233 StringObjectTag = 's', // string:RawString -> new String(string) (ref) | 231 StringObjectTag = 's', // string:RawString -> new String(string) (ref) |
234 NumberObjectTag = 'n', // value:double -> new Number(value) (ref) | 232 NumberObjectTag = 'n', // value:double -> new Number(value) (ref) |
235 TrueObjectTag = 'y', // new Boolean(true) (ref) | 233 TrueObjectTag = 'y', // new Boolean(true) (ref) |
236 FalseObjectTag = 'x', // new Boolean(false) (ref) | 234 FalseObjectTag = 'x', // new Boolean(false) (ref) |
237 VersionTag = 0xFF // version:uint32_t -> Uses this as the file version. | 235 VersionTag = 0xFF // version:uint32_t -> Uses this as the file version. |
238 }; | 236 }; |
239 | 237 |
240 enum ArrayBufferViewSubTag { | 238 enum ArrayBufferViewSubTag { |
241 ByteArrayTag = 'b', | 239 ByteArrayTag = 'b', |
242 UnsignedByteArrayTag = 'B', | 240 UnsignedByteArrayTag = 'B', |
243 UnsignedByteClampedArrayTag = 'C', | 241 UnsignedByteClampedArrayTag = 'C', |
244 ShortArrayTag = 'w', | 242 ShortArrayTag = 'w', |
245 UnsignedShortArrayTag = 'W', | 243 UnsignedShortArrayTag = 'W', |
246 IntArrayTag = 'd', | 244 IntArrayTag = 'd', |
247 UnsignedIntArrayTag = 'D', | 245 UnsignedIntArrayTag = 'D', |
248 FloatArrayTag = 'f', | 246 FloatArrayTag = 'f', |
249 DoubleArrayTag = 'F', | 247 DoubleArrayTag = 'F', |
250 DataViewTag = '?' | 248 DataViewTag = '?' |
251 }; | 249 }; |
252 | 250 |
253 enum CryptoKeySubTag { | 251 enum CryptoKeySubTag { |
254 AesKeyTag = 1, | 252 AesKeyTag = 1, |
255 HmacKeyTag = 2, | 253 HmacKeyTag = 2, |
256 RsaKeyTag = 3, | 254 // ID 3 was used by RsaKeyTag, while still behind experimental flag. |
257 RsaHashedKeyTag = 4, | 255 RsaHashedKeyTag = 4, |
258 // Maximum allowed value is 255 | 256 // Maximum allowed value is 255 |
259 }; | 257 }; |
260 | 258 |
261 enum AssymetricCryptoKeyType { | 259 enum AssymetricCryptoKeyType { |
262 PublicKeyType = 1, | 260 PublicKeyType = 1, |
263 PrivateKeyType = 2, | 261 PrivateKeyType = 2, |
264 // Maximum allowed value is 2^32-1 | 262 // Maximum allowed value is 2^32-1 |
265 }; | 263 }; |
266 | 264 |
267 enum CryptoKeyAlgorithmTag { | 265 enum CryptoKeyAlgorithmTag { |
268 AesCbcTag = 1, | 266 AesCbcTag = 1, |
269 HmacTag = 2, | 267 HmacTag = 2, |
270 RsaSsaPkcs1v1_5Tag = 3, | 268 RsaSsaPkcs1v1_5Tag = 3, |
271 RsaEsPkcs1v1_5Tag = 4, | 269 // ID 4 was used by RsaEs, while still behind experimental flag. |
272 Sha1Tag = 5, | 270 Sha1Tag = 5, |
273 Sha256Tag = 6, | 271 Sha256Tag = 6, |
274 Sha384Tag = 7, | 272 Sha384Tag = 7, |
275 Sha512Tag = 8, | 273 Sha512Tag = 8, |
276 AesGcmTag = 9, | 274 AesGcmTag = 9, |
277 RsaOaepTag = 10, | 275 RsaOaepTag = 10, |
278 AesCtrTag = 11, | 276 AesCtrTag = 11, |
279 AesKwTag = 12, | 277 AesKwTag = 12, |
280 // Maximum allowed value is 2^32-1 | 278 // Maximum allowed value is 2^32-1 |
281 }; | 279 }; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 { | 508 { |
511 append(static_cast<uint8_t>(CryptoKeyTag)); | 509 append(static_cast<uint8_t>(CryptoKeyTag)); |
512 | 510 |
513 switch (key.algorithm().paramsType()) { | 511 switch (key.algorithm().paramsType()) { |
514 case blink::WebCryptoKeyAlgorithmParamsTypeAes: | 512 case blink::WebCryptoKeyAlgorithmParamsTypeAes: |
515 doWriteAesKey(key); | 513 doWriteAesKey(key); |
516 break; | 514 break; |
517 case blink::WebCryptoKeyAlgorithmParamsTypeHmac: | 515 case blink::WebCryptoKeyAlgorithmParamsTypeHmac: |
518 doWriteHmacKey(key); | 516 doWriteHmacKey(key); |
519 break; | 517 break; |
520 case blink::WebCryptoKeyAlgorithmParamsTypeRsa: | |
521 case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed: | 518 case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed: |
522 doWriteRsaKey(key); | 519 doWriteRsaHashedKey(key); |
523 break; | 520 break; |
524 case blink::WebCryptoKeyAlgorithmParamsTypeNone: | 521 case blink::WebCryptoKeyAlgorithmParamsTypeNone: |
525 ASSERT_NOT_REACHED(); | 522 ASSERT_NOT_REACHED(); |
526 return false; | 523 return false; |
527 } | 524 } |
528 | 525 |
529 doWriteKeyUsages(key.usages(), key.extractable()); | 526 doWriteKeyUsages(key.usages(), key.extractable()); |
530 | 527 |
531 blink::WebVector<uint8_t> keyData; | 528 blink::WebVector<uint8_t> keyData; |
532 if (!blink::Platform::current()->crypto()->serializeKeyForClone(key, key
Data)) | 529 if (!blink::Platform::current()->crypto()->serializeKeyForClone(key, key
Data)) |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 ASSERT(key.algorithm().paramsType() == blink::WebCryptoKeyAlgorithmParam
sTypeAes); | 720 ASSERT(key.algorithm().paramsType() == blink::WebCryptoKeyAlgorithmParam
sTypeAes); |
724 | 721 |
725 append(static_cast<uint8_t>(AesKeyTag)); | 722 append(static_cast<uint8_t>(AesKeyTag)); |
726 doWriteAlgorithmId(key.algorithm().id()); | 723 doWriteAlgorithmId(key.algorithm().id()); |
727 // Converting the key length from bits to bytes is lossless and makes | 724 // Converting the key length from bits to bytes is lossless and makes |
728 // it fit in 1 byte. | 725 // it fit in 1 byte. |
729 ASSERT(!(key.algorithm().aesParams()->lengthBits() % 8)); | 726 ASSERT(!(key.algorithm().aesParams()->lengthBits() % 8)); |
730 doWriteUint32(key.algorithm().aesParams()->lengthBits() / 8); | 727 doWriteUint32(key.algorithm().aesParams()->lengthBits() / 8); |
731 } | 728 } |
732 | 729 |
733 void doWriteRsaKey(const blink::WebCryptoKey& key) | 730 void doWriteRsaHashedKey(const blink::WebCryptoKey& key) |
734 { | 731 { |
735 if (key.algorithm().rsaHashedParams()) | 732 ASSERT(key.algorithm().rsaHashedParams()); |
736 append(static_cast<uint8_t>(RsaHashedKeyTag)); | 733 append(static_cast<uint8_t>(RsaHashedKeyTag)); |
737 else | |
738 append(static_cast<uint8_t>(RsaKeyTag)); | |
739 | 734 |
740 doWriteAlgorithmId(key.algorithm().id()); | 735 doWriteAlgorithmId(key.algorithm().id()); |
741 | 736 |
742 switch (key.type()) { | 737 switch (key.type()) { |
743 case blink::WebCryptoKeyTypePublic: | 738 case blink::WebCryptoKeyTypePublic: |
744 doWriteUint32(PublicKeyType); | 739 doWriteUint32(PublicKeyType); |
745 break; | 740 break; |
746 case blink::WebCryptoKeyTypePrivate: | 741 case blink::WebCryptoKeyTypePrivate: |
747 doWriteUint32(PrivateKeyType); | 742 doWriteUint32(PrivateKeyType); |
748 break; | 743 break; |
749 case blink::WebCryptoKeyTypeSecret: | 744 case blink::WebCryptoKeyTypeSecret: |
750 ASSERT_NOT_REACHED(); | 745 ASSERT_NOT_REACHED(); |
751 } | 746 } |
752 | 747 |
753 const blink::WebCryptoRsaKeyAlgorithmParams* params = key.algorithm().rs
aParams(); | 748 const blink::WebCryptoRsaHashedKeyAlgorithmParams* params = key.algorith
m().rsaHashedParams(); |
754 doWriteUint32(params->modulusLengthBits()); | 749 doWriteUint32(params->modulusLengthBits()); |
755 doWriteUint32(params->publicExponent().size()); | 750 doWriteUint32(params->publicExponent().size()); |
756 append(params->publicExponent().data(), params->publicExponent().size())
; | 751 append(params->publicExponent().data(), params->publicExponent().size())
; |
757 | 752 doWriteAlgorithmId(key.algorithm().rsaHashedParams()->hash().id()); |
758 if (key.algorithm().rsaHashedParams()) | |
759 doWriteAlgorithmId(key.algorithm().rsaHashedParams()->hash().id()); | |
760 } | 753 } |
761 | 754 |
762 void doWriteAlgorithmId(blink::WebCryptoAlgorithmId id) | 755 void doWriteAlgorithmId(blink::WebCryptoAlgorithmId id) |
763 { | 756 { |
764 switch (id) { | 757 switch (id) { |
765 case blink::WebCryptoAlgorithmIdAesCbc: | 758 case blink::WebCryptoAlgorithmIdAesCbc: |
766 return doWriteUint32(AesCbcTag); | 759 return doWriteUint32(AesCbcTag); |
767 case blink::WebCryptoAlgorithmIdHmac: | 760 case blink::WebCryptoAlgorithmIdHmac: |
768 return doWriteUint32(HmacTag); | 761 return doWriteUint32(HmacTag); |
769 case blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: | 762 case blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: |
770 return doWriteUint32(RsaSsaPkcs1v1_5Tag); | 763 return doWriteUint32(RsaSsaPkcs1v1_5Tag); |
771 case blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5: | |
772 return doWriteUint32(RsaEsPkcs1v1_5Tag); | |
773 case blink::WebCryptoAlgorithmIdSha1: | 764 case blink::WebCryptoAlgorithmIdSha1: |
774 return doWriteUint32(Sha1Tag); | 765 return doWriteUint32(Sha1Tag); |
775 case blink::WebCryptoAlgorithmIdSha256: | 766 case blink::WebCryptoAlgorithmIdSha256: |
776 return doWriteUint32(Sha256Tag); | 767 return doWriteUint32(Sha256Tag); |
777 case blink::WebCryptoAlgorithmIdSha384: | 768 case blink::WebCryptoAlgorithmIdSha384: |
778 return doWriteUint32(Sha384Tag); | 769 return doWriteUint32(Sha384Tag); |
779 case blink::WebCryptoAlgorithmIdSha512: | 770 case blink::WebCryptoAlgorithmIdSha512: |
780 return doWriteUint32(Sha512Tag); | 771 return doWriteUint32(Sha512Tag); |
781 case blink::WebCryptoAlgorithmIdAesGcm: | 772 case blink::WebCryptoAlgorithmIdAesGcm: |
782 return doWriteUint32(AesGcmTag); | 773 return doWriteUint32(AesGcmTag); |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 return true; | 2227 return true; |
2237 } | 2228 } |
2238 | 2229 |
2239 bool readCryptoKey(v8::Handle<v8::Value>* value) | 2230 bool readCryptoKey(v8::Handle<v8::Value>* value) |
2240 { | 2231 { |
2241 uint32_t rawKeyType; | 2232 uint32_t rawKeyType; |
2242 if (!doReadUint32(&rawKeyType)) | 2233 if (!doReadUint32(&rawKeyType)) |
2243 return false; | 2234 return false; |
2244 | 2235 |
2245 blink::WebCryptoKeyAlgorithm algorithm; | 2236 blink::WebCryptoKeyAlgorithm algorithm; |
2246 blink::WebCryptoKeyType type; | 2237 blink::WebCryptoKeyType type = blink::WebCryptoKeyTypeSecret; |
2247 | 2238 |
2248 switch (static_cast<CryptoKeySubTag>(rawKeyType)) { | 2239 switch (static_cast<CryptoKeySubTag>(rawKeyType)) { |
2249 case AesKeyTag: | 2240 case AesKeyTag: |
2250 if (!doReadAesKey(algorithm, type)) | 2241 if (!doReadAesKey(algorithm, type)) |
2251 return false; | 2242 return false; |
2252 break; | 2243 break; |
2253 case HmacKeyTag: | 2244 case HmacKeyTag: |
2254 if (!doReadHmacKey(algorithm, type)) | 2245 if (!doReadHmacKey(algorithm, type)) |
2255 return false; | 2246 return false; |
2256 break; | 2247 break; |
2257 case RsaKeyTag: | |
2258 if (!doReadRsaKey(false, algorithm, type)) | |
2259 return false; | |
2260 break; | |
2261 case RsaHashedKeyTag: | 2248 case RsaHashedKeyTag: |
2262 if (!doReadRsaKey(true, algorithm, type)) | 2249 if (!doReadRsaHashedKey(algorithm, type)) |
2263 return false; | 2250 return false; |
2264 break; | 2251 break; |
2265 default: | 2252 default: |
2266 return false; | 2253 return false; |
2267 } | 2254 } |
2268 | 2255 |
2269 blink::WebCryptoKeyUsageMask usages; | 2256 blink::WebCryptoKeyUsageMask usages; |
2270 bool extractable; | 2257 bool extractable; |
2271 if (!doReadKeyUsages(usages, extractable)) | 2258 if (!doReadKeyUsages(usages, extractable)) |
2272 return false; | 2259 return false; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 if (!doReadAlgorithmId(id)) | 2399 if (!doReadAlgorithmId(id)) |
2413 return false; | 2400 return false; |
2414 uint32_t lengthBytes; | 2401 uint32_t lengthBytes; |
2415 if (!doReadUint32(&lengthBytes)) | 2402 if (!doReadUint32(&lengthBytes)) |
2416 return false; | 2403 return false; |
2417 algorithm = blink::WebCryptoKeyAlgorithm::createAes(id, lengthBytes * 8)
; | 2404 algorithm = blink::WebCryptoKeyAlgorithm::createAes(id, lengthBytes * 8)
; |
2418 type = blink::WebCryptoKeyTypeSecret; | 2405 type = blink::WebCryptoKeyTypeSecret; |
2419 return !algorithm.isNull(); | 2406 return !algorithm.isNull(); |
2420 } | 2407 } |
2421 | 2408 |
2422 bool doReadRsaKey(bool hasHash, blink::WebCryptoKeyAlgorithm& algorithm, bli
nk::WebCryptoKeyType& type) | 2409 bool doReadRsaHashedKey(blink::WebCryptoKeyAlgorithm& algorithm, blink::WebC
ryptoKeyType& type) |
2423 { | 2410 { |
2424 blink::WebCryptoAlgorithmId id; | 2411 blink::WebCryptoAlgorithmId id; |
2425 if (!doReadAlgorithmId(id)) | 2412 if (!doReadAlgorithmId(id)) |
2426 return false; | 2413 return false; |
2427 | 2414 |
2428 uint32_t rawType; | 2415 uint32_t rawType; |
2429 if (!doReadUint32(&rawType)) | 2416 if (!doReadUint32(&rawType)) |
2430 return false; | 2417 return false; |
2431 | 2418 |
2432 switch (static_cast<AssymetricCryptoKeyType>(rawType)) { | 2419 switch (static_cast<AssymetricCryptoKeyType>(rawType)) { |
(...skipping 14 matching lines...) Expand all Loading... |
2447 uint32_t publicExponentSize; | 2434 uint32_t publicExponentSize; |
2448 if (!doReadUint32(&publicExponentSize)) | 2435 if (!doReadUint32(&publicExponentSize)) |
2449 return false; | 2436 return false; |
2450 | 2437 |
2451 if (m_position + publicExponentSize > m_length) | 2438 if (m_position + publicExponentSize > m_length) |
2452 return false; | 2439 return false; |
2453 | 2440 |
2454 const uint8_t* publicExponent = m_buffer + m_position; | 2441 const uint8_t* publicExponent = m_buffer + m_position; |
2455 m_position += publicExponentSize; | 2442 m_position += publicExponentSize; |
2456 | 2443 |
2457 if (hasHash) { | 2444 blink::WebCryptoAlgorithmId hash; |
2458 blink::WebCryptoAlgorithmId hash; | 2445 if (!doReadAlgorithmId(hash)) |
2459 if (!doReadAlgorithmId(hash)) | 2446 return false; |
2460 return false; | 2447 algorithm = blink::WebCryptoKeyAlgorithm::createRsaHashed(id, modulusLen
gthBits, publicExponent, publicExponentSize, hash); |
2461 algorithm = blink::WebCryptoKeyAlgorithm::createRsaHashed(id, modulu
sLengthBits, publicExponent, publicExponentSize, hash); | |
2462 } else { | |
2463 algorithm = blink::WebCryptoKeyAlgorithm::createRsa(id, modulusLengt
hBits, publicExponent, publicExponentSize); | |
2464 } | |
2465 | 2448 |
2466 return !algorithm.isNull(); | 2449 return !algorithm.isNull(); |
2467 } | 2450 } |
2468 | 2451 |
2469 bool doReadAlgorithmId(blink::WebCryptoAlgorithmId& id) | 2452 bool doReadAlgorithmId(blink::WebCryptoAlgorithmId& id) |
2470 { | 2453 { |
2471 uint32_t rawId; | 2454 uint32_t rawId; |
2472 if (!doReadUint32(&rawId)) | 2455 if (!doReadUint32(&rawId)) |
2473 return false; | 2456 return false; |
2474 | 2457 |
2475 switch (static_cast<CryptoKeyAlgorithmTag>(rawId)) { | 2458 switch (static_cast<CryptoKeyAlgorithmTag>(rawId)) { |
2476 case AesCbcTag: | 2459 case AesCbcTag: |
2477 id = blink::WebCryptoAlgorithmIdAesCbc; | 2460 id = blink::WebCryptoAlgorithmIdAesCbc; |
2478 return true; | 2461 return true; |
2479 case HmacTag: | 2462 case HmacTag: |
2480 id = blink::WebCryptoAlgorithmIdHmac; | 2463 id = blink::WebCryptoAlgorithmIdHmac; |
2481 return true; | 2464 return true; |
2482 case RsaSsaPkcs1v1_5Tag: | 2465 case RsaSsaPkcs1v1_5Tag: |
2483 id = blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5; | 2466 id = blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5; |
2484 return true; | 2467 return true; |
2485 case RsaEsPkcs1v1_5Tag: | |
2486 id = blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5; | |
2487 return true; | |
2488 case Sha1Tag: | 2468 case Sha1Tag: |
2489 id = blink::WebCryptoAlgorithmIdSha1; | 2469 id = blink::WebCryptoAlgorithmIdSha1; |
2490 return true; | 2470 return true; |
2491 case Sha256Tag: | 2471 case Sha256Tag: |
2492 id = blink::WebCryptoAlgorithmIdSha256; | 2472 id = blink::WebCryptoAlgorithmIdSha256; |
2493 return true; | 2473 return true; |
2494 case Sha384Tag: | 2474 case Sha384Tag: |
2495 id = blink::WebCryptoAlgorithmIdSha384; | 2475 id = blink::WebCryptoAlgorithmIdSha384; |
2496 return true; | 2476 return true; |
2497 case Sha512Tag: | 2477 case Sha512Tag: |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3069 // If the allocated memory was not registered before, then this class is lik
ely | 3049 // If the allocated memory was not registered before, then this class is lik
ely |
3070 // used in a context other then Worker's onmessage environment and the prese
nce of | 3050 // used in a context other then Worker's onmessage environment and the prese
nce of |
3071 // current v8 context is not guaranteed. Avoid calling v8 then. | 3051 // current v8 context is not guaranteed. Avoid calling v8 then. |
3072 if (m_externallyAllocatedMemory) { | 3052 if (m_externallyAllocatedMemory) { |
3073 ASSERT(v8::Isolate::GetCurrent()); | 3053 ASSERT(v8::Isolate::GetCurrent()); |
3074 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); | 3054 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte
rnallyAllocatedMemory); |
3075 } | 3055 } |
3076 } | 3056 } |
3077 | 3057 |
3078 } // namespace WebCore | 3058 } // namespace WebCore |
OLD | NEW |