Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: trunk/Source/platform/exported/WebCryptoAlgorithm.cpp

Issue 296333002: Revert 174726 "[webcrypto] Remove RSA-ES support (3 of 3)" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 const WebCryptoHmacKeyGenParams* WebCryptoAlgorithm::hmacKeyGenParams() const 118 const WebCryptoHmacKeyGenParams* WebCryptoAlgorithm::hmacKeyGenParams() const
119 { 119 {
120 ASSERT(!isNull()); 120 ASSERT(!isNull());
121 if (paramsType() == WebCryptoAlgorithmParamsTypeHmacKeyGenParams) 121 if (paramsType() == WebCryptoAlgorithmParamsTypeHmacKeyGenParams)
122 return static_cast<WebCryptoHmacKeyGenParams*>(m_private->params.get()); 122 return static_cast<WebCryptoHmacKeyGenParams*>(m_private->params.get());
123 return 0; 123 return 0;
124 } 124 }
125 125
126 const WebCryptoRsaKeyGenParams* WebCryptoAlgorithm::rsaKeyGenParams() const
127 {
128 ASSERT(!isNull());
129 if (paramsType() == WebCryptoAlgorithmParamsTypeRsaKeyGenParams)
130 return static_cast<WebCryptoRsaKeyGenParams*>(m_private->params.get());
131 return 0;
132 }
133
126 const WebCryptoAesGcmParams* WebCryptoAlgorithm::aesGcmParams() const 134 const WebCryptoAesGcmParams* WebCryptoAlgorithm::aesGcmParams() const
127 { 135 {
128 ASSERT(!isNull()); 136 ASSERT(!isNull());
129 if (paramsType() == WebCryptoAlgorithmParamsTypeAesGcmParams) 137 if (paramsType() == WebCryptoAlgorithmParamsTypeAesGcmParams)
130 return static_cast<WebCryptoAesGcmParams*>(m_private->params.get()); 138 return static_cast<WebCryptoAesGcmParams*>(m_private->params.get());
131 return 0; 139 return 0;
132 } 140 }
133 141
134 const WebCryptoRsaOaepParams* WebCryptoAlgorithm::rsaOaepParams() const 142 const WebCryptoRsaOaepParams* WebCryptoAlgorithm::rsaOaepParams() const
135 { 143 {
(...skipping 23 matching lines...) Expand all
159 { 167 {
160 switch (id) { 168 switch (id) {
161 case WebCryptoAlgorithmIdSha1: 169 case WebCryptoAlgorithmIdSha1:
162 case WebCryptoAlgorithmIdSha256: 170 case WebCryptoAlgorithmIdSha256:
163 case WebCryptoAlgorithmIdSha384: 171 case WebCryptoAlgorithmIdSha384:
164 case WebCryptoAlgorithmIdSha512: 172 case WebCryptoAlgorithmIdSha512:
165 return true; 173 return true;
166 case WebCryptoAlgorithmIdAesCbc: 174 case WebCryptoAlgorithmIdAesCbc:
167 case WebCryptoAlgorithmIdHmac: 175 case WebCryptoAlgorithmIdHmac:
168 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: 176 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5:
177 case WebCryptoAlgorithmIdRsaEsPkcs1v1_5:
169 case WebCryptoAlgorithmIdAesGcm: 178 case WebCryptoAlgorithmIdAesGcm:
170 case WebCryptoAlgorithmIdRsaOaep: 179 case WebCryptoAlgorithmIdRsaOaep:
171 case WebCryptoAlgorithmIdAesCtr: 180 case WebCryptoAlgorithmIdAesCtr:
172 case WebCryptoAlgorithmIdAesKw: 181 case WebCryptoAlgorithmIdAesKw:
173 break; 182 break;
174 } 183 }
175 return false; 184 return false;
176 } 185 }
177 186
178 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other) 187 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other)
179 { 188 {
180 m_private = other.m_private; 189 m_private = other.m_private;
181 } 190 }
182 191
183 void WebCryptoAlgorithm::reset() 192 void WebCryptoAlgorithm::reset()
184 { 193 {
185 m_private.reset(); 194 m_private.reset();
186 } 195 }
187 196
188 } // namespace blink 197 } // namespace blink
OLDNEW
« no previous file with comments | « trunk/Source/modules/crypto/RsaKeyAlgorithm.cpp ('k') | trunk/Source/platform/exported/WebCryptoKeyAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698