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 Deprecated_RsaKeyTag = 3, |
jww
2014/05/21 17:19:23
I'm unclear as to why you leave this (and RsaEsPkc
eroman
2014/05/21 18:17:24
Done, I removed those.
I thought it would be conf
| |
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 Deprecated_RsaEsPkcs1v1_5Tag = 4, |
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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2240 | 2231 |
2241 switch (static_cast<CryptoKeySubTag>(rawKeyType)) { | 2232 switch (static_cast<CryptoKeySubTag>(rawKeyType)) { |
2242 case AesKeyTag: | 2233 case AesKeyTag: |
2243 if (!doReadAesKey(algorithm, type)) | 2234 if (!doReadAesKey(algorithm, type)) |
2244 return false; | 2235 return false; |
2245 break; | 2236 break; |
2246 case HmacKeyTag: | 2237 case HmacKeyTag: |
2247 if (!doReadHmacKey(algorithm, type)) | 2238 if (!doReadHmacKey(algorithm, type)) |
2248 return false; | 2239 return false; |
2249 break; | 2240 break; |
2250 case RsaKeyTag: | 2241 case Deprecated_RsaKeyTag: |
2251 if (!doReadRsaKey(false, algorithm, type)) | 2242 return false; |
jww
2014/05/21 17:19:23
If you do leave in Deprecated_RsaKeyTag, shouldn't
eroman
2014/05/21 18:17:24
No longer applicable.
| |
2252 return false; | |
2253 break; | |
2254 case RsaHashedKeyTag: | 2243 case RsaHashedKeyTag: |
2255 if (!doReadRsaKey(true, algorithm, type)) | 2244 if (!doReadRsaHashedKey(algorithm, type)) |
2256 return false; | 2245 return false; |
2257 break; | 2246 break; |
2258 default: | 2247 default: |
2259 return false; | 2248 return false; |
2260 } | 2249 } |
2261 | 2250 |
2262 blink::WebCryptoKeyUsageMask usages; | 2251 blink::WebCryptoKeyUsageMask usages; |
2263 bool extractable; | 2252 bool extractable; |
2264 if (!doReadKeyUsages(usages, extractable)) | 2253 if (!doReadKeyUsages(usages, extractable)) |
2265 return false; | 2254 return false; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2405 if (!doReadAlgorithmId(id)) | 2394 if (!doReadAlgorithmId(id)) |
2406 return false; | 2395 return false; |
2407 uint32_t lengthBytes; | 2396 uint32_t lengthBytes; |
2408 if (!doReadUint32(&lengthBytes)) | 2397 if (!doReadUint32(&lengthBytes)) |
2409 return false; | 2398 return false; |
2410 algorithm = blink::WebCryptoKeyAlgorithm::createAes(id, lengthBytes * 8) ; | 2399 algorithm = blink::WebCryptoKeyAlgorithm::createAes(id, lengthBytes * 8) ; |
2411 type = blink::WebCryptoKeyTypeSecret; | 2400 type = blink::WebCryptoKeyTypeSecret; |
2412 return !algorithm.isNull(); | 2401 return !algorithm.isNull(); |
2413 } | 2402 } |
2414 | 2403 |
2415 bool doReadRsaKey(bool hasHash, blink::WebCryptoKeyAlgorithm& algorithm, bli nk::WebCryptoKeyType& type) | 2404 bool doReadRsaHashedKey(blink::WebCryptoKeyAlgorithm& algorithm, blink::WebC ryptoKeyType& type) |
2416 { | 2405 { |
2417 blink::WebCryptoAlgorithmId id; | 2406 blink::WebCryptoAlgorithmId id; |
2418 if (!doReadAlgorithmId(id)) | 2407 if (!doReadAlgorithmId(id)) |
2419 return false; | 2408 return false; |
2420 | 2409 |
2421 uint32_t rawType; | 2410 uint32_t rawType; |
2422 if (!doReadUint32(&rawType)) | 2411 if (!doReadUint32(&rawType)) |
2423 return false; | 2412 return false; |
2424 | 2413 |
2425 switch (static_cast<AssymetricCryptoKeyType>(rawType)) { | 2414 switch (static_cast<AssymetricCryptoKeyType>(rawType)) { |
(...skipping 14 matching lines...) Expand all Loading... | |
2440 uint32_t publicExponentSize; | 2429 uint32_t publicExponentSize; |
2441 if (!doReadUint32(&publicExponentSize)) | 2430 if (!doReadUint32(&publicExponentSize)) |
2442 return false; | 2431 return false; |
2443 | 2432 |
2444 if (m_position + publicExponentSize > m_length) | 2433 if (m_position + publicExponentSize > m_length) |
2445 return false; | 2434 return false; |
2446 | 2435 |
2447 const uint8_t* publicExponent = m_buffer + m_position; | 2436 const uint8_t* publicExponent = m_buffer + m_position; |
2448 m_position += publicExponentSize; | 2437 m_position += publicExponentSize; |
2449 | 2438 |
2450 if (hasHash) { | 2439 blink::WebCryptoAlgorithmId hash; |
2451 blink::WebCryptoAlgorithmId hash; | 2440 if (!doReadAlgorithmId(hash)) |
2452 if (!doReadAlgorithmId(hash)) | 2441 return false; |
2453 return false; | 2442 algorithm = blink::WebCryptoKeyAlgorithm::createRsaHashed(id, modulusLen gthBits, publicExponent, publicExponentSize, hash); |
2454 algorithm = blink::WebCryptoKeyAlgorithm::createRsaHashed(id, modulu sLengthBits, publicExponent, publicExponentSize, hash); | |
2455 } else { | |
2456 algorithm = blink::WebCryptoKeyAlgorithm::createRsa(id, modulusLengt hBits, publicExponent, publicExponentSize); | |
2457 } | |
2458 | 2443 |
2459 return !algorithm.isNull(); | 2444 return !algorithm.isNull(); |
2460 } | 2445 } |
2461 | 2446 |
2462 bool doReadAlgorithmId(blink::WebCryptoAlgorithmId& id) | 2447 bool doReadAlgorithmId(blink::WebCryptoAlgorithmId& id) |
2463 { | 2448 { |
2464 uint32_t rawId; | 2449 uint32_t rawId; |
2465 if (!doReadUint32(&rawId)) | 2450 if (!doReadUint32(&rawId)) |
2466 return false; | 2451 return false; |
2467 | 2452 |
2468 switch (static_cast<CryptoKeyAlgorithmTag>(rawId)) { | 2453 switch (static_cast<CryptoKeyAlgorithmTag>(rawId)) { |
2469 case AesCbcTag: | 2454 case AesCbcTag: |
2470 id = blink::WebCryptoAlgorithmIdAesCbc; | 2455 id = blink::WebCryptoAlgorithmIdAesCbc; |
2471 return true; | 2456 return true; |
2472 case HmacTag: | 2457 case HmacTag: |
2473 id = blink::WebCryptoAlgorithmIdHmac; | 2458 id = blink::WebCryptoAlgorithmIdHmac; |
2474 return true; | 2459 return true; |
2475 case RsaSsaPkcs1v1_5Tag: | 2460 case RsaSsaPkcs1v1_5Tag: |
2476 id = blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5; | 2461 id = blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5; |
2477 return true; | 2462 return true; |
2478 case RsaEsPkcs1v1_5Tag: | 2463 case Deprecated_RsaEsPkcs1v1_5Tag: |
2479 id = blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5; | 2464 return false; |
jww
2014/05/21 17:19:23
Same question about ASSERT_NOT_REACHED as above.
eroman
2014/05/21 18:17:24
No longer applicable.
| |
2480 return true; | |
2481 case Sha1Tag: | 2465 case Sha1Tag: |
2482 id = blink::WebCryptoAlgorithmIdSha1; | 2466 id = blink::WebCryptoAlgorithmIdSha1; |
2483 return true; | 2467 return true; |
2484 case Sha256Tag: | 2468 case Sha256Tag: |
2485 id = blink::WebCryptoAlgorithmIdSha256; | 2469 id = blink::WebCryptoAlgorithmIdSha256; |
2486 return true; | 2470 return true; |
2487 case Sha384Tag: | 2471 case Sha384Tag: |
2488 id = blink::WebCryptoAlgorithmIdSha384; | 2472 id = blink::WebCryptoAlgorithmIdSha384; |
2489 return true; | 2473 return true; |
2490 case Sha512Tag: | 2474 case Sha512Tag: |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3058 // If the allocated memory was not registered before, then this class is lik ely | 3042 // If the allocated memory was not registered before, then this class is lik ely |
3059 // used in a context other then Worker's onmessage environment and the prese nce of | 3043 // used in a context other then Worker's onmessage environment and the prese nce of |
3060 // current v8 context is not guaranteed. Avoid calling v8 then. | 3044 // current v8 context is not guaranteed. Avoid calling v8 then. |
3061 if (m_externallyAllocatedMemory) { | 3045 if (m_externallyAllocatedMemory) { |
3062 ASSERT(v8::Isolate::GetCurrent()); | 3046 ASSERT(v8::Isolate::GetCurrent()); |
3063 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte rnallyAllocatedMemory); | 3047 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_exte rnallyAllocatedMemory); |
3064 } | 3048 } |
3065 } | 3049 } |
3066 | 3050 |
3067 } // namespace WebCore | 3051 } // namespace WebCore |
OLD | NEW |