| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsaHashed( | 90 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsaHashed( |
| 91 WebCryptoAlgorithmId id, | 91 WebCryptoAlgorithmId id, |
| 92 unsigned modulusLengthBits, | 92 unsigned modulusLengthBits, |
| 93 const unsigned char* publicExponent, | 93 const unsigned char* publicExponent, |
| 94 unsigned publicExponentSize, | 94 unsigned publicExponentSize, |
| 95 WebCryptoAlgorithmId hash) { | 95 WebCryptoAlgorithmId hash) { |
| 96 // FIXME: Verify that id is an RSA algorithm which expects a hash | 96 // FIXME: Verify that id is an RSA algorithm which expects a hash |
| 97 if (!WebCryptoAlgorithm::isHash(hash)) | 97 if (!WebCryptoAlgorithm::isHash(hash)) |
| 98 return WebCryptoKeyAlgorithm(); | 98 return WebCryptoKeyAlgorithm(); |
| 99 return WebCryptoKeyAlgorithm( | 99 return WebCryptoKeyAlgorithm( |
| 100 id, WTF::wrapUnique(new WebCryptoRsaHashedKeyAlgorithmParams( | 100 id, |
| 101 modulusLengthBits, publicExponent, publicExponentSize, | 101 WTF::wrapUnique(new WebCryptoRsaHashedKeyAlgorithmParams( |
| 102 createHash(hash)))); | 102 modulusLengthBits, publicExponent, publicExponentSize, |
| 103 createHash(hash)))); |
| 103 } | 104 } |
| 104 | 105 |
| 105 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createEc( | 106 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createEc( |
| 106 WebCryptoAlgorithmId id, | 107 WebCryptoAlgorithmId id, |
| 107 WebCryptoNamedCurve namedCurve) { | 108 WebCryptoNamedCurve namedCurve) { |
| 108 return WebCryptoKeyAlgorithm( | 109 return WebCryptoKeyAlgorithm( |
| 109 id, WTF::makeUnique<WebCryptoEcKeyAlgorithmParams>(namedCurve)); | 110 id, WTF::makeUnique<WebCryptoEcKeyAlgorithmParams>(namedCurve)); |
| 110 } | 111 } |
| 111 | 112 |
| 112 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createWithoutParams( | 113 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createWithoutParams( |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 175 |
| 175 void WebCryptoKeyAlgorithm::assign(const WebCryptoKeyAlgorithm& other) { | 176 void WebCryptoKeyAlgorithm::assign(const WebCryptoKeyAlgorithm& other) { |
| 176 m_private = other.m_private; | 177 m_private = other.m_private; |
| 177 } | 178 } |
| 178 | 179 |
| 179 void WebCryptoKeyAlgorithm::reset() { | 180 void WebCryptoKeyAlgorithm::reset() { |
| 180 m_private.reset(); | 181 m_private.reset(); |
| 181 } | 182 } |
| 182 | 183 |
| 183 } // namespace blink | 184 } // namespace blink |
| OLD | NEW |