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

Unified Diff: Source/platform/exported/WebCryptoAlgorithm.cpp

Issue 657243002: [webcrypto] Add parameter parsing for RSA-PSS. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/exported/WebCryptoAlgorithm.cpp
diff --git a/Source/platform/exported/WebCryptoAlgorithm.cpp b/Source/platform/exported/WebCryptoAlgorithm.cpp
index 1b9504e83dae5d3c5ecbf68b22cb99e0bcc2d98f..5696dbb95219c1114270124463b03cb47d1672f3 100644
--- a/Source/platform/exported/WebCryptoAlgorithm.cpp
+++ b/Source/platform/exported/WebCryptoAlgorithm.cpp
@@ -197,6 +197,20 @@ const WebCryptoAlgorithmInfo algorithmIdToInfo[] = {
WebCryptoAlgorithmParamsTypeNone, // WrapKey
WebCryptoAlgorithmParamsTypeNone // UnwrapKey
}
+ }, { // Index 11
+ "RSA-PSS", {
+ WebCryptoAlgorithmInfo::Undefined, // Encrypt
+ WebCryptoAlgorithmInfo::Undefined, // Decrypt
+ WebCryptoAlgorithmParamsTypeRsaPssParams, // Sign
+ WebCryptoAlgorithmParamsTypeRsaPssParams, // Verify
+ WebCryptoAlgorithmInfo::Undefined, // Digest
+ WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams, // GenerateKey
+ WebCryptoAlgorithmParamsTypeRsaHashedImportParams, // ImportKey
+ WebCryptoAlgorithmInfo::Undefined, // DeriveKey
+ WebCryptoAlgorithmInfo::Undefined, // DeriveBits
+ WebCryptoAlgorithmParamsTypeNone, // WrapKey
+ WebCryptoAlgorithmParamsTypeNone // UnwrapKey
+ }
},
};
@@ -214,7 +228,8 @@ COMPILE_ASSERT(WebCryptoAlgorithmIdAesGcm == 7, AesGcm_idDoesntMatch);
COMPILE_ASSERT(WebCryptoAlgorithmIdRsaOaep == 8, RsaOaep_idDoesntMatch);
COMPILE_ASSERT(WebCryptoAlgorithmIdAesCtr == 9, AesCtr_idDoesntMatch);
COMPILE_ASSERT(WebCryptoAlgorithmIdAesKw == 10, AesKw_idDoesntMatch);
-COMPILE_ASSERT(WebCryptoAlgorithmIdLast == 10, Last_idDoesntMatch);
+COMPILE_ASSERT(WebCryptoAlgorithmIdRsaPss == 11, RsaPss_idDoesntMatch);
+COMPILE_ASSERT(WebCryptoAlgorithmIdLast == 11, Last_idDoesntMatch);
COMPILE_ASSERT(10 == WebCryptoOperationLast, UpdateParamsMapping);
} // namespace
@@ -344,6 +359,14 @@ const WebCryptoRsaHashedKeyGenParams* WebCryptoAlgorithm::rsaHashedKeyGenParams(
return 0;
}
+const WebCryptoRsaPssParams* WebCryptoAlgorithm::rsaPssParams() const
+{
+ ASSERT(!isNull());
+ if (paramsType() == WebCryptoAlgorithmParamsTypeRsaPssParams)
+ return static_cast<WebCryptoRsaPssParams*>(m_private->params.get());
+ return 0;
+}
+
bool WebCryptoAlgorithm::isHash(WebCryptoAlgorithmId id)
{
switch (id) {
@@ -359,6 +382,7 @@ bool WebCryptoAlgorithm::isHash(WebCryptoAlgorithmId id)
case WebCryptoAlgorithmIdRsaOaep:
case WebCryptoAlgorithmIdAesCtr:
case WebCryptoAlgorithmIdAesKw:
+ case WebCryptoAlgorithmIdRsaPss:
break;
}
return false;
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698