File: crx3.proto

package info (click to toggle)
chromium 138.0.7204.157-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,864 kB
  • sloc: cpp: 34,936,859; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,967; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (62 lines) | stat: -rw-r--r-- 2,614 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package crx_file;

// A CRX₃ file is a binary file of the following format:
// [4 octets]: "Cr24", a magic number.
// [4 octets]: The version of the *.crx file format used (currently 3).
// [4 octets]: N, little-endian, the length of the header section.
// [N octets]: The header (the binary encoding of a CrxFileHeader).
// [M octets]: The ZIP archive.
// Clients should reject CRX₃ files that contain an N that is too large for the
// client to safely handle in memory.

message CrxFileHeader {
  // PSS signature with RSA public key. The public key is formatted as a
  // X.509 SubjectPublicKeyInfo block, as in CRX₂. In the common case of a
  // developer key proof, the first 128 bits of the SHA-256 hash of the
  // public key must equal the crx_id.
  repeated AsymmetricKeyProof sha256_with_rsa = 2;

  // ECDSA signature, using the NIST P-256 curve. Public key appears in
  // named-curve format.
  // The pinned algorithm will be this, at least on 2017-01-01.
  repeated AsymmetricKeyProof sha256_with_ecdsa = 3;

  // A verified contents file containing signatures over the archive contents.
  // The verified contents are encoded in UTF-8 and then GZIP-compressed.
  // Consult
  // https://source.chromium.org/chromium/chromium/src/+/main:extensions/browser/verified_contents.h
  // for information about the verified contents format.
  optional bytes verified_contents = 4;

  // The binary form of a SignedData message. We do not use a nested
  // SignedData message, as handlers of this message must verify the proofs
  // on exactly these bytes, so it is convenient to parse in two steps.
  //
  // All proofs in this CrxFile message are on the value
  // "CRX3 SignedData\x00" + signed_header_size + signed_header_data +
  // archive, where "\x00" indicates an octet with value 0, "CRX3 SignedData"
  // is encoded using UTF-8, signed_header_size is the size in octets of the
  // contents of this field and is encoded using 4 octets in little-endian
  // order, signed_header_data is exactly the content of this field, and
  // archive is the remaining contents of the file following the header.
  optional bytes signed_header_data = 10000;
}

message AsymmetricKeyProof {
  optional bytes public_key = 1;
  optional bytes signature = 2;
}

message SignedData {
  // This is simple binary, not UTF-8 encoded mpdecimal; i.e. it is exactly
  // 16 bytes long.
  optional bytes crx_id = 1;
}