Lines Matching full:header
25 // The magic string embedded in the header.
29 scoped_ptr<CrxFile> CrxFile::Parse(const CrxFile::Header& header,
31 if (HeaderIsValid(header, error))
32 return scoped_ptr<CrxFile>(new CrxFile(header));
39 CrxFile::Header header;
40 memcpy(&header.magic, kCrxFileHeaderMagic, kCrxFileHeaderMagicSize);
41 header.version = kCurrentVersion;
42 header.key_size = key_size;
43 header.signature_size = signature_size;
44 if (HeaderIsValid(header, error))
45 return scoped_ptr<CrxFile>(new CrxFile(header));
49 CrxFile::CrxFile(const Header& header) : header_(header) {
52 bool CrxFile::HeaderIsDelta(const CrxFile::Header& header) {
53 return !strncmp(kCrxDiffFileHeaderMagic, header.magic, sizeof(header.magic));
56 bool CrxFile::HeaderIsValid(const CrxFile::Header& header,
60 if (!strncmp(kCrxDiffFileHeaderMagic, header.magic, sizeof(header.magic)))
62 if (strncmp(kCrxFileHeaderMagic, header.magic, sizeof(header.magic)) &&
65 else if (header.version != kCurrentVersion
66 && !(diffCrx && header.version == kCurrentDiffVersion))
68 else if (header.key_size > kMaxPublicKeySize)
70 else if (header.key_size == 0)
72 else if (header.signature_size > kMaxSignatureSize)
74 else if (header.signature_size == 0)