Home | History | Annotate | Download | only in futility

Lines Matching defs:gbb

58 	GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader *)buf;
60 if (memcmp(gbb->signature, GBB_SIGNATURE, GBB_SIGNATURE_SIZE))
62 if (gbb->major_version > GBB_MAJOR_VER)
71 int futil_valid_gbb_header(GoogleBinaryBlockHeader *gbb, uint32_t len,
77 if (memcmp(gbb->signature, GBB_SIGNATURE, GBB_SIGNATURE_SIZE))
79 if (gbb->major_version != GBB_MAJOR_VER)
84 uint32_t maxlen = gbb->header_size;
86 gbb->hwid_offset + gbb->hwid_size);
88 gbb->rootkey_offset + gbb->rootkey_size);
90 gbb->bmpfv_offset + gbb->bmpfv_size);
92 gbb->recovery_key_offset + gbb->recovery_key_size);
96 if (gbb->header_size != GBB_HEADER_SIZE || gbb->header_size > len)
98 if (gbb->hwid_offset < GBB_HEADER_SIZE)
100 if (gbb->hwid_offset + gbb->hwid_size > len)
102 if (gbb->hwid_size) {
104 ((uint8_t *)gbb + gbb->hwid_offset);
105 if (!is_null_terminated(s, gbb->hwid_size))
108 if (gbb->rootkey_offset < GBB_HEADER_SIZE)
110 if (gbb->rootkey_offset + gbb->rootkey_size > len)
113 if (gbb->bmpfv_offset < GBB_HEADER_SIZE)
115 if (gbb->bmpfv_offset + gbb->bmpfv_size > len)
117 if (gbb->recovery_key_offset < GBB_HEADER_SIZE)
119 if (gbb->recovery_key_offset + gbb->recovery_key_size > len)
126 /* For GBB v1.2 and later, print the stored digest of the HWID (and whether
128 int print_hwid_digest(GoogleBinaryBlockHeader *gbb,
134 if (gbb->minor_version < 2) {
139 uint8_t *buf = (uint8_t *)gbb;
140 char *hwid_str = (char *)(buf + gbb->hwid_offset);
142 uint8_t *digest = DigestBuf(buf + gbb->hwid_offset,
150 printf("%02x", gbb->hwid_digest[i]);
151 if (gbb->hwid_digest[i] != digest[i])
162 /* For GBB v1.2 and later, update the hwid_digest field. */
163 void update_hwid_digest(GoogleBinaryBlockHeader *gbb)
166 if (gbb->minor_version < 2)
169 uint8_t *buf = (uint8_t *)gbb;
170 char *hwid_str = (char *)(buf + gbb->hwid_offset);
171 uint8_t *digest = DigestBuf(buf + gbb->hwid_offset,
174 memcpy(gbb->hwid_digest, digest, SHA256_DIGEST_SIZE);