OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extensions/common/crx_file.h" | 5 #include "components/crx_file/crx_file.h" |
6 | 6 |
7 namespace extensions { | 7 namespace crx_file { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
11 // The current version of the crx format. | 11 // The current version of the crx format. |
12 static const uint32 kCurrentVersion = 2; | 12 static const uint32 kCurrentVersion = 2; |
13 | 13 |
14 // The current version of the crx diff format. | 14 // The current version of the crx diff format. |
15 static const uint32 kCurrentDiffVersion = 0; | 15 static const uint32 kCurrentDiffVersion = 0; |
16 | 16 |
17 // The maximum size the crx parser will tolerate for a public key. | 17 // The maximum size the crx parser will tolerate for a public key. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 *error = kInvalidKeyTooSmall; | 71 *error = kInvalidKeyTooSmall; |
72 else if (header.signature_size > kMaxSignatureSize) | 72 else if (header.signature_size > kMaxSignatureSize) |
73 *error = kInvalidSignatureTooLarge; | 73 *error = kInvalidSignatureTooLarge; |
74 else if (header.signature_size == 0) | 74 else if (header.signature_size == 0) |
75 *error = kInvalidSignatureTooSmall; | 75 *error = kInvalidSignatureTooSmall; |
76 else | 76 else |
77 valid = true; | 77 valid = true; |
78 return valid; | 78 return valid; |
79 } | 79 } |
80 | 80 |
81 } // namespace extensions | 81 } // namespace crx_file |
OLD | NEW |