| 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 bool parseAesDerivedKeyParams(const Dictionary& raw, std::unique_ptr<WebCryptoAl
gorithmParams>& params, const ErrorContext& context, AlgorithmError* error) | 790 bool parseAesDerivedKeyParams(const Dictionary& raw, std::unique_ptr<WebCryptoAl
gorithmParams>& params, const ErrorContext& context, AlgorithmError* error) |
| 791 { | 791 { |
| 792 uint16_t length; | 792 uint16_t length; |
| 793 if (!getUint16(raw, "length", length, context, error)) | 793 if (!getUint16(raw, "length", length, context, error)) |
| 794 return false; | 794 return false; |
| 795 | 795 |
| 796 params = wrapUnique(new WebCryptoAesDerivedKeyParams(length)); | 796 params = wrapUnique(new WebCryptoAesDerivedKeyParams(length)); |
| 797 return true; | 797 return true; |
| 798 } | 798 } |
| 799 | 799 |
| 800 // FIXME: once the spec has been updated, check that the implementation is | 800 // Defined by the WebCrypto spec as: |
| 801 // still correct and update this comment. http://crbug.com/399095 | |
| 802 // | |
| 803 // The WebCrypto spec hasn't been updated yet to define HKDF | |
| 804 // (https://www.w3.org/Bugs/Public/show_bug.cgi?id=27425). The assumed | |
| 805 // parameters are: | |
| 806 // | 801 // |
| 807 // dictionary HkdfParams : Algorithm { | 802 // dictionary HkdfParams : Algorithm { |
| 808 // required HashAlgorithmIdentifier hash; | 803 // required HashAlgorithmIdentifier hash; |
| 809 // required BufferSource salt; | 804 // required BufferSource salt; |
| 810 // required BufferSource info; | 805 // required BufferSource info; |
| 811 // }; | 806 // }; |
| 812 bool parseHkdfParams(const Dictionary& raw, std::unique_ptr<WebCryptoAlgorithmPa
rams>& params, const ErrorContext& context, AlgorithmError* error) | 807 bool parseHkdfParams(const Dictionary& raw, std::unique_ptr<WebCryptoAlgorithmPa
rams>& params, const ErrorContext& context, AlgorithmError* error) |
| 813 { | 808 { |
| 814 WebCryptoAlgorithm hash; | 809 WebCryptoAlgorithm hash; |
| 815 if (!parseHash(raw, hash, context, error)) | 810 if (!parseHash(raw, hash, context, error)) |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 } | 966 } |
| 972 | 967 |
| 973 } // namespace | 968 } // namespace |
| 974 | 969 |
| 975 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op, W
ebCryptoAlgorithm& algorithm, AlgorithmError* error) | 970 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op, W
ebCryptoAlgorithm& algorithm, AlgorithmError* error) |
| 976 { | 971 { |
| 977 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); | 972 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); |
| 978 } | 973 } |
| 979 | 974 |
| 980 } // namespace blink | 975 } // namespace blink |
| OLD | NEW |