commit - 39958d0b3edc8d5f522b8263cf8aa2cb1aa64020
commit + 7841c0d12f0a0e3f73db772df3b177a99ac0771f
blob - 151e0d73fa443289c8609863654c6bef6d128723
blob + 2817ac884ce25ec43a9812d10cca3e9dc017a4cf
--- lib/got_lib_privsep.h
+++ lib/got_lib_privsep.h
* Structure for GOT_IMSG_TREE_REQUEST and GOT_IMSG_OBJECT data.
*/
struct got_imsg_object {
- uint8_t id[SHA1_DIGEST_LENGTH];
+ struct got_object_id id;
/* These fields are the same as in struct got_object. */
int type;
blob - 970978560467422ed3a634b6c3b86e48e6b49fd0
blob + 1f118154617c4dae7a5a12d5531b577d6d906da7
--- lib/privsep.c
+++ lib/privsep.c
if (wbuf == NULL)
return got_error_from_errno("imsg_create TREE_REQUEST");
- if (imsg_add(wbuf, id->sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, id, sizeof(*id)) == -1)
return got_error_from_errno("imsg_add TREE_REQUEST");
if (pack_idx != -1) { /* tree is packed */
memset(&iobj, 0, sizeof(iobj));
- memcpy(iobj.id, obj->id.sha1, sizeof(iobj.id));
+ memcpy(&iobj.id, &obj->id, sizeof(iobj.id));
iobj.type = obj->type;
iobj.flags = obj->flags;
iobj.hdrlen = obj->hdrlen;
if (*obj == NULL)
return got_error_from_errno("calloc");
- memcpy((*obj)->id.sha1, iobj->id, SHA1_DIGEST_LENGTH);
+ memcpy(&(*obj)->id, &iobj->id, sizeof(iobj->id));
(*obj)->type = iobj->type;
(*obj)->flags = iobj->flags;
(*obj)->hdrlen = iobj->hdrlen;