Lines Matching defs:hash_file
222 parse_hash_file(const char *hash_file, char **pkgname,
234 if (strncmp(hash_file, block1, strlen(block1)) != 0)
236 hash_file += strlen(block1);
238 len = strcspn(hash_file, "\n");
240 memcpy(*pkgname, hash_file, len);
246 hash_file += len + 1;
248 if (strncmp(hash_file, block2, strlen(block2)) != 0)
250 hash_file += strlen(block2);
253 if (!isdigit((unsigned char)*hash_file))
255 state->sign_block_len = strtoul(hash_file, &next, 10);
256 hash_file = next;
259 if (*hash_file++ != '\n' || errno == ERANGE || state->sign_block_len < 1024)
262 if (strncmp(hash_file, block3, strlen(block3)) != 0)
264 hash_file += strlen(block3);
267 if (!isdigit((unsigned char)*hash_file))
270 state->pkg_size = strtoll(hash_file, &next, 10);
272 state->pkg_size = strtol(hash_file, &next, 10);
273 hash_file = next;
274 if (*hash_file++ != '\n' || errno == ERANGE || state->pkg_size < 1)
277 if (*hash_file++ != '\n')
289 len = strspn(hash_file, "01234567889abcdef");
290 if (len != SHA512_DIGEST_LENGTH * 2 || hash_file[len] != '\n')
293 memcpy(state->sign_blocks[i], hash_file, len);
295 hash_file += len + 1;
298 if (strcmp(hash_file, block4) != 0)
323 char *hash_file, *signature_file;
332 &hash_file, &hash_len);
343 if (parse_hash_file(hash_file, pkgname, state))
352 free(hash_file);
363 free(hash_file);
366 free(hash_file);
370 has_sig = !gpg_verify(hash_file, hash_len, gpg_keyring_verify,
376 has_sig = !easy_pkcs7_verify(hash_file, hash_len, signature_file,
529 char *hash_file, *signature_file, *tmp, *pkgname, hash[SHA512_DIGEST_STRING_LENGTH];
543 hash_file = xasprintf(hash_template, pkgname,
555 tmp = xasprintf("%s%s\n", hash_file, hash);
556 free(hash_file);
557 hash_file = tmp;
559 tmp = xasprintf("%s%s", hash_file, hash_trailer);
560 free(hash_file);
561 hash_file = tmp;
563 if (easy_pkcs7_sign(hash_file, strlen(hash_file), &signature_file,
575 archive_entry_set_size(hash_entry, strlen(hash_file));
583 archive_write_data(pkg, hash_file, strlen(hash_file));
622 char *hash_file, *signature_file, *tmp, *pkgname, hash[SHA512_DIGEST_STRING_LENGTH];
637 hash_file = xasprintf(hash_template, pkgname, (long long)size);
649 tmp = xasprintf("%s%s\n", hash_file, hash);
650 free(hash_file);
651 hash_file = tmp;
653 tmp = xasprintf("%s%s", hash_file, hash_trailer);
654 free(hash_file);
655 hash_file = tmp;
657 if (detached_gpg_sign(hash_file, strlen(hash_file), &signature_file,
669 archive_entry_set_size(hash_entry, strlen(hash_file));
677 archive_write_data(pkg, hash_file, strlen(hash_file));