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

Side by Side Diff: content/child/webcrypto/openssl/rsa_ssa_openssl.cc

Issue 671663002: Standardize usage of virtual/override/final in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/webcrypto/openssl/rsa_key_openssl.h" 5 #include "content/child/webcrypto/openssl/rsa_key_openssl.h"
6 #include "content/child/webcrypto/openssl/rsa_sign_openssl.h" 6 #include "content/child/webcrypto/openssl/rsa_sign_openssl.h"
7 #include "content/child/webcrypto/status.h" 7 #include "content/child/webcrypto/status.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 namespace webcrypto { 11 namespace webcrypto {
12 12
13 namespace { 13 namespace {
14 14
15 class RsaSsaImplementation : public RsaHashedAlgorithm { 15 class RsaSsaImplementation : public RsaHashedAlgorithm {
16 public: 16 public:
17 RsaSsaImplementation() 17 RsaSsaImplementation()
18 : RsaHashedAlgorithm(blink::WebCryptoKeyUsageVerify, 18 : RsaHashedAlgorithm(blink::WebCryptoKeyUsageVerify,
19 blink::WebCryptoKeyUsageSign) {} 19 blink::WebCryptoKeyUsageSign) {}
20 20
21 virtual const char* GetJwkAlgorithm( 21 const char* GetJwkAlgorithm(
22 const blink::WebCryptoAlgorithmId hash) const override { 22 const blink::WebCryptoAlgorithmId hash) const override {
23 switch (hash) { 23 switch (hash) {
24 case blink::WebCryptoAlgorithmIdSha1: 24 case blink::WebCryptoAlgorithmIdSha1:
25 return "RS1"; 25 return "RS1";
26 case blink::WebCryptoAlgorithmIdSha256: 26 case blink::WebCryptoAlgorithmIdSha256:
27 return "RS256"; 27 return "RS256";
28 case blink::WebCryptoAlgorithmIdSha384: 28 case blink::WebCryptoAlgorithmIdSha384:
29 return "RS384"; 29 return "RS384";
30 case blink::WebCryptoAlgorithmIdSha512: 30 case blink::WebCryptoAlgorithmIdSha512:
31 return "RS512"; 31 return "RS512";
32 default: 32 default:
33 return NULL; 33 return NULL;
34 } 34 }
35 } 35 }
36 36
37 virtual Status Sign(const blink::WebCryptoAlgorithm& algorithm, 37 Status Sign(const blink::WebCryptoAlgorithm& algorithm,
38 const blink::WebCryptoKey& key, 38 const blink::WebCryptoKey& key,
39 const CryptoData& data, 39 const CryptoData& data,
40 std::vector<uint8_t>* buffer) const override { 40 std::vector<uint8_t>* buffer) const override {
41 return RsaSign(key, 0, data, buffer); 41 return RsaSign(key, 0, data, buffer);
42 } 42 }
43 43
44 virtual Status Verify(const blink::WebCryptoAlgorithm& algorithm, 44 Status Verify(const blink::WebCryptoAlgorithm& algorithm,
45 const blink::WebCryptoKey& key, 45 const blink::WebCryptoKey& key,
46 const CryptoData& signature, 46 const CryptoData& signature,
47 const CryptoData& data, 47 const CryptoData& data,
48 bool* signature_match) const override { 48 bool* signature_match) const override {
49 return RsaVerify(key, 0, signature, data, signature_match); 49 return RsaVerify(key, 0, signature, data, signature_match);
50 } 50 }
51 }; 51 };
52 52
53 } // namespace 53 } // namespace
54 54
55 AlgorithmImplementation* CreatePlatformRsaSsaImplementation() { 55 AlgorithmImplementation* CreatePlatformRsaSsaImplementation() {
56 return new RsaSsaImplementation; 56 return new RsaSsaImplementation;
57 } 57 }
58 58
59 } // namespace webcrypto 59 } // namespace webcrypto
60 60
61 } // namespace content 61 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/openssl/rsa_pss_openssl.cc ('k') | content/child/webcrypto/openssl/sha_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698