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

Side by Side Diff: extensions/browser/content_verifier_delegate.h

Issue 280013003: More implementation details of extension content verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged latest trunk 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
« no previous file with comments | « extensions/browser/content_verifier.cc ('k') | extensions/browser/content_verifier_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_
6 #define EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_
7
8 #include "url/gurl.h"
9
10 namespace base {
11 class Version;
12 }
13
14 namespace extensions {
15
16 class Extension;
17
18 // A pointer to the bytes of a public key, and the number of bytes.
19 struct ContentVerifierKey {
20 const uint8* data;
21 int size;
22
23 ContentVerifierKey(const uint8* data, int size) {
24 this->data = data;
25 this->size = size;
26 }
27 };
28
29 // This is an interface for clients that want to use a ContentVerifier.
30 class ContentVerifierDelegate {
31 public:
32 virtual ~ContentVerifierDelegate() {}
33
34 // This should return true if the given extension should have its content
35 // verified.
36 virtual bool ShouldBeVerified(const Extension& extension) = 0;
37
38 // Should return the public key to use for validating signatures via the two
39 // out parameters. NOTE: the pointer returned *must* remain valid for the
40 // lifetime of this object.
41 virtual const ContentVerifierKey& PublicKey() = 0;
42
43 // This should return a URL that can be used to fetch the
44 // verified_contents.json containing signatures for the given extension
45 // id/version pair.
46 virtual GURL GetSignatureFetchUrl(const std::string& extension_id,
47 const base::Version& version) = 0;
48
49 // Called when the content verifier detects that a read of a file inside
50 // an extension did not match its expected hash.
51 virtual void VerifyFailed(const std::string& extension_id) = 0;
52 };
53
54 } // namespace extensions
55
56 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_
OLDNEW
« no previous file with comments | « extensions/browser/content_verifier.cc ('k') | extensions/browser/content_verifier_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698