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

Unified Diff: content/child/webcrypto/openssl/rsa_pss_openssl.cc

Issue 661653002: [webcrypto] Implement RSA-PSS using BoringSSL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_rsassa
Patch Set: rebase onto master (corrected) 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 | « content/child/webcrypto/nss/util_nss.cc ('k') | content/child/webcrypto/openssl/rsa_sign_openssl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/openssl/rsa_pss_openssl.cc
diff --git a/content/child/webcrypto/openssl/rsa_ssa_openssl.cc b/content/child/webcrypto/openssl/rsa_pss_openssl.cc
similarity index 70%
copy from content/child/webcrypto/openssl/rsa_ssa_openssl.cc
copy to content/child/webcrypto/openssl/rsa_pss_openssl.cc
index be974cc405e4d5871b4dbf1ea5ffe1e75fb3b908..6132b542f9b20d9097da3d2e04a96fa5ebab49f7 100644
--- a/content/child/webcrypto/openssl/rsa_ssa_openssl.cc
+++ b/content/child/webcrypto/openssl/rsa_pss_openssl.cc
@@ -5,6 +5,7 @@
#include "content/child/webcrypto/openssl/rsa_key_openssl.h"
#include "content/child/webcrypto/openssl/rsa_sign_openssl.h"
#include "content/child/webcrypto/status.h"
+#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
namespace content {
@@ -12,9 +13,9 @@ namespace webcrypto {
namespace {
-class RsaSsaImplementation : public RsaHashedAlgorithm {
+class RsaPssImplementation : public RsaHashedAlgorithm {
public:
- RsaSsaImplementation()
+ RsaPssImplementation()
: RsaHashedAlgorithm(blink::WebCryptoKeyUsageVerify,
blink::WebCryptoKeyUsageSign) {}
@@ -22,13 +23,13 @@ class RsaSsaImplementation : public RsaHashedAlgorithm {
const blink::WebCryptoAlgorithmId hash) const override {
switch (hash) {
case blink::WebCryptoAlgorithmIdSha1:
- return "RS1";
+ return "PS1";
case blink::WebCryptoAlgorithmIdSha256:
- return "RS256";
+ return "PS256";
case blink::WebCryptoAlgorithmIdSha384:
- return "RS384";
+ return "PS384";
case blink::WebCryptoAlgorithmIdSha512:
- return "RS512";
+ return "PS512";
default:
return NULL;
}
@@ -38,7 +39,8 @@ class RsaSsaImplementation : public RsaHashedAlgorithm {
const blink::WebCryptoKey& key,
const CryptoData& data,
std::vector<uint8_t>* buffer) const override {
- return RsaSign(key, data, buffer);
+ return RsaSign(
+ key, algorithm.rsaPssParams()->saltLengthBytes(), data, buffer);
}
virtual Status Verify(const blink::WebCryptoAlgorithm& algorithm,
@@ -46,14 +48,18 @@ class RsaSsaImplementation : public RsaHashedAlgorithm {
const CryptoData& signature,
const CryptoData& data,
bool* signature_match) const override {
- return RsaVerify(key, signature, data, signature_match);
+ return RsaVerify(key,
+ algorithm.rsaPssParams()->saltLengthBytes(),
+ signature,
+ data,
+ signature_match);
}
};
} // namespace
-AlgorithmImplementation* CreatePlatformRsaSsaImplementation() {
- return new RsaSsaImplementation;
+AlgorithmImplementation* CreatePlatformRsaPssImplementation() {
+ return new RsaPssImplementation;
}
} // namespace webcrypto
« no previous file with comments | « content/child/webcrypto/nss/util_nss.cc ('k') | content/child/webcrypto/openssl/rsa_sign_openssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698