OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 25 matching lines...) Expand all Loading... |
36 #include "modules/crypto/CryptoResultImpl.h" | 36 #include "modules/crypto/CryptoResultImpl.h" |
37 #include "modules/crypto/Key.h" | 37 #include "modules/crypto/Key.h" |
38 #include "modules/crypto/NormalizeAlgorithm.h" | 38 #include "modules/crypto/NormalizeAlgorithm.h" |
39 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
40 #include "public/platform/WebCrypto.h" | 40 #include "public/platform/WebCrypto.h" |
41 #include "public/platform/WebCryptoAlgorithm.h" | 41 #include "public/platform/WebCryptoAlgorithm.h" |
42 #include "wtf/ArrayBufferView.h" | 42 #include "wtf/ArrayBufferView.h" |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 DEFINE_GC_INFO(SubtleCrypto); | |
47 | |
48 namespace { | 46 namespace { |
49 | 47 |
50 bool parseAlgorithm(const Dictionary& rawAlgorithm, AlgorithmOperation operation
Type, blink::WebCryptoAlgorithm &algorithm, ExceptionState& exceptionState, Cryp
toResult* result) | 48 bool parseAlgorithm(const Dictionary& rawAlgorithm, AlgorithmOperation operation
Type, blink::WebCryptoAlgorithm &algorithm, ExceptionState& exceptionState, Cryp
toResult* result) |
51 { | 49 { |
52 if (!rawAlgorithm.isObject()) { | 50 if (!rawAlgorithm.isObject()) { |
53 exceptionState.throwTypeError("Algorithm: Not an object"); | 51 exceptionState.throwTypeError("Algorithm: Not an object"); |
54 return false; | 52 return false; |
55 } | 53 } |
56 return parseAlgorithm(rawAlgorithm, operationType, algorithm, result); | 54 return parseAlgorithm(rawAlgorithm, operationType, algorithm, result); |
57 } | 55 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 return promise; | 282 return promise; |
285 | 283 |
286 const unsigned char* wrappedKeyData = static_cast<const unsigned char*>(wrap
pedKey->baseAddress()); | 284 const unsigned char* wrappedKeyData = static_cast<const unsigned char*>(wrap
pedKey->baseAddress()); |
287 unsigned wrappedKeyDataSize = wrappedKey->byteLength(); | 285 unsigned wrappedKeyDataSize = wrappedKey->byteLength(); |
288 | 286 |
289 blink::Platform::current()->crypto()->unwrapKey(format, wrappedKeyData, wrap
pedKeyDataSize, unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, ex
tractable, keyUsages, result->result()); | 287 blink::Platform::current()->crypto()->unwrapKey(format, wrappedKeyData, wrap
pedKeyDataSize, unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, ex
tractable, keyUsages, result->result()); |
290 return promise; | 288 return promise; |
291 } | 289 } |
292 | 290 |
293 } // namespace WebCore | 291 } // namespace WebCore |
OLD | NEW |